Markov Rain
1. **State the problem:**
We have a weather system where the probability of rain tomorrow depends on whether it rained today and yesterday. We are asked to show this can be analyzed using a Markov chain, determine how many states are needed, and find the transition matrix.
2. **Identify states:**
Since the probability depends on the last two days' weather, we need to consider pairs of weather states for consecutive days.
Possible states representing last two days are:
- RR (rained both days)
- RN (rained yesterday but not today)
- NR (did not rain yesterday but rained today)
- NN (did not rain either day)
Thus, there are $4$ states.
3. **Define the state transitions:**
From each state, we look at the probability of rain tomorrow, updating the two-day window accordingly.
- From RR: next day rain with probability $0.7$, no rain with probability $0.3$.
- Rain tomorrow $
ightarrow$ new state RR
- No rain tomorrow $
ightarrow$ new state RN
- From RN: rain tomorrow $0.5$, no rain $0.5$
- Rain tomorrow $
ightarrow$ NR
- No rain tomorrow $
ightarrow$ NN
- From NR: rain tomorrow $0.4$, no rain $0.6$
- Rain tomorrow $
ightarrow$ RR
- No rain tomorrow $
ightarrow$ RN
- From NN: rain tomorrow $0.2$, no rain $0.8$
- Rain tomorrow $
ightarrow$ NR
- No rain tomorrow $
ightarrow$ NN
4. **Write the transition matrix:**
Ordering states as [RR, RN, NR, NN], rows represent current states, columns represent next states.
$$
P = \begin{bmatrix}
0.7 & 0.3 & 0 & 0 \\
0 & 0 & 0.5 & 0.5 \\
0.4 & 0.6 & 0 & 0 \\
0 & 0 & 0.2 & 0.8
\end{bmatrix}
$$
5. **Explain:**
This setup defines a Markov chain with $4$ states because the future (tomorrow's rain) depends only on the current state (last two days), satisfying the Markov property. The transition matrix gives the probabilities for moving between states.
**Final answer:**
- Number of states needed: $4$
- Transition matrix:
$$
\begin{bmatrix}
0.7 & 0.3 & 0 & 0 \\
0 & 0 & 0.5 & 0.5 \\
0.4 & 0.6 & 0 & 0 \\
0 & 0 & 0.2 & 0.8
\end{bmatrix}
$$