0

I was reading throught this question: Give the remainder of $x^{100}$ divided by $(x-2)(x-1)$. and I couldn't get the same expression as the answers.

I have a basic understanding of modulos and Chinese Remainder Theorem so here is what I tried:

1) x^100 ≡ p mod (x-1)

2) x^100 ≡ r mod (x-2)

since (x-1) and (x-2) are relatively prime.

EQ. 1 gives x^100 = p + a(x-1)

x^100 ≡ p + a(x-1) ≡ r mod (x-2)

x^100 ≡ p - r + a(x-1) mod (x-2)

x^100 = p - r + a(x-1) + b(x-2)

x^100 = p-r + ax - a + bx - 2b

Let R = p - r - a - 2b

x^100 = x(a+b) - R

Is this correct? If this is correct how are the answers derived in that question? If not, what did I do wrong?

stackErr
  • 263

2 Answers2

1

$$x^{100} = P(x)(x-1)(x-2) + ax + b$$

for some polynomial $P(x)$ and some integers $a$ and $b$.

\begin{align} x=1 &\implies 1 = P(1)\cdot 0 + a+b \\ &\implies a+b = 1 \\ x=2 &\implies 2^{100} = P(2)\cdot 0 + 2a+b \\ &\implies 2a + b = 2^{100} \\ &\implies x^{100} = P(x)(x-1)(x-2) + (2^{100}-1)x - (2^{100}-2) \end{align}

  • Ha! Way to revive such an old question. And now that I look at it...this answer seems so much simpler. – stackErr Oct 26 '16 at 02:50
1

Though it can be done by (Lagrange) interpolation, it is just as simple (and more powerful) to use the Chinese Remainder Theorem (CRT), which is $\color{#c00}{\rm very\ easy}$ when the $\color{#c00}{\rm Bezout}$ identity is known

By CRT, $ $ if $\ \color{#c00}{j g} + \color{#c00}{k h} = 1\,$ then $\ \begin{eqnarray}f\equiv a\!\!\!\pmod g\\f\equiv b\!\!\!\pmod h\end{eqnarray}$ $\!\iff\!\!$ $\begin{eqnarray} f&\equiv&\ a\,\color{#c00}{kh}\, +\, b\,\color{#c00}{jg}&&({\rm mod}\ {gh})\\ &\equiv& a+(b\!-\!a)\color{#c00}{jg}&&({\rm mod}\ gh)\end{eqnarray}$

So $\, \underbrace{(x\!-\!1)}_{\large g}-\underbrace{(x\!-\!2)}_{\large h} = 1,$ $\, a,b = f(1),f(2) \Rightarrow f\equiv f(1) +(f(2)\!-\!f(1))(x\!-\!1) \pmod{\!\!(x\!-\!1)(x\!-\!2)}$

Remark $\ $ It was $\,\color{#c00}{\rm easy}$ here since $\,\ g\ {\rm mod}\ h = g - h = (x\!-\!1)-(x\!-\!2) = 1\ $ is invertible in $\,\Bbb Q\,$ hence this immediately yields the Bezout identity, which immediately yields the solution as above. Generally it is just as easy when $\ g\ {\rm mod}\ h\ $ is invertible (which is equivalent to the extended Euclidean algorithm (EEA) terminating in $1$ step, i.e. this is an optimization of the EEA). In particular, the EEA terminates in one step if one of the polynomials is linear.

Since Lagrange interpolation is the special case of CRT when both moduli are linear polynomials, the above optimization always applies.

Bill Dubuque
  • 272,048