Univariate Lagrange Interpolation Over Finite Field

Answer

f(x)=13x4+9x3+3x2+8x+3f(x) = 13x^{4} + 9x^{3} + 3x^{2} + 8x + 3

Evaluation

f(f())=7= 7

Step by Step Solution

General Form

f(x)=y0L0+y1L1+y2L2+...+yn1Ln1f(x) = y_0L_0 + y_1L_1 + y_2L_2 + ... + y_{n-1}L_{n-1}Li=j=0,jin1(xxjxixj)L_i = \prod_{j=0, j \neq i}^{n - 1}(\dfrac{x-x_j}{x_i-x_j})

Finding the Lagrange Polynomials

L0=(xx1x0x1)(xx2x0x2)(xx3x0x3)(xx4x0x4)L_0 = (\dfrac{x - x_1}{x_0 - x_1})(\dfrac{x - x_2}{x_0 - x_2})(\dfrac{x - x_3}{x_0 - x_3})(\dfrac{x - x_4}{x_0 - x_4})
=(x101)(x202)(x303)(x404)= (\dfrac{x - 1}{0 - 1})(\dfrac{x - 2}{0 - 2})(\dfrac{x - 3}{0 - 3})(\dfrac{x - 4}{0 - 4})
=5(x1)(x2)(x3)(x4)= 5(x - 1)(x - 2)(x - 3)(x - 4)
L0=5x4+1x3+5x2+5x+1L_0 = 5x^4 + 1x^3 + 5x^2 + 5x + 1
L1=(xx0x1x0)(xx2x1x2)(xx3x1x3)(xx4x1x4)L_1 = (\dfrac{x - x_0}{x_1 - x_0})(\dfrac{x - x_2}{x_1 - x_2})(\dfrac{x - x_3}{x_1 - x_3})(\dfrac{x - x_4}{x_1 - x_4})
=(x010)(x212)(x313)(x414)= (\dfrac{x - 0}{1 - 0})(\dfrac{x - 2}{1 - 2})(\dfrac{x - 3}{1 - 3})(\dfrac{x - 4}{1 - 4})
=14(x0)(x2)(x3)(x4)= 14(x - 0)(x - 2)(x - 3)(x - 4)
L1=14x4+10x3+7x2+4xL_1 = 14x^4 + 10x^3 + 7x^2 + 4x
L2=(xx0x2x0)(xx1x2x1)(xx3x2x3)(xx4x2x4)L_2 = (\dfrac{x - x_0}{x_2 - x_0})(\dfrac{x - x_1}{x_2 - x_1})(\dfrac{x - x_3}{x_2 - x_3})(\dfrac{x - x_4}{x_2 - x_4})
=(x020)(x121)(x323)(x424)= (\dfrac{x - 0}{2 - 0})(\dfrac{x - 1}{2 - 1})(\dfrac{x - 3}{2 - 3})(\dfrac{x - 4}{2 - 4})
=13(x0)(x1)(x3)(x4)= 13(x - 0)(x - 1)(x - 3)(x - 4)
L2=13x4+15x3+9x2+14xL_2 = 13x^4 + 15x^3 + 9x^2 + 14x
L3=(xx0x3x0)(xx1x3x1)(xx2x3x2)(xx4x3x4)L_3 = (\dfrac{x - x_0}{x_3 - x_0})(\dfrac{x - x_1}{x_3 - x_1})(\dfrac{x - x_2}{x_3 - x_2})(\dfrac{x - x_4}{x_3 - x_4})
=(x030)(x131)(x232)(x434)= (\dfrac{x - 0}{3 - 0})(\dfrac{x - 1}{3 - 1})(\dfrac{x - 2}{3 - 2})(\dfrac{x - 4}{3 - 4})
=14(x0)(x1)(x2)(x4)= 14(x - 0)(x - 1)(x - 2)(x - 4)
L3=14x4+4x3+9x2+7xL_3 = 14x^4 + 4x^3 + 9x^2 + 7x
L4=(xx0x4x0)(xx1x4x1)(xx2x4x2)(xx3x4x3)L_4 = (\dfrac{x - x_0}{x_4 - x_0})(\dfrac{x - x_1}{x_4 - x_1})(\dfrac{x - x_2}{x_4 - x_2})(\dfrac{x - x_3}{x_4 - x_3})
=(x040)(x141)(x242)(x343)= (\dfrac{x - 0}{4 - 0})(\dfrac{x - 1}{4 - 1})(\dfrac{x - 2}{4 - 2})(\dfrac{x - 3}{4 - 3})
=5(x0)(x1)(x2)(x3)= 5(x - 0)(x - 1)(x - 2)(x - 3)
L4=5x4+4x3+4x2+4xL_4 = 5x^4 + 4x^3 + 4x^2 + 4x

Get the Final Polynomial

f(x)=3(5x4+1x3+5x2+5x+1)+2(14x4+10x3+7x2+4x)+5(13x4+15x3+9x2+14x)+7(14x4+4x3+9x2+7x)+9(5x4+4x3+4x2+4x)f(x) = 3( 5x^4 + 1x^3 + 5x^2 + 5x + 1) +2( 14x^4 + 10x^3 + 7x^2 + 4x ) +5( 13x^4 + 15x^3 + 9x^2 + 14x ) +7( 14x^4 + 4x^3 + 9x^2 + 7x ) +9( 5x^4 + 4x^3 + 4x^2 + 4x )
f(x)=13x4+9x3+3x2+8x+3f(x) = 13x^4 + 9x^3 + 3x^2 + 8x + 3