Jump to content

N equations

Featured Replies

Hey all,

 

say we have N points in Cartesian space, and we are to find a nth degree polynomial that goes through all those points. How would you symbolically describe the solutions for the coefficients?

Just to make my question clear, here's an example:

N=2: we have two points, W and Z. So in this case we're looking for a linear equation in the form [math]y=ax+b[/math]. We get two equations, and solve for a and b. If we had three points, we would be looking for a quadratic function in the form [math]y=ax^2+bx+c[/math]. We get three equations, solve for a, b and c. Now what I'm looking for is a way to tell a computer how to get the coefficients given N points.

 

Cheers,

 

Gabe

Assuming "cartesian space" means (x,y) where y=f(x) then the n-th degree polynomial [math]P^n[/math] running to the points [math](x_i, y_i), \ i=0 \dots n[/math] (with [math]i \neq j \Rightarrow x_i \neq x_j[/math] is

 

[math] P^n(x) = \sum_{i=0}^n y_i \prod_{j\neq i} \frac{x-x_j}{x_i-x_j} [/math]

  • Author

Thanks Atheist. Just for clarification, [math]\prod_{j\neq i} \frac{x-x_j}{x_i-x_j}

[/math] means that it runs while j is smaller than i, from j=0?

No. It means it runs through all j (i.e., from 0 to n) but skips over the j=i term.

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.