[Math] Calculating the probability of obtaining exactly four distinct values when a die is rolled six times

combinatoricsdiceprobability

Please could someone help me with determining the probability of getting $4$ distinct numbers (no order in the outcome e.g. 1,2,3,4 or 4,5,6,2 etc) or $5$ distinct from rolling a die $6$ times. So far I was able to calculate the probability of getting $6$ distinct numbers from $6$ rolls of a dice

$$\frac{6!}{6^6}$$

But I am having issues determining if it's only $5$ or $4$ distinct numbers out of a $6$ rolls.

Additionally, is this type of probability binomial or hypergeometric?

Best Answer

Let's see how many ways we can obtain $5$ distinct numbers from $6$ rolls. First choose which $5$ numbers will appear in $\binom{6}{5}$ ways. Now observe that the only way to obtain $5$ distinct numbers in $6$ rolls is to have $4$ of the values appear exactly once, and one to appear exactly twice. There are $5$ choices for which value will appear twice and the value will appear in $\binom{6}{2}$ locations. Then the remaining $4$ rolls can be ordered in $4!$ ways. This gives a total of $$\binom{6}{5}\cdot 5\cdot\binom{6}{2}\cdot 4!$$ desirable rolls. There are $6^{6}$ possible rolls so the probability of obtaining a roll with $5$ distinct numbers is $$\frac{\binom{6}{5}\cdot 5\cdot\binom{6}{2}\cdot 4!}{6^{6}}$$

Now let's see how many ways we can obtain $4$ distinct numbers from $6$ rolls. First choose which $4$ numbers will appear in $\binom{6}{4}$ ways. Now there are two cases to consider: one value appears $3$ times and each of the other values appears once, or two values appear twice and two values appear once. We'll handle these separately.

  • Case 1: There are $4$ choices for which value will appear $3$ times, and it will appear in $\binom{6}{3}$ locations. We can then order the remaining rolls in $3!$ ways. So there are $4\cdot\binom{6}{3}\cdot 3!$ outcomes of this form.
  • Case 2: There are $\binom{4}{2}$ choices for which values will appear twice, and we can place them in $\binom{6}{2}\cdot\binom{4}{2}$ ways. There are then $2$ possible orders for the remaining two values. So there are $\binom{4}{2}\cdot\binom{6}{2}\cdot\binom{4}{2}\cdot 2$ outcomes of this type.

Combining these cases, the probability of obtaining $4$ distinct numbers is $$\frac{\binom{6}{4}\left[4\cdot\binom{6}{3}\cdot 3! + \binom{4}{2}\cdot\binom{6}{2}\cdot\binom{4}{2}\cdot 2\right]}{6^{6}}$$