Scientific Forums


 

Add reply · Start new topic ·


> Deriving A Formula From Points On A Graph
Meadock
Posted: Sep 12 2007, 09:41 PM


Newbie
*

Group: Members
Posts: 6
Joined: 11-September 07

Positive Feedback: 0%
Feedback Score: 0


How do you derive a formula from points on a graph?

Let's say we have the following points:

x | y
---------
5 | 10
10 | 25
15 | 45
20 | 70

As far as I can figure, you're suppose to find the differences between the y's. They are:

15, 20, 25

The differences between those numbers is 5

Not sure what I'm suppose to do after that. Thanks.
Top
bm1957
Posted: Sep 13 2007, 09:22 AM


Advanced Member
*****

Group: Power Member
Posts: 1551
Joined: 11-April 07

Positive Feedback: 82.46%
Feedback Score: 106


QUOTE (Meadock @ Sep 12 2007, 09:41 PM)
How do you derive a formula from points on a graph?

Let's say we have the following points:

x  | y
---------
5  | 10
10 | 25
15 | 45
20 | 70

As far as I can figure, you're suppose to find the differences between the y's.  They are:

15, 20, 25

The differences between those numbers is 5

Not sure what I'm suppose to do after that.  Thanks.

I would find a formula for the nth term in each sequence:

x(0)=5
x(1)=10
x(2)=15
x(3)=20
.
.
.
x(n)=5(n+1)

similarly for y:

y(0)=10
y(1)=25
y(2)=45
y(3)=70
.
y(n)=(post back if you need a pointer for this)


Then you'll have:

x=5(n+1); n=(x/5)-1
y=f(n); y=f((x/5)-1)

Make sense?
Top
mr_homm
Posted: Sep 13 2007, 03:07 PM


Advanced Member
*****

Group: Power Member
Posts: 881
Joined: 31-March 06

Positive Feedback: 96.83%
Feedback Score: 143


I just can't resist this one, because this was the very first independent math I did. When I was about 6 years old, I suddenly became very interested in sequences of integers, and I figured out that if you took the differences, then the differences of the differences, and so on, until you got down to a single number, you could then assume that number was constant and "propagate" the sequence forward and backwards as far as you wanted.

Of course, you could also go further, and make any assumption you wanted about that bottom number, so it became clear that you could fit any finite sequence into arbitrarily many different infinite sequences that validly continued it. (Pretty good for 6 years old, if I do say so myself.) But there is one SIMPLEST sequence you can get, and that is the one that comes from assuming the bottom number is a constant.

Later, when I learned a little algebra, it became clear that I was finding polynomial sequences, and the degree of the polynomial was one less than the length of the finite sequence you were fitting. From that, it was fairly easy to extract the polynomial coefficients by a form of "long division."

Here is an example of what I mean:

CODE

x^3:
0   1   8  27  64  125
 1   7  19  37  61
   6  12  18  24
     6   6   6  ...

x^2:
0   1   4   9  16  15
 1   3   5   7   9
   2   2   2   2  ...

x^1:
0   1   2   3   4   5
 1   1   1   1   1  ...

x^0:
1   1   1   1   1   1  ...


Look at the numbers running down the left diagonal edge of each pattern. For x^0 you just get 1, for x^3 you get 0,1,6,6. You can make a table of these:

CODE

1  0  0  0 ...
  1  1  1 ...
     2  6 ...
        6 ...
    .
    .
    .


