Rainbow Train Rearrangement

Probability · Medium · Free problem
A train has three cars: Red, Green, and Blue. The conductor can perform one operation as many times as they like: disconnect all cars behind the front car and move them to the front, cycling the rear car to the leading position. More precisely, at each step the conductor takes the rearmost car and places it at the front of the train. The cars start in a uniformly random order. What is the probability that the conductor can rearrange the train into rainbow order (Red, then Green, then Blue)?

Open the full interactive solver, hints, and worked solution →