0% found this document useful (0 votes)
849 views1 page

Er N0 F1 Ce

The document defines a Lagrange polynomial that fits 16 data points exactly. It lists the polynomial, which is a 15th degree polynomial in x with rational coefficients. It then evaluates the polynomial at integers from 0 to 16, printing the results. The last value is -1514935, showing the polynomial does not match the (nonexistent) 17th data point.

Uploaded by

ram4a5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
849 views1 page

Er N0 F1 Ce

The document defines a Lagrange polynomial that fits 16 data points exactly. It lists the polynomial, which is a 15th degree polynomial in x with rational coefficients. It then evaluates the polynomial at integers from 0 to 16, printing the results. The last value is -1514935, showing the polynomial does not match the (nonexistent) 17th data point.

Uploaded by

ram4a5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

R=PolynomialRing(QQ,'x')

sage: f = R.lagrange_polynomial([(0,1),(1,3),(2,7),(3,8),(4,21),(5,49),(6,76),
(7,224),(8,467),(9,514),(10,1155),(11,2683),(12,5216),(13,10544),(14,26867),
(15,51510)]); f
-673909/1307674368000*x^15 + 5004253/87178291200*x^14 - 151337/52254720*x^13 +
9320029/106444800*x^12 - 25409989753/14370048000*x^11 + 2192506957/87091200*x^10 -
19011117413/73156608*x^9 + 1200887962891/609638400*x^8 -
3585932821063/326592000*x^7 + 647416874047/14515200*x^6 -
18586394742863/143700480*x^5 + 30899291755337/119750400*x^4 -
274137631043849/825552000*x^3 + 36933161067083/151351200*x^2 - 87781079/1155*x + 1
sage: for i in range(0,17):
print f(i)
....:
1
3
7
8
21
49
76
224
467
514
1155
2683
5216
10544
26867
51510
-1514935
sage:

You might also like