Tutorials › Linear Algebra › Polynomial Spaces Over Finite Fields

Linear Algebra Beyond the Reals · Tutorial 970 of 1000

Polynomial Spaces Over Finite Fields

Represent finite-field polynomials by coefficient coordinates, and calculate their sums and scalar multiples with arithmetic modulo p.

Intermediate 10 min read

What You'll Learn

  • Define the space of polynomials of degree at most d over the prime field F_p
  • Add polynomials and multiply them by scalars using arithmetic modulo p
  • Express a polynomial as a coordinate column in the standard basis
  • Prove that 1, x, through x^d form a basis
  • Check coefficient calculations and avoid confusing formal polynomials with integer-coefficient expressions

Polynomials with Coefficients in a Prime Field

Polynomials are familiar from calculus and algebra, but their coefficients need not be real numbers. For a prime number \(p\), the field \(\mathbb{F}_p\) consists of residue classes of integers modulo \(p\). Its addition and multiplication are performed modulo \(p\); for example, in \(\mathbb{F}_5\), \(3+4=2\) and \(2\cdot 4=3\). The prime condition matters because every nonzero element of \(\mathbb{F}_p\) has a multiplicative inverse, so the scalars form a field.

A polynomial over \(\mathbb{F}_p\) is a formal expression whose coefficients belong to that field. Equality of polynomials means equality of corresponding coefficients; it is not defined by comparing their values at inputs. For a nonnegative integer \(d\), we collect all polynomials whose powers of \(x\) are at most \(d\) into one space. This provides a concrete example of a finite-dimensional vector space over a field other than \(\mathbb{R}\).

Definition: Let \(p\) be prime and \(d\geq 0\). The set \(\mathcal{P}_d(\mathbb{F}_p)\) consists of all formal polynomials \(a_0+a_1x+\cdots+a_dx^d\), where each \(a_i\in\mathbb{F}_p\). Addition is coefficientwise, and scalar multiplication by \(c\in\mathbb{F}_p\) multiplies every coefficient by \(c\). Coefficients and results are interpreted in \(\mathbb{F}_p\).

The zero polynomial belongs to every \(\mathcal{P}_d(\mathbb{F}_p)\), with all coefficients equal to zero. A polynomial may have a zero coefficient on its highest listed power; for example, \(2+x+0x^2\) is in \(\mathcal{P}_2(\mathbb{F}_5)\) and is the same polynomial as \(2+x\). Consequently, the condition is “degree at most \(d\),” not “degree exactly \(d\).”

Adding, Scaling, and Reading Coordinates

Write two elements of \(\mathcal{P}_d(\mathbb{F}_p)\) as \(f(x)=\sum_{i=0}^d a_ix^i\) and \(g(x)=\sum_{i=0}^d b_ix^i\). Their sum is found by adding coefficients of matching powers, and a scalar multiple is found by multiplying each coefficient by the scalar. Both calculations take place in the field.

$$ f(x)+g(x)=\sum_{i=0}^d(a_i+b_i)x^i,\qquad cf(x)=\sum_{i=0}^d(ca_i)x^i. $$

The powers \(1,x,\dots,x^d\) give a natural ordered list for recording coefficients. With this order, the coordinate vector of \(f\) is the column whose entries are its coefficients from the constant term upward. The order matters: the first entry records the coefficient of \(1\), not the coefficient of \(x^d\).

Definition: For \(f(x)=a_0+a_1x+\cdots+a_dx^d\), its coefficient coordinate column is \([\mathbf{f}] = \begin{bmatrix}a_0\\a_1\\\vdots\\a_d\end{bmatrix}\in\mathbb{F}_p^{d+1}\), using the ordered list \(1,x,\dots,x^d\). Each entry is a field element; when written as an integer, it is usually displayed by its representative from \(0\) to \(p-1\).

Worked Example: Adding and Scaling in \(\mathcal{P}_2(\mathbb{F}_5)\)

Let \(f(x)=4+2x+3x^2\) and \(g(x)=1+4x+2x^2\). Find \(f+g\), \(3f\), and their coefficient columns. All coefficient arithmetic is modulo \(5\).

Add the coefficients of matching powers. The constant coefficient is \(4+1=5=0\) in \(\mathbb{F}_5\); the coefficient of \(x\) is \(2+4=6=1\); and that of \(x^2\) is \(3+2=5=0\). Therefore

