[Math] Calculate probability of obtaining at least a sequence of numbers for a given number of dice rolls

diceprobability

I want to calculate the probability of rolling at least a sequence of values for a given set of dice. This sequence may have duplicate values.

I am aware of the Binomial Probability Equation used to compute the probability of rolling a single value k times in n attempts. However, since I am looking for a sequence of values, I have not found a way to apply this theorem correctly.

Here's an example:

Let $n = 3$ fair dice, each $3$-sided. What is the probability of obtaining at least one "$1$" and one "$2$"?

There are 27 possible outcomes, of which 12 satisfy the requirement:

111 121 131 211 221 231 311 321 331
112 122 132 212 222 232 312 322 332
113 123 133 213 223 233 313 323 333

Similarly, if $n = 4$ fair dice, the probability is $\frac{50}{81}$.

Is there a more elegant method of obtaining the solution? I have a hunch it involves combining permutations with Binomial Probability but I haven't found the pattern.

Best Answer

Imagine an $s$-sided die, say with all sides equally likely. One of these sides has $1$ written on it, and another side has $2$ written on it. We toss the die $n$ times, and want the probability of at least one $1$ and at least one $2$.

Let $A$ be the event "no $1$" and let $B$ be the event "no $2$." We will compute $\Pr(A\cup B)$, This is $\Pr(A)+\Pr(B)-\Pr(A\cap B)$.

The probability of $A$ is $\left(\frac{s-1}{s}\right)^m$. The probability of $B$ is the same.

The probability of $A\cap B$ is $\left(\frac{s-2}{s}\right)^m$.

So now we know $\Pr(A\cup B)$. You are looking for $1-\Pr(A\cup B)$.

Remark: The technique we have used is a special case of the method of Inclusion/Exclusion. When we add together $\Pr(A)$ and $\Pr(B)$, we have "double counted" the situations in which both $A$ and $B$ occur. The subtraction takes care of that. Inclusion/Exclusion can get much more complicated. It is a quite useful tool.