Since [this question](https://mathoverflow.net/questions/41310/) is on the front page again, a generalization.



> 
> Let $p$ be prime, and let $a$ and $b$ be positive integers with $a+b=p-1$. Is it possible to have two loaded dice, one with sides labeled $\{ 0,1,\ldots, a \}$ and the other with sides labeled $\{ 0,1,\ldots, b \}$, such that, when we roll the two dice, each of the totals $\{ 0,1,\ldots, p-1 \}$ occurs with equal probability?
> 
> 
> 


I require that $p$ is prime because, if $p=uv$, we can take $(a,b) = (u-1, u(v-1))$ so that the first die produces the rolls $\{ 0,1,2,\ldots, u-1 \}$ each with equal probability, and the second die produces the rolls $\{ 0,u,2u, \ldots, u(v-1) \}$ each with equal probability, and has probability zero of landing on any other face.


Looking at the answers to the previous question, Jim Propp and Michael Lugo's solutions rule out $a=b=(p-1)/2$, and Michael Lugo's other solution rules out solutions with $a$ and $b$ odd. But I don't see any of the solutions that can be adapted to the general case.


Taking a generating function approach, we want to factor $x^{p-1} + x^{p-2} + \cdots + x+ 1$ into $\alpha(x) \beta(x)$ with each of $\alpha$ and $\beta$ of positive degree and having nonnegative real coefficients. For $p \leq 31$, I have tested the following claim in Mathematica:



> 
> If $x^{p-1} + x^{p-2} + \cdots + x+ 1 = \alpha(x) \beta(x)$ with $\alpha$ and $\beta$ both of positive degree with real coefficients, and if $\alpha$ is the factor with $\alpha(e^{(2 \pi i)/p})=0$, then $\alpha$ has a negative coefficient.
> 
> 
> 


Caveat: I was using floating point arithmetic without interval bounds, so this might be the result of numerical error. Jim Propp's argument proves this when $\deg \alpha \leq (p-1)/2$, but that's only half the cases.


I don't see why this should be true, does anyone?



Two dice yielding uniform distribution, part 2
Suppose that you can factor $x^{p-1} + x^{p-2} + \cdots + 1$ as $f(x)g(x)$ with $\deg(f)=a,\deg(g) = b$ and $f,g$ having nonnegative coefficients.


Lemma: It must be the case that $f = \sum\_{i=0}^a c\_i x^i$ and $g = \sum\_{i=0}^b d\_i x^i$, where $c\_i, d\_j > 0$ for all $0 \le i \le a$ and $0 \le j \le b$.


Proof: Suppose that some $c\_i$ is zero; for concreteness say $c\_a = 0$. Now, let's fix the set of $a$ distinct $p$th roots of unity that $f$ vanishes on, say $\omega^{r\_1}, \ldots, \omega^{r\_a}$ with $\omega$ a primitive root. The set of polynomials satisfying these conditions is the subspace $(c\_0, \ldots, c\_{a-1})$ such that $M.(c\_0, \ldots, c\_{a-1}) = (0,\ldots, 0)$, and $M$ is the $a \times a$ matrix whose $i,j$th entry is $\omega^{r\_i \cdot j}$. But this is a submatrix of the DFT matrix for $\mathbb{Z}\_p$, and hence it is invertible; see Lemma 1.3 of <https://arxiv.org/abs/math/0308286> for a reference. Hence $f$ must be identically zero, a contradiction. Note this argument works when we omit any monomial from the support of $f$, not just $x^a$.


Now, note that by rescaling $f$ and $g$ we may assume that $c\_0 = 1$, and therefore also $d\_0 = 1$. Now consider $c\_ad\_b$, the coefficient of $x^{p-1}$ in the product. Note that $c\_a$ must be strictly less than 1, since the coefficient of $x^a$ in the product equals $c\_a \cdot 1$ plus some positive stuff (by the lemma), and this should equal 1. Similarly, $d\_b < 1$. So $c\_ad\_b < 1$, a contradiction.


