My problem is similar to the following question but with one minor modification:
Given a fair die, what is the expected number of rolls to get all even numbered sides first then all odd numbered sides?
- Example 1 The sequence of rolls: $2,4,6,1,3,5$ is of length 20
- Example 2 The sequence of rolls: $1,\left\{4\right\},3,\left\{2\right\},5,\left\{6\right\},\left\{1\right\},2,\left\{3\right\},4,\left\{5\right\}$ is of length 11
I came up with the following
$$E(T) = E(T_{even}) + E(T_{odd})$$ $$E(T_{even}) = E(T_{odd})$$ $$E(T_{even}) = 6(\frac{3}{6} + \frac{2}{6} + \frac{1}{6})$$
$$E(T) = 2E(T_{even})$$ $$E(T) = 12$$
However running a simulation, I obtain a result that $E(T) \approx 22$
Given the difference, I'm not sure which is correct, simulation seems to give a more reasonable value.