[Math] Expected number of blocks of identical weather

probability

The problem is as follows:

On a given day, the weather can either be sunny (with probability $0.4$), cloudy (with probability $0.4$), or rainy (with probability $0.2$). Assume weather is independent across days.

Define blocks of weather to be the largest possible groups of consecutive days in which the weather is the same. For example, if it rained for eight days, followed by a day of sun, then a day of rain, we'd have three blocks.

Across a ten-day period, what's the expected number of blocks of identical weather?

Hint: rather than calculating the probability of each possible number of blocks, try defining the answer as a sum and using linearity of expectation.

Even with the hint, I'm not sure how to approach it past the 1 block case.

Best Answer

Well we can think of it in this way.

On the first day we have at least 1 weather block with probability 1. On the next day, the probability of the weather changing and giving us another block is $$\frac{4}{5}\times\frac{3}{5} + \frac{1}{5} \times \frac{4}{5}$$

This occurs $n-1$ days and thus the expected number of weather blocks for $n$ days is given by $$E(X_n) = 1 + (n-1) \frac{16}{25}$$

Plugging in $n = 10$ we expect $\frac{169}{25}$ or roughly $6.76$ weather groups.

Related Question