Devise an algorithm which, for any polynomial P(x), will determine the polynomial remainder of P(x)/(x^2+x+1) without actually performing the division.
(x + 1)² = x² +2x + 1
Coeff's: (B)1 (C)2 (A)1
Rem = (C - B) * x + (A - B)
= (2 - 1) * x + (1 - 1)
=
x(x + 1)²/(x² +x + 1) = 1 +
x/(x² +x + 1) ;
[1 *
x being the remainder]
(x + 1)³ = x³ + 3x² + 3x + 1
Coeff's: (B)3 (C) 3 (A) 1 + 1 [ie, first and last]
Rem = (C - B) * x + (A -B)
= (3 - 3) * x + (2 -3)
=
-1(x + 1)³/(x² +x + 1) = x + 2
-1/(x² +x + 1)
|
Posted by brianjn
on 2008-04-16 21:10:09 |