[Math] formula for probability of specific die outcomes

diceprobability

Roll some number, N, of the same kind of dice, say d6. Picking a target outcome, say 1, what is the FORMULA to determine the chance of getting 1s as a result, which is to say, how many chances of 1 die outcome of 1 (1×1), how many of 2 outcomes of 1 (2×1), up to how many Nx1 — the maximum number of 1s on N dice.

Obviously in the example above, there's 1 2×1, if both dice come up 1, and 10 1×1, a total of 11/36.

But what is the formula? If I roll 4 d10 dice, what's the chance of getting 1-2-3-4 x1s, in the 10,000 possible outcomes? Ok, there's one chance of 4×1, but for the rest of the outcomes, how do I calculate the number of 2×1, 3×1, 1×1? I then can add these four to get the total proportion out of 10,000. I assume theres a way to do this by formula though, but it is beyond me.

Best Answer

You’re looking for what’s called the binomial distribution, which gives the probability of exactly $k$ successes in a sequence of $n$ independent Bernoulli (i.e., succeed/fail) trians with a fixed probability $p$ of success. The formula is $${n \choose k}p^k(1-p)^{n-k}.$$

For your specific problem involving dice, $p$ would be the probability of rolling a one on a single die, i.e., $\frac16$ for a d6 and $\frac1{10}$ for a d10, $n$ would be the total number of dice you’re rolling, and $k$ is the number of ones rolled.

To combine different values of $k$, you add up their respective probabilities. There’s a special name for the sum of the probabilities from $k=0$ to $m$: the cumulative probability distribution, often written $P(X\le m)$. There are formulas for it that you can look up on the web, but I’m not convinced that for small numbers of dice they’re any easier to use than computing the individual probabilities and adding them up yourself. You’re likely not interested in including the probability of not rolling any ones at all in your sums, so you’d need to subtract $P(0)$ from the cumulative probability to get $P(1\le X\le m)$.

When doing these sums, you can save yourself some work by taking advantage of the recurrence $$p(n-k)P(k)=(1-p)(k+1)P(k+1)$$ or, rearranged, $$P(k+1)=\frac{p}{1-p}\frac{n-k}{k+1}P(k)$$ Note that $P(0)=(1-p)^n$.

Let’s work through your example of rolling ones on 4d10 ($n=4, p=1/10, p/(1-p)=1/9$): $$\begin{align} P(0) &= (1-\frac1{10})^4 = 0.6561 \\ P(1) &= \frac19\cdot\frac41\cdot P(0)=0.2916 \\ P(2) &= \frac19\cdot\frac32\cdot P(1)=0.0486 & P(1\le X\le2)=0.3402 \\ P(3) &= \frac19\cdot\frac23\cdot P(2)=0.0036 & P(1\le X\le3)=0.3438 \\ P(4) &= \frac19\cdot\frac14\cdot P(3)=0.0001 & P(1\le X\le4)=0.3439 \end{align}$$ As a sanity check, the last cumulative value is $1-P(0)$ as expected.

If you want to compute the probabilities for rolling less than or equal to some value, then you adjust the value of $p$. E.g., to find the probability of rolling 3 or less on $k$ dice when rolling 4d10, you’d set $n=4$ and $p=3/10$ in the formula.

Related Question