This table has a pattern, too: each number is the sum of its neighbor to the left and the number just above that neighbor, multiplied by the row number. In terms of a formula, n_(i,j) = i*(n_(i-1,j-1) + n_(i,j-1)). (A friend of mine in junior high spotted this pattern, so I don't take credit for it.) From this, you can extend the table as far as you wish.

Now you can find the simplest polynomial fit to any finite sequence very easily. Let's use yours as an example:

Since you're counting by 5's, you make a table of what each power of x will do:

CODE

x^0 = 1   1   1   1      -->   1
x^1 = 5  10  15  20
       5   5   5        -->   5, 5
x^2 = 25   100  225  400
        75   125  175
           50   50      -->   25, 75, 50


Now you find the diagonal pattern of your sequence and do long division. You always match the bottom number first, since that represents the highest power of x. Once it is removed, the next lower power of x will be revealed:

CODE

y = 10   25   45   70
      15   20   25
         5    5          -->  10, 15, 5.

(10, 15, 5) = 0.1*(25, 75, 50) + (7.5, 7.5)
(7.5, 7,5) = 1.5*(5, 5) + 0


Then the coefficients of the polynomial are just the coefficients that appeared in the long division. In other words, y = 0.1x^2 + 1.5x.

This method is very efficient if the points are evenly spaced in x, because as I said, it was originally meant to work on SEQUENCES not pairs of coordinates with unevenly spaced values for x. When I got into high school, I was very depressed to learn that my method had been invented by Lagrange several hundred years ago. (That's what happens when you grow up on an isolated farm with no one around who knows any math. You end up reinventing the wheel several centuries late.)

Lagrange's method is also more flexible than mine, because he intended it from the beginning for finding polynomials through random data. The essence of the idea is to find a polynomial that is zero at all of the x values but one, and has a value of exactly 1 at that single point. Do this for each point and then scale them up to get the actual y values, then add them together. The result will be a polynomial that passes through all of your data points.

To construct these polynomials, you just multiply together factors of (x-x_i) for each value x_i in your set of x coordinates, leaving out one of them. For your data, this gives (x-10)*(x-15)*(x-20) as a polynomial that is zero except at the first point. You then divide it by its own value at that point, to make it give y=1 there. This means that you use (x-10)*(x-15)*(x-20)/((5-10)*(5-15)*(5-20)). You do this again for the other three points to get the polynomials for them. Then you multiply each of these polynomials by the y value you want to get and add them. The formula for the whole process is

f(x) = sum over i ( y_i * product over all j except j=i (x-x_j)/(x_i-x_j))).

For your example, the calculation would be like this:

CODE

f(x) =
10*(                  (x-10)/( 5-10) * (x-15)/( 5-15) * (x-20)/( 5-20) ) +
25*( (x- 5)/(10- 5) *                  (x-15)/(10-15) * (x-20)/(10-20) ) +
45*( (x- 5)/(15- 5) * (x-10)/(15-10) *                  (x-20)/(15-20) ) +
70*( (x- 5)/(20- 5) * (x-10)/(20-10) * (x-15)/(20-15)                  ) =
...
(skipping lots of algebraic simplification)
...
0.1x^2 + 1.5x


For evenly spaced data, my way is much shorter, but Lagrange's works on everything. Try googling for "Lagrange interpolation" to see more.

Hope this helps!

--Stuart Anderson


--------------------
A hallmark of intelligence is the ability to give precise answers to vague questions.
Top
bm1957
Posted: Sep 13 2007, 03:33 PM


Advanced Member
*****

Group: Power Member
Posts: 1551
Joined: 11-April 07

Positive Feedback: 82.46%
Feedback Score: 106


QUOTE (mr_homm @ Sep 13 2007, 03:07 PM)
I just can't resist this one, because this was the very first independent math I did. When I was about 6 years old, I suddenly became very interested in sequences of integers, and I figured out that if you took the differences, then the differences of the differences, and so on, until you got down to a single number, you could then assume that number was constant and "propagate" the sequence forward and backwards as far as you wanted.

I came upon a similar realisation when I learnt the formula for triangle numbers at school.

When I was very young (I would guess about 6 would be fair), I realised that summing the numbers on my TV set (1-10) gave the result of 55, and pairing the numbers to 11 meant that this was also (10+1)*(10/2) and that this result could be extended to the sum of any such sequence.

Little did I realise at the time that I had worked out triangle numbers, and nobody believed me when I recounted it at school!

(As I grow older my belief that it actually happened diminishes; I know so many people of my age now that would never be able to do it!!!)

I guess it just shows that Maths is something that it helps to have an inate ability in, some people just can't learn it however hard they try.
Top
mr_homm
Posted: Sep 13 2007, 06:34 PM


Advanced Member
*****

Group: Power Member
Posts: 881
Joined: 31-March 06

Positive Feedback: 96.83%
Feedback Score: 143


QUOTE (bm1957 @ Sep 13 2007, 08:33 AM)

Little did I realise at the time that I had worked out triangle numbers, and nobody believed me when I recounted it at school!

(As I grow older my belief that it actually happened diminishes; I know so many people of my age now that would never be able to do it!!!)

I guess it just shows that Maths is something that it helps to have an innate ability in, some people just can't learn it however hard they try.

Hi bm1957,

It looks like we've had very similar experiences. I never doubted myself, though, because my mother kept all my old grade school papers with math on them in my childish hand printing!

In the second grade, our teacher asked the class (I don't know why) if anyone knew what algebra was. I thought that what I had found with number sequences was part of algebra, so I explained it to her and she wrote it on the board. Then she said "that's not algebra" and erased it. That was the last time I mentioned it in school.

None of the teachers at my school knew any real math, and my community did not have a library (too small), so I had no way to find out what math was out there until I got to high school and found some teachers who knew something. Of course I ended up majoring in it (and in physics) in college and going on to graduate work in math; that seems to have been inevitable.

I really do think that there are vast differences in innate math ability among people. A lot of folks don't want to believe this, because they want everyone to be "equal." One thing that convinces me it is innate is that math ability shows up so very early in some people, long before they have had any training. Music is another field where there are extremely "early bloomers." Perhaps what they have in common is the heightened ability to perceive pattern and form, which must be an innate capacity of the brain which varies from one individual to another. Other subjects seem to depend much more on experience, and are not so innate. There are 5 year old mathematicians and composers, but no 5 year old psychologists or political scientists.

Good to hear that someone besides me has had this experience!

--Stuart Anderson


--------------------
A hallmark of intelligence is the ability to give precise answers to vague questions.
Top

Topic Options

Add reply · Start new topic ·


 

Terms of use