# Calculate probability of obtaining at least a sequence of numbers for a given number of dice rolls

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.

-

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.

-
So if I were to use the Inclusion/Exclusion principle with a sequence of 3 values, say {1,2,3}, it would be Pr(A)+Pr(B)+Pr(C)−Pr(A∩B) −Pr(A∩C) −Pr(B∩C) + Pr(A∩B∩C) ... and then the answer for n=3 and s=3 turns out to be 6/27 as expected. Is it then possible to use this method if duplicate values are included in the sequence? i.e. probability of getting at least 2 "1"'s and 1 "2" ? –  dbn Jul 29 '13 at 8:44
Yws, it can be handled. And yes, the expression you mentioned at the beginning is the right three-term Inclusion/Rxclusion. –  André Nicolas Jul 29 '13 at 9:59