1

I'm trying to write code to do multivariate polynomial division modulo-2 (so no coefficients or degrees).

Say I have the polynomial $xyzw + yz$ and want to divide it by $xw + xwz$. IIUC, the usual approach is to take the leading terms $xyzw$ and $xw$ and divide to get $yz$. Then, as you would with integer long division, multiply $yz$ by the divisor to get $$yz(xw + xwz) = xyzw + xyzw = 0$$

Oops. This doesn't work modulo 2 as they cancel!

I presume I can just pick another divisor term and try again. Is that right?

$$xyzw \div xwz = y$$

$$y(xw + xwz) = xyzw + xyw$$

After subtracting this away we get a factor of 'y' and a remainder of $xyzw + yz + xyzw + xyw = xyw + yz$.

$$y \times (xw + xwz) + xyw + yz$$

$$ = xyw + xywz + xyw + yz = xywz + yz$$

This case was something I hadn't thought of but now I'm worried that it might occur after some leading coefficient has been removed. Does this mean that the correct way to do this division is to enumerate all divisor terms in the case that the leading term doesn't work, then revert back to using the leading term for subsequent reductions?

Aaron
  • 111
  • 1
    While $z^2 = z$ is true for integers mod $2$, i.e. members of the field $\mathbb F_2$, it does not apply to indeterminates in a polynomial ring over that field. – Robert Israel May 08 '24 at 15:11
  • See here for more on formal polynomials vs. polynomial functions. There are many ways to generalize the Euclidean univariate polynomial division algorithm to multivariate polynomial rings, e.g. consult literature on Grobner basis algorithms. – Bill Dubuque May 08 '24 at 16:17
  • Thanks! I can see the distinction now! – Aaron May 08 '24 at 22:46

0 Answers0