Probability – Probability Sum of 10 Rolls of 6-Sided Die is Divisible by 10

generating-functionsprobability

Here's a question I've been considering: Suppose you roll a usual 6-sided die 10 times and sum up the results of your rolls. What's the probability that it's divisible by 10?

I've managed to solve it in a somewhat ugly fashion using the following generating series:
$(x+x^2+x^3+x^4+x^5+x^6)^{10} = x^{10}(x^6 – 1)(1+x+x^2+\cdots)^{10}$ which makes finding the probability somewhat doable if I have a calculator or lots of free time to evaluate binomials.

What's interesting though is that the probability ends up being just short of $\frac{1}{10}$ (in fact, it's about 0.099748). If instead, I roll the die $n$ times and find whether the sum is divisible by $n$, the probability is well approximated by $\frac{1}{n} – \epsilon$.

Does anyone know how I can find the "error" term $\epsilon$ in terms of $n$?

Best Answer

Define $$ \begin{align} P_n(x) &=\left(\frac{x+x^2+x^3+x^4+x^5+x^6}{6}\right)^n\\ &=\sum_{j=n}^{6n}a_j\,x^j\tag{1} \end{align} $$ The probability that the the sum, when rolling a $6$-sided die $n$ times, is divisible by $n$ is the sum of the $a_k$ where $k$ is a multiple of $n$. To find the sum of those coefficients, we will compute $$ \begin{align} \frac1n\sum_{k=0}^{n-1}P(e^{i2\pi k/n}) &=\frac1n\sum_{k=0}^{n-1}\sum_{j=n}^{6n}a_k\,e^{i2\pi jk/n}\\ &=\sum_{j=n}^{6n}a_j\left(\frac1n\sum_{k=0}^{n-1}e^{i2\pi jk/n}\right)\tag{2} \end{align} $$ because $$ \frac1n\sum_{k=0}^{n-1}e^{i2\pi jk/n}=\left\{\begin{array}{}1&\text{if }n\,\vert \,j\\0&\text{if }n\!\!\not{\vert}\,j\end{array}\right.\tag{3} $$ Note that $$ P_n(x)=\left(\frac16\frac{x^7-x}{x-1}\right)^n\tag{4} $$ so that when we set $x=e^{i2\pi k/n}$, we get $$ \begin{align} P_n(e^{i2\pi k/n}) &=\left(\frac16\frac{\sin(6\pi k/n)}{\sin(\pi k/n)}e^{i7\pi k/n}\right)^n\\ &=(-1)^k\left(\frac{\sin(6\pi k/n)}{6\sin(\pi k/n)}\right)^n\tag{5} \end{align} $$ Thus, the probability that the the sum, when rolling a $6$-sided die $n$ times, is divisible by $n$ is $$ \begin{align} \frac1n\sum_{k=0}^{n-1}P_n(e^{i2\pi k/n}) &=\frac1n\sum_{k=0}^{n-1}(-1)^k\left(\frac{\sin(6\pi k/n)}{6\sin(\pi k/n)}\right)^n\\ &=\frac1n+\frac1n\sum_{k=1}^{n-1}(-1)^k\left(\frac{\sin(6\pi k/n)}{6\sin(\pi k/n)}\right)^n\tag{6} \end{align} $$ For large $n$, $\left(\dfrac{\sin(6\pi k/n)}{6\sin(\pi k/n)}\right)^n$ is very close to $1$ for a large range of $k$, so I do not see a way to get a simple estimate for the error, but the error is given exactly by $$ \frac1n\sum_{k=1}^{n-1}(-1)^k\left(\frac{\sin(6\pi k/n)}{6\sin(\pi k/n)}\right)^n\tag{7} $$ Staring at $(7)$, it is evident why, for $n\in\{1,2,3,6\}$, $\frac1n$ is exact, as Henry notes in his answer (Hint: consider $\sin(6\pi k/n)$).