# How Many Dice Can You Roll the Same?

## This Week's Fiddler

When considering the three dice (d6) as distinct, there are $6^3=216$ possible rolls.

The number of ways all three dice match is $6$ (there are 6 different values it could be).

The number of ways exactly two of the dice match is $6$ (to choose the matching value) times $5$ (to choose the non-matching value) times $3$ (to choose which die is the non-matching value), making $90$.

The number of ways that none of the dice match is $6\cdot5\cdot4=120$.

The weighted average is thus $\frac{1\cdot120+2\cdot90+3\cdot6}{216}=\frac{318}{216}=\frac{53}{36}$, or about $1.4722$.

**Answer**: 53/36

## Extra Credit

Brute force for $N=10$ (took about two minutes on my machine to run).

```
import itertools
from collections import Counter
from fractions import Fraction
total = 0
for rolls in itertools.product(range(1, 7), repeat=10):
total += Counter(rolls).most_common(1)[0][1]
ans = Fraction(total, 6**10)
print(ans)
print(float(ans))
```

Output:

```
17357555/5038848
3.444746696070213
```

So the answer is $\frac{17357555}{5038848}$, or about $3.4447$.

**Answer**: 3.4447