1. ## Dice session :-)

10 dice is rolled, what is the probability of:

a) getting one & two once and all other numbers exactly twice
b) getting one & two exactly 3 times
c) getting four even and six odd numbers
d) getting one & three two times, if we know that two appeared once and five 3 times

2. The correct answer to part a) is $\frac{10!}{(2^4)(6^{10})}$.
That is the number of ways to rearrange the string $1233445566$ times the probability of any string.

3. I'm not sure I got it, which distribution is used in this solution?

4. Originally Posted by losm1
I'm not sure I got it, which distribution is used in this solution?

See this Wikipedia article on multinomial coefficient.

Let E = the event that we get one 1, one 2, and two of every other face value.

Let M = {1, 2, 3, 3, 4, 4, 5, 5, 6, 6}

Say the dice are labeled from 1 to 10, and that after rolling them you put them in ascending order from left to right. This is the same as rolling a single die 10 times in a row and writing down the result from left to right.

There are 6^10 possible combinations, as Plato says, strings.

The number of ways to get E is the number of permutations of M, which is

$\frac{10!}{1!1!2!2!2!2!} = \frac{10!}{2^4}$

Then we simply write

$P(E)=\frac{\text{number of ways to get E}}{\text{number of ways to roll dice}}=\frac{10!}{2^4\cdot6^{10}}$

5. What about b)? I'm not sure how to apply multinomial distribution formula on this one?

Formula is $\frac{n!}{k_1! k_1! \cdots k_n!}\times p_1^{k_1}p_2^{k_2}\cdots p_n^{k_n}$

$\frac{10!}{3!3!\cdot 6^{10}}$ doesn't feel right.

6. Originally Posted by losm1
What about b)? I'm not sure how to apply multinomial distribution formula on this one?
Formula is $\frac{n!}{k_1! k_1! \cdots k_n!}\times p_1^{k_1}p_2^{k_2}\cdots p_n^{k_n}$
$\frac{10!}{3!3!\cdot 6^{10}}$ doesn't feel right.
You really need to learn to model the outcome space.
For part (b) the desired outcomes are rearrangements of the string $111222XXXX$.
Where each $X$ can be $3,4,5,\text{ or }6$.
The string can be arranged in $\frac{10!}{(3!)^2(4!)}$ ways.
But each $X$ can be replaced in four ways that gives $\frac{(10!)(4^4)}{(3!)^2(4!)}$.
Now each of those strings has probability $\frac{1}{6^{10}}$.

7. Thanks Plato!

8. Originally Posted by Plato
You really need to learn to model the outcome space.
For part (b) the desired outcomes are rearrangements of the string $111222XXXX$.
Where each $X$ can be $3,4,5,\text{ or }6$.
The string can be arranged in $\frac{10!}{(3!)^2(4!)}$ ways.
But each $X$ can be replaced in four ways that gives $\frac{(10!)(4^4)}{(3!)^2(4!)}$.
Now each of those strings has probability $\frac{1}{6^{10}}$.
I don't know if this post will be of value to anyone, but here is another method which is much more complicated than Plato's and gives the same result. I outlined it originally because I was having trouble following Plato's reasoning, even though it seems really easy to follow now.

Consider each possible type of string, by which I mean:

111222XXXX {4}
111222XXXY {1,3}
111222XXYY {2,2}
111222XYZZ {1,1,2}
111222XYZW {1,1,1,1}

where X, Y, Z, and W can be 3, 4, 5, or 6.

This corresponds with the ways 4 can be partitioned as a sum of positive integers. (For partition function P, P(4) = 5.)

Then you count the ways to get each one and multiply by the corresponding ways to arrange the string.

4 ways to get {4} resulting in $\frac{(4)(10!)}{(3!)^2(4!)^1}$.

$\binom{4}{2}\cdot2$ ways to get {1,3} resulting in $\frac{(12)(10!)}{(3!)^3(1!)^1}$.

$\binom{4}{2}$ ways to get {2,2} resulting in $\frac{(6)(10!)}{(3!)^2(2!)^2}$.

$\binom{4}{3}\cdot3$ ways to get {1,1,2} resulting in $\frac{(12)(10!)}{(3!)^2(1!)^2(2!)^1}$.

1 way to get {1,1,1,1} resulting in $\frac{(1)(10!)}{(3!)^2(1!)^4}$.

Which can be summarized as

$P=\left(\frac{10!}{(3!)^2 6^{10}}\right)\left(\frac{4}{(4!)^1}+\frac{12}{(1! )^1(3!)^1} + \frac{6}{(2!)^2} + \frac{12}{(1!)^2(2!)^1} + \frac{1}{(1!)^4}\right)$

We get $P=\frac{350}{19683} \approx 0.01778$.

By the way, I also programmed a Monte Carlo to verify the result. (Because initially there was a discrepancy between the two answers, due to my writing a 12 instead of a 6 in one spot.)

Code:
import java.util.Random;

public class diceRollsProblem() {
Random g = new Random();
public void monteCarlo() {
int successes = 0;
for (int i = 0; i < Integer.MAX_VALUE; i++) {
if (i % 500 == 0)
System.out.println(i + " " + successes/(double)i);
int[] rolls = new int[10];
for (int j = 0; j < 10; j++)
rolls[j] = g.nextInt(6)+1;
int num1s = 0, num2s = 0;
for (int j = 0; j < 10; j++) {
if (rolls[j] == 1) num1s++;
if (rolls[j] == 2) num2s++;
}
if (num1s == 3 && num2s == 3) successes++;
}
}
}
Edit: This program's a bit better.

Code:
import java.util.Random;

public class diceRollsProblem() {
Random g = new Random();
public void monteCarlo() {
int successes = 0;
for (int i = 0; i < Integer.MAX_VALUE; i++) {
if (i % 100000 == 0)
System.out.println(i + " " + successes/(double)i);
int[] distr = new int[6];
for (int j = 0; j < 10; j++)
distr[g.nextInt(6)]++;
if (distr[0] == 3 && distr[1] == 3) successes++;
}
}
}

9. Great explanation, undefined! You're right, when you put it this way it's much easier to comprehend.