February 2020
Beginner
621 pages
19h 34m
English
Suppose we want to find the polynomial of degree at most 3 that passes through the points mod the prime . We first need to specify that we are working with polynomials in mod 37. Then we compute the polynomial:
R=PolynomialRing(GF(37),"x")f=R.lagrange_polynomial([(1,1),(2,2),(3,21), (5,12)]);f
This evaluates to
22*x^3 + 25*x^2 + 31*x + 34
If we want the constant term:
f(0)43
Read now
Unlock full access