# Probability of rolling a sum of N with up to infinite rolls of a die

I'm trying to figure out if there is some (relatively simple) formula for calculating the probability of rolling a sum of N with as many rolls as needed with a single regular six-sided die. For example:
$N=1$ is $0.16666 = 1/6 = 1/6$ (1)
$N=2$ is $0.19444 = 7/36 = 1/6 + 1/36$ (2 or 1,1)
$N=3$ is $0.22685 = 49/216 = 1/6 + 2/36 + 1/216$ (3 or 1,2/2,1 or 1,1,1)
$N=4$ is $0.26466 = 343/1296 = 1/6 + 3/36 + 3/216 + 1/1296$ (4 or 2,1/1,2/2,2 or 1,1,2/1,2,1/2,1,1 or 1,1,1,1)
...

Does this series converge to essentially one and is there some good formula?

It seems like pascal's triangle is involved somehow (at least for n=1-6, but I'm not sure how (if even possible) to convert it into a formula. Any help/advice is appreciated.

• If you throw a die a lot of times and add your results as you go along, the sum increases by $3.5$ on average for each roll, so my gut says that your probability converges to $\frac{1}{3.5}\approx 0.286$ as $N$ grows. – Arthur Jan 5 '15 at 23:27

Let $q(x)=\frac{1}{6}\left(x^1+x^2+x^3+x^4+x^5+x^6\right)$. Write:

\begin{align}G(x)&=\sum_{n=0}^\infty q(x)^n\\&=\frac{1}{1-q(x)}\\&=\frac{6}{6-x-x^2-x^3-x^4-x^5-x^6} \end{align}

Then the coefficient of $x^N$ in $G(x)$ is your probability.

So you need to know something about the roots of the denominator. $1$ is one such root, but you are going to need to deal with complex roots, as well, or at least get an upper bound for the roots.

The formula is:

$$p(N)=a_1\alpha_1^N+a_2\alpha_2^N+\cdots a_6\alpha_6^N$$

For some constants $a_i$ and with the $\alpha_i$ the inverse roots of the denominator.

According to Wolfram Alpha, the roots of the denominator are $1$ and a bunch of values (one real, four complex) with absolute value greater than $1$.

So for large enough $N$, $p(N)\approx a_1$.

We can find $a_1$ by doing the usual partial fractions computation:

$$\lim_{x\to 1} q(x)(1-x)=\frac{2}{7}=\frac{1}{3.5}$$ which is what Arthur conjectured in comments above.

It turns out for $i>1$, $|\alpha_i|<\frac{3}{4}$, so we have:

$$p(N)=\frac{2}{7} + O\left(\left(\frac 34\right)^N\right)$$

Let $P(N)$ be the probability rolling a sum of $N$ with any number of dice. If we consider the number of ways we can roll $m$ dice to sum to $N$, it should just be number of ways we can roll $(m-1)$ dice and get within $6$ of $N$, times the probability of getting the roll we need.

For example considering $N=43$, then $P(43)$ should be equal to $P(42)$ times the probability of rolling a $1$, plus $P(41)$ times the probabilty of rolling a $2$, plus ..., plus $P(37)$ times the probability of rolling a $6$.

For $N > 6$ we can define $P(N)$ recursively as: \begin{align} P(N) &= \frac{1}{6}P(N-1) + \frac{1}{6}P(N-2) + \dotsb + \frac{1}{6}P(N-6) \\ &= \frac{1}{6}\Big(P(N-1) + P(N-2) + \dotsb + P(N-6)\Big) \\ &= \frac{1}{6}\sum_{i=N-1}^{N-6}P(i) \end{align}

We should consider $N \leq 6$ separately because there are not six previous terms: $$P(N) = \frac{1}{6}\sum_{i=0}^{N-1}P(i)$$ (Note that we let $P(0) = 1$ since we can always roll $0$ dice for a sum of $0$.)

So for each $N$ after $6$, $P(N)$ is just average of the six previous $P$. I'm sure there should be a closed form for this, but it is outside of my ability to find this closed form.

• I think you should start with $P(0)=1$ and your $N\leq 6$ should include $0$ in the sum. – Thomas Andrews Jan 5 '15 at 23:53
• It should also be $\frac{1}6$, not $\frac 1N$ in the $N\leq 6$ case. – Thomas Andrews Jan 5 '15 at 23:54
• @ThomasAndrews right you are. It will be edited. – Mike Pierce Jan 5 '15 at 23:55