Redistribution of polynomial factors for dice (source code)

= Redistribution of polynomial factors for dice

Encode a fair die with face labels $a_1,\ldots,a_s$ by $A(z)=\sum_i z^{a_i}$. Its <probability generating function> is $A(z)/s$. Two <independent> dice with polynomials $A,B$ have the same sum <probability distribution> as another pair $C,D$ if $AB=CD$ and all four dice have $s$ faces. Redistributing factors can construct unexpected examples, but each resulting polynomial must have nonnegative integer <coefficients>, no constant term if labels must be positive, and value $s$ at $z=1$. For example, reallocating $1-z+z^2$ from one copy of $z+\cdots+z^6$ to the other gives face labels $(1,2,2,3,3,4)$ and $(1,3,4,5,6,8)$.