Learn / Library / Expected value
Runs in a colour sequence
red balls and blue balls are arranged in a row, with every distinct colour arrangement equally likely. A run is a maximal block of consecutive balls of the same colour. What is the expected number of runs? Give a fraction a/b in lowest terms.
Checking an answer needs JavaScript. The hint and the solution open without it.
Hint
The number of runs equals plus the number of adjacent pairs with different colours.
Solution
- Each boundary between runs is an adjacent pair with different colours, so runs number of such pairs.
- The row has adjacent pairs. For one pair, the probability of red then blue is , and the same for blue then red.
- So a pair differs with probability .
- By linearity the expected number of differing pairs is .
- Adding gives .
Answer: