Probability of seeing all numbers when rolling dice $7$ times

1.5k Views Asked by At

What is the probability when rolling a fair dice $7$ times to see every number $1, \dots, 6$ at least once?

My attempt: The total number of outcomes is $6^7$. Now we count the number of possibilities to see all the $6$ numbers as follows:

Let's consider the first roll unimportant. The last 6 rolls have to show every number (there are 6 possibilities for the first roll and $6!$ possibilities for the last 6 rolls to show every number). There are $6\cdot 6!$ possibilities.

Now we repeat the process, but consider the second roll unimportant and so on.

This yields: $6 \cdot 6 \cdot 6!$ possibilities. But we counted some elements twice. How can I calculate the number of possibilities I counted twice or is there an easier way to approach this problem?

2

There are 2 best solutions below

8
On BEST ANSWER

I can see one mistake: there are seven dice that may be considered unimportant, not six.

You counted each possibility exactly twice. For instance, consider the throw $$ 1, 2, 3, 4, 5, 6, 6 $$ You counted it once when the sixth die was unimportant, and once when the seventh die was unimportant. Same goes for any other throw: Whatever the pair is, you counted the throw once when the first pair die was unimportant, and once when the second pair die was unimportant.

Alternative approach: No matter which way you throw six different numbers with seven dice, there must be exactly one pair. Choose the value of the pair, decide what places the two dice in the pair appear, then place the rest of the dice. You get the same answer.

0
On

In your case, precisely one number must appear twice. Fix this to be $1$. There are $\binom{7}{2}$ ways to pick where these appear, and then $5!$ options for the other five numbers. There $6$ options for the fixed number, so the solution is

$\cfrac{5!\cdot 6 \cdot \binom{7}{2}}{6^7} = \cfrac{6!\cdot\binom{7}{2}}{6^7} = 0.054$

(I have checked this using the following Python code:)

import numpy as np     
n = 1000000
counter = 0
for i in range(n):
if all(i in (np.random.random_integers(1,6,7)) for i in range(1,7)):
    counter+=1
print (counter/n)