0
$\begingroup$

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.

1 Answers 1

1

If you have probability $p$ of an event occuring, the expected time for it to occur for independent trials is $1/p.$

The expected time to get all even sides is the time to get the first even side (the probability of rolling any even is 1/2, so time is 2) + the time to get the second even side (now have probability 2/6 to roll one of the two remaining evens, so time is 3) + the time to get the third (now have prob 1/6 to roll the last so expected time is 6). To the total expected time is 6+3+2 = 11. You're right that it will be the same for the odd sides, so the answer is 11+11 = 22.