1

Question: If you roll a $6$-sided die $10$ times, what is the probability of rolling each number at least once?

My attempt:

It is fair to assume that the probability of not rolling a number is $5/6$, and if we roll 10 times, it will be $(5/6)^{10}$.

Assuming that $A$ denotes the event of rolling a number once. In that case, $\Pr\{A\}=1-(5/6)^{10} = 0.838494.$

But since we have $6$ unique numbers, it'll be $0.838494^6 = 0.347536$. But I made a program that calculates it, and the answer is $0.27$. What am I missing?

Aig
  • 4,178
  • You only multiply two probabilities together to get another probability in the event that they are independent. $\Pr(A\cap B)=\Pr(A)\times \Pr(B)$ if and only if $A$ and $B$ are independent. It is clear to see that these probabilities are not independent. If five of the numbers have not been seen... it is guaranteed that the sixth number must be seen. – JMoravitz Jan 26 '24 at 14:53
  • 3
    To answer the question... that depends on what you know already about probability and combinatorics. We could go through a lengthy inclusion-exclusion argument which is tedious but accessible to beginners, or we could use fancier techniques involving Stirling numbers of the second kind and say the answer is $\dfrac{{10 \brace 6}\times 6!}{6^{10}}\approx 0.271812$ – JMoravitz Jan 26 '24 at 14:56
  • To explore the Inclusion-Exclusion approach, first see this article for an introduction to Inclusion-Exclusion. Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula. ...see next comment – user2661923 Jan 26 '24 at 14:59
  • Following the syntax of the second link in the previous comment, let $~S~$ denote the set of all possible groups, where each group represents the result of throwing the die 10 times. Then, for $~k \in {1,2,3,4,5,6},~$ let $~S_k~$ denote the subset of $~S~$ where, for each group in $~S_k,~$ the number $~k~$ was not thrown. For example, $~S_1~$ represents the subset of $~S~$ where the number 1 was not thrown, but where any of the other numbers may or may not have appeared. Then, the desired computation is $$\frac{|S| - |S_1 \cup S_2 \cup \cdots \cup S_6|}{|S|}.$$ – user2661923 Jan 26 '24 at 15:04
  • Just in case if you needed further convincing that the approach taken in the post was incorrect, consider what happens if we talked about 20-sided dice instead of 6-sided dice but changed nothing else about the problem. It is clear that in 10 rolls it is impossible to have seen all 20 faces, but your approach would have given a nonzero probability. – JMoravitz Jan 26 '24 at 15:14
  • There are evidently $6^{10}$ functions $[10]\to[6]$ and you are actually asked to find out how many of them are surjective. For finding this Stirling numbers of the second kind are very handsome (as you were told already by @JMoravitz ). – drhab Jan 26 '24 at 16:14
  • I showed you how I was thinking about this problem so you can correct my mistakes because I know my written code is correct and I got a different number, thanks for showing me the right way to do it. – Roland Baki Jan 26 '24 at 16:22
  • See https://math.stackexchange.com/questions/379525. – joriki Feb 10 '24 at 04:46

1 Answers1

1

Let us calculate the number of all the sequences of $10$ rolls. It is equal to $6^{10}$. We don’t want the sequences that don’t contain any particular number from $1$ to $6$, so we should subtract them. There are ${6 \choose 1}$ ways to choose a missing number and $5^{10}$ ways to form a sequence without it.

The answer could be $6^{10}-{6 \choose 1}\cdot 5^{10}$, but actually we subtracted, for example, sequences that miss numbers $1$ and $2$ two times! We should add them back one time. There is ${6 \choose 2}$ ways to choose two numbers and there is $4^{10}$ sequences without them.

Continuing this reasoning in line with the inclusion-exclusion principle we get that the number of sequences of $10$ rolls such that every number $1,2,3,4,5,6$ was rolled at least once is equal to

$$6^{10}-{6 \choose 1}\cdot 5^{10}+ {6 \choose 2}\cdot 4^{10} - {6 \choose 3}\cdot 3^{10} + {6 \choose 4}\cdot 2^{10} - {6 \choose 5}\cdot 1^{10}=$$ $$= 16435440.$$

Then the probability of the event that every number $1,2,3,4,5,6$ will roll at least once is equal to $$\frac{16435440}{6^{10}}=\frac{38045}{139968}\approx 0.2718121285.$$

There’s also a useful notion of Stirling numbers of the second kind which incorporate this inclusion-exclusion reasoning and give essentially a ready answer. $S(n,k)$ is the number of ways to split $n$ distinguishable objects into $k$ non-empty groups. This is exactly what we want: to split $10$ rolls into $6$ groups ($S(10,6)$ ways to do so) and then assign a number from $1$ to $6$ to any group ($6!$ ways to do so). Then the answer is

$$\frac{S(10, 6)\cdot 6!}{6^{10}}= \frac{16435440}{6^{10}}.$$

(Here is a nice online Stirling numbers calculator to find $S(10,6)$.)

By the way, we just proved that $$S(10, 6)=\frac{1}{6!}( 6^{10}-{6 \choose 1}\cdot 5^{10}+ {6 \choose 2}\cdot 4^{10} - {6 \choose 3}\cdot 3^{10} + {6 \choose 4}\cdot 2^{10} - {6 \choose 5}\cdot 1^{10}).$$

Or, in general: $$ S(n,k)=\frac{1}{k!}\sum_{i=0}^k (-1)^{k-i}{k \choose i}i^n.$$

Aig
  • 4,178