If you roll five dice your chances of getting all five matching is $\frac{1}{6^5} = \frac{1}{7776} \approx 0.08\%$.
I recently learned the binomial probability formula: $P = nCr \times p^r \times (1 - p)^{n-r}$.
- $nCr = \frac{n!}{r!(n-r)!}$ << The different possible combinations
- $r$ is the number of dice you need to match
- $n$ is the number of dice you're rolling
- I use $\frac{1}{6}$ in the formula because that's dice probability
Because I am rolling 5 dice and need 5 matches, I set $r = 5$ and $n = 5$ and came up with this equation: $P=\frac{5!}{(5-5)!5!}\times(\frac{1}{6})^{5}\times(1-\frac{1}{6})^{5-5}\approx0.012\%$
But when I set $r = 4$, $n = 4$ with the formula below I do get the desired result. $P=\frac{4!}{(4-4)!4!}\times(\frac{1}{6})^{4}\times(1-\frac{1}{6})^{4-4}\approx0.08\%$
Why is this? Shouldn't $r$ and $n$ be 5 because I'm rolling 5 dice and need 5 matches?