# Atleast One Pair Upon Rolling 5 Dice(AoPS) Probability Problem

I came across the following problem by AoPS:

Each of five, standard, six-sided dice is rolled once. What is the probability that there is at least one pair but not a three-of-a-kind (that is, there are two dice showing the same value, but no three dice show the same value)?

The official solution provided in AoPS is as follows:

There are a total of $$6^5=7776$$ possible sets of dice rolls. To get a pair without a three-of-a-kind, we can either have one pair and the other three dice all showing different numbers, or we have two pairs and the fifth die showing something different.

In the first case, there are $$6$$ ways to pick which number makes a pair and $$\binom{5}{2}=10$$ ways to pick which $$2$$ of the $$5$$ dice show that number. Out of the other three dice, there are $$5$$ ways to pick a value for the first die so that that die doesn't match the pair, $$4$$ ways to pick a value for the second one so it doesn't match that die or the pair, and $$3$$ ways to pick a value for the last die so that it doesn't match any of the others. So there are$$6\cdot 10\cdot 5 \cdot 4 \cdot 3 = 6^2 \cdot 100$$ways to roll this case.

In the second case, to form two pairs and one die not part of those pairs, there are $$\binom{6}{2}=15$$ ways to pick which two numbers make the pairs, then $$4$$ ways to pick a value for the last die so that it doesn't match either of those pairs. There are$$\frac{5!}{2!\cdot 2!\cdot 1!}=30$$ways order the five dice (equal to the number of ways to order XXYYZ), so that makes a total of$$15\cdot 4 \cdot 30 = 6^2\cdot 50$$ways to roll this case.

This makes a total of$$6^2 \cdot 100 + 6^2 \cdot 50 = 6^2 \cdot 150 = 6^3 \cdot 25$$ways to roll a pair without rolling a three-of-a-kind. So, the probability is$$\frac{\text{successful outcomes}}{\text{total outcomes}}=\frac{6^3 \cdot 25}{6^5}=\frac{25}{6^2}=\boxed{\frac{25}{36}}.$$ Doubt
I did not quite understand the second case counting part.

In the second case, to form two pairs and one die not part of those pairs, there are $$\binom{6}{2}=15$$ ways to pick which two numbers make the pairs, then $$4$$ ways to pick a value for the last die so that it doesn't match either of those pairs

Should'nt there be $$6 \cdot 5$$ ways of choosing numbers for the two pairs. For example if we have chosen 6 and 5 for the two pairs and 4 for the die not part of the pairs, lets consider the following choice for the pairs and the single die among the 5 dice. $$<6, 5, 6, 5, 4>$$. According the official solution, $$<6, 5, 6, 5, 4>$$ would only be counted and $$<5, 6, 5, 6, 4>$$ would not be counted. But in my approach of choosing numbers for the two pairs, $$<6, 5, 6, 5, 4>$$ and $$<5, 6, 5, 6, 4>$$ both would be counted. Where did my reasoning go wrong? Thanks

The point is that if you start with $$66554$$ and find all $$30$$ ways to put them in order, you get the same set of sequences as if you start with $$55664$$ and put them in order. You don't care what order the numbers in the pairs are chosen, which is why $$15$$ is correct.
• So basically 66554 is but a permutation of 55664 and is counted in the other part ie. $$\frac{5!}{2!\cdot 2!\cdot 1!}=30$$ and hence is overcounted when i include it again in 6 * 5. Hence i should only choose the two numbers and not account for the order as it is considered in the other part. Thanks a lot @Ross Millikan May 8, 2021 at 14:18