From Ross O’Brien comes a game of nonconformist dice:
You have four fair tetrahedral dice whose four sides are numbered 1 through 4.
You play a game in which you roll them all and divide them into two groups: those whose values are unique, and those which are duplicates. For example, if you roll a 1, 2, 2 and 4, then the 1 and 4 will go into the “unique” group, while the 2s will go into the “duplicate” group.
Next, you reroll all the dice in the duplicate pool and sort all the dice again. Continuing the previous example, that would mean you reroll the 2s. If the result happens to be 1 and 3, then the “unique” group will now consist of 3 and 4, while the “duplicate” group will have two 1s.
You continue rerolling the duplicate pool and sorting all the dice until all the dice are members of the same group. If all four dice are in the “unique” group, you win. If all four are in the “duplicate” group, you lose.
What is your probability of winning the game?
If there are four dice, there are $4^4 = 256$ outcomes.
I looked at the combinations of unique and duplicate dice, as well as further explored the ones where rerolls were possible.
Each die should be different than the previously rolled. $\dfrac{4}{4} \cdot \dfrac{3}{4} \cdot \dfrac{2}{4} \cdot \dfrac{1}{4} = \dfrac{24}{256} = \dfrac{3}{32}$.
Two dice are the unique, two dice are the same, and there are six ways to choose the duplicated pair. $\left( \dfrac{4}{4}\cdot\dfrac{3}{4} \cdot \dfrac{2}{4} \cdot \dfrac{1}{4} \right) \cdot 6 = \dfrac{144}{256} = \dfrac{9}{16}$.
These two duplicate dice must be rerolled. Here are the outcomes.
One die is unique, three dice are the same, and there are four ways to choose the unique. $\left( \dfrac{4}{4}\cdot\dfrac{3}{4} \cdot \dfrac{1}{4} \cdot \dfrac{1}{4} \right) \cdot 4 = \dfrac{48}{256} = \dfrac{3}{16}.$
These three duplicate dice must be rerolled. Here are the outcomes.
Looking at the Markov Chain the initial distribution can be represented as,
$\pi_0 = \left[\begin{matrix} \dfrac{3}{32} \\ \dfrac{5}{32} \\ \dfrac{9}{16} \\ \dfrac{3}{16} \end{matrix} \right]$
and transition matrix can be represented as,
$P = \left[\begin{matrix} 1 & 0 & \dfrac{1}{8} & \dfrac{3}{32} \\ 0 & 1 & \dfrac{1}{8} & \dfrac{5}{32} \\ 0 & 0 & \dfrac{5}{8} & \dfrac{9}{16} \\ 0 & 0 & \dfrac{1}{8} & \dfrac{3}{16}\end{matrix} \right]$
The terminating states are the first, which is all unique, and the second, which is all duplicate.
Solving $P\pi_n = \pi_n$ yields,
$$\pi_n = \left[\begin{matrix} \dfrac{9}{20} \\ \dfrac{11}{20} \\ 0 \\ 0 \end{matrix} \right]$$The probability of winning the game is 45%.
I also ran a simulation of 10 million games. I received 4,496,805 wins and 5,503,195 losses.