Roll n 3-sided dice (ABC). What’s the probability of at least one A and two Bs

combinatoricsdicediscrete mathematicsprobability

Suppose you have n three-sided dice, with sides labelled A, B, C.
What is the probability of getting ABB among your dice (i.e. at least one A, at least two Bs)? Order is not important.

(By bruteforcing it in Python, it would appear that the first few probabilities are likely as follows:

n=3: 3/3^3

n=4: 22/3^4

n=5: 105/3^5

n=6: 416/3^6

but I can't see how to derive a general formula. Is it some kind of cumulative multinomial horribleness or am I missing something obvious?)

Best Answer

Using the notation $A^{k}$ to mean $k$ $A$'s:

$$\begin{eqnarray} |A^{1+} \cap B^{2+}| &=& |A^{1+}| + |B^{2+}| - |A^{1+}\cup B^{2+}| \\ &=& 3^n - |A^0| + 3^n - |B^0| - |B^1| - (3^n - |A^0\cap B^0| - |A^0\cap B^1|) \\ &=& 3^n - 2^n + 3^n - 2^n - n2^{n-1} - (3^n - 1 - n) \\ &=& 3^n - 2^{n+1} - n2^{n-1} + n + 1 \end{eqnarray}$$

So your probability is:

$$P(n) = \frac{3^n - 2^{n+1} - n2^{n-1} + n + 1}{3^n}$$

Related Question