polynomial modulo polynomial

97 Views Asked by At

If $h(x) = x^2 + 1$, $g(x) = x^2 + x + 1$ and $f(x) = x^3 + x + 1$, then $$ \begin{align} g(x)h(x) \mod f(x) &\equiv (x^2 + x + 1)(x^2 +1) \mod x^3 + x + 1 \\ &\equiv x^4 + x^3 + 2x^2 + x + 1 \mod x^3 +x + 1. \end{align} $$

Now apparently I go wrong here, because I assume you can subtract $xf(x)$ from this, resulting in $x^3 + x^2 +1$. But apparently this is wrong.

How should you do this correctly?

1

There are 1 best solutions below

1
On BEST ANSWER

You are correct, that you remain in the same equivalence class after subtracting $x f(x)$ (or any multiple of $f(x)$ for that matter). However, you haven't reduced it to a representative of the equivalence class of smallest degree, which I'm guessing is the goal. This is not explicitly stated.

Working modulo $f(x) = x^3 + x + 1$ means that $x^3 + x + 1 \equiv 0$ or $$ x^3 = -x - 1. $$ Therefore, $$ x^3 + x^2 + 1 \equiv (-x - 1) + x^2 +1 \equiv x^2 - x \mod f(x). $$