## a problem involving combinations and the rolling of a die

Problem: What's the probability that in 100 rolls of a 6-sided die, the side number 1 will come up exactly 10 times?

There are _{100}C_{10} (read, "100 choose 10") ways of getting 10 one's out of a total of 6^{100} different ways to roll the die.

For each way of getting 10 one's, there are 5^{90} different outcomes involving the other rolls (2, 3, 4, 5 and 6) of the die.

That's P(10) = _{100}C_{10}(5^{90})/6^{100}

≈ (1.73 E13)(8.08 E62)/(6.53 E77)

≈ 2.14 E−2 ≈ 0.0214

or about 1 in every 46.7 trials

### a general solution

In the general case, what's the probability that in n rolls of a m-sided die, the side number 1 will come up exactly k times (k ≤ n)?

Out of a total of m^{n} different ways to roll an m-die n times, there are _{n}C_{k} ways of getting k one's.

For each such combination, there are (m−1)^{n−k} permutations (patterns with order taken into account) involving the other rolls (2, 3, ..., m−1, m) of the die. So we have

P(k) = _{n}C_{k}(m−1)^{n−k}/m^{n}

That is, the number of combinations of n things k at a time, times the number of ways to get any one of the m−1 negative outcomes (outcomes other than one) in the remaining n−k places, divided by the total number of ways to throw the die.

The above formula is also given equivalently as

P(k) = _{n}C_{k}(1/m)^{k}[(m−1)/m]^{n−k}

That is, the number of combinations of n things, k at a time, times the probability of k consecutive positive outcomes, times the probability of n−k consecutive negative outcomes.