$$ f(x)+g(x)=0+1x+0x^2=x,\qquad [f+g]=\begin{bmatrix}0\\1\\0\end{bmatrix}. $$

For the scalar multiple, calculate each coefficient: \(3\cdot4=12=2\), \(3\cdot2=6=1\), and \(3\cdot3=9=4\), all modulo \(5\). Thus

$$ 3f(x)=2+x+4x^2,\qquad [3f]=\begin{bmatrix}2\\1\\4\end{bmatrix}. $$

Check: Adding the original coefficient columns gives \(\begin{bmatrix}4\\2\\3\end{bmatrix}+\begin{bmatrix}1\\4\\2\end{bmatrix}=\begin{bmatrix}5\\6\\5\end{bmatrix}=\begin{bmatrix}0\\1\\0\end{bmatrix}\) in \(\mathbb{F}_5^3\), which is the column for \(x\). Multiplying \(\begin{bmatrix}4\\2\\3\end{bmatrix}\) by \(3\) gives \(\begin{bmatrix}12\\6\\9\end{bmatrix}=\begin{bmatrix}2\\1\\4\end{bmatrix}\), confirming the scalar calculation.

Worked Example: Converting a Polynomial to Coordinates

In \(\mathcal{P}_3(\mathbb{F}_5)\), write \(h(x)=4+8x+2x^2+3x^3\) using canonical residues, then give its coordinate column and recover the polynomial from that column.

The coefficient \(8\) represents the same field element as \(3\), because \(8\equiv3\pmod 5\). Thus \(h(x)=4+3x+2x^2+3x^3\) in canonical-residue notation, and

$$ [h]=\begin{bmatrix}4\\3\\2\\3\end{bmatrix}. $$

A column written as \(\begin{bmatrix}4\\8\\2\\3\end{bmatrix}\) is also a valid representation if its entries are interpreted modulo \(5\); it is simply not in canonical-residue notation. Its second entry represents the same field element as \(3\).

To recover the polynomial, read the entries in order as coefficients of \(1,x,x^2,x^3\). The column \(\begin{bmatrix}4\\3\\2\\3\end{bmatrix}\) therefore gives \(4+3x+2x^2+3x^3\).

Check: The recovered polynomial has coefficient column \(\begin{bmatrix}4\\3\\2\\3\end{bmatrix}\), as required. Replacing \(3x\) by \(8x\) does not change the polynomial over \(\mathbb{F}_5\), since their coefficients represent the same field element.

The Standard Basis and the Vector-Space Structure

For each \(i\) from \(0\) to \(d\), the monomial \(x^i\) has coefficient \(1\) on its own power and \(0\) on every other power. These monomials span the polynomial space because every allowed polynomial is built by multiplying them by coefficients and adding. They are also independent: a linear combination of them is the zero polynomial only when every coefficient is zero.

Theorem: For prime \(p\) and nonnegative integer \(d\), \(\mathcal{P}_d(\mathbb{F}_p)\) is a vector space over \(\mathbb{F}_p\), and the ordered list \((1,x,\dots,x^d)\) is a basis. Every \(f\in\mathcal{P}_d(\mathbb{F}_p)\) has a unique coefficient column in \(\mathbb{F}_p^{d+1}\).

Proof. Each polynomial in the set has \(d+1\) coefficients in \(\mathbb{F}_p\). Adding two such polynomials adds corresponding coefficients in \(\mathbb{F}_p\), so the result again has \(d+1\) coefficients in that field. Multiplying by a scalar in \(\mathbb{F}_p\) also leaves every coefficient in the field. The zero polynomial and additive inverses are obtained by taking all coefficients to be zero or by negating each coefficient. The vector-space laws for addition and scalar multiplication hold coefficient by coefficient because they hold in \(\mathbb{F}_p\). Thus this set, with the stated operations, is a vector space.

Now let \(f(x)=a_0+a_1x+\cdots+a_dx^d\). Then \(f=\sum_{i=0}^d a_ix^i\), so the listed monomials span the space. If \(\sum_{i=0}^d c_ix^i\) is the zero polynomial, equality of formal polynomials says its coefficient on every power is zero. Hence \(c_i=0\) for every \(i\), proving independence. Since the coefficients \(a_i\) in the defining expression for \(f\) are uniquely determined by the polynomial, its coefficient column is unique as well. Therefore the list is a basis and the stated coordinates are well-defined. \(\square\)

This proof also explains how polynomial calculations translate directly into coordinate calculations: addition of polynomials becomes addition of their columns, and scalar multiplication of a polynomial becomes scalar multiplication of its column. No extra conversion rule is needed after the coefficient order has been fixed.

Worked Example: A Linear Combination in \(\mathcal{P}_2(\mathbb{F}_3)\)

Let \(u(x)=1+2x+x^2\) and \(v(x)=2+x\). Compute \(2u(x)+v(x)\) over \(\mathbb{F}_3\), and confirm the result using coefficient columns.

First scale \(u\): its coefficients become \(2\cdot1=2\), \(2\cdot2=4=1\), and \(2\cdot1=2\) modulo \(3\). Thus \(2u(x)=2+x+2x^2\). Now add \(v\), whose coefficients in degrees \(0,1,2\) are \(2,1,0\):

$$ 2u(x)+v(x)=(2+2)+(1+1)x+(2+0)x^2 =1+2x+2x^2. $$

The coordinate calculation gives the same result:

$$ 2\begin{bmatrix}1\\2\\1\end{bmatrix} +\begin{bmatrix}2\\1\\0\end{bmatrix} = \begin{bmatrix}2\\1\\2\end{bmatrix} +\begin{bmatrix}2\\1\\0\end{bmatrix} = \begin{bmatrix}1\\2\\2\end{bmatrix}. $$

Check: The final column has entries \(1,2,2\), so it represents \(1+2x+2x^2\), the polynomial obtained above. Directly, the constant term is \(2+2=4=1\), the \(x\)-coefficient is \(1+1=2\), and the \(x^2\)-coefficient is \(2+0=2\) in \(\mathbb{F}_3\).

Common Pitfall: Forgetting That Coefficients Are Field Elements

A frequent error is to do the polynomial algebra over the integers and reduce only after the full expression is finished. For example, a student might write \(2x+3x=5x\) in \(\mathbb{F}_5[x]\), then conclude that the sum is a nonzero polynomial. That conclusion treats the coefficient \(5\) as an integer coefficient rather than as an element of \(\mathbb{F}_5\).

The correction is to reduce the coefficient in the field: \(2+3=0\) in \(\mathbb{F}_5\), so \(2x+3x=0x\), the zero polynomial. The corresponding coordinate calculation is \(\begin{bmatrix}0\\2\end{bmatrix}+\begin{bmatrix}0\\3\end{bmatrix}=\begin{bmatrix}0\\0\end{bmatrix}\) in \(\mathbb{F}_5^2\), using the ordered list \((1,x)\). Keeping the field visible in each calculation prevents integer arithmetic from slipping into a finite-field problem.

The coordinate description is useful because it turns every polynomial in \(\mathcal{P}_d(\mathbb{F}_p)\) into a column of \(d+1\) field elements. The basis theorem guarantees that this representation loses no information: each polynomial has exactly one such column, and every column in \(\mathbb{F}_p^{d+1}\) gives one polynomial. The degree bound sets the number of coordinates, while the field determines the arithmetic applied to them.

Check Your Understanding

Use coefficient arithmetic in the specified field, and write coordinate entries in increasing order of powers.

  1. In \(\mathcal{P}_2(\mathbb{F}_3)\), compute \((2+x+2x^2)+(1+2x+x^2)\) and give the coordinate column.
  2. In \(\mathcal{P}_2(\mathbb{F}_5)\), find \(4(1+3x+2x^2)\) and check it by multiplying each coefficient modulo \(5\).
  3. Write the coordinate column of \(2+7x+4x^2\) in \(\mathcal{P}_2(\mathbb{F}_5)\) using canonical residues. Explain what the entry \(7\) represents.
  4. Why does equality of two polynomials in \(\mathcal{P}_d(\mathbb{F}_p)\) imply equality of all \(d+1\) corresponding coefficients?
  5. In one sentence, explain why \((1,x,\dots,x^d)\) spans \(\mathcal{P}_d(\mathbb{F}_p)\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon