# Weather forecasting problem using Markov chains

Suppose that the weather tomorrow depends only on the weather today and that there are $3$ states for the weather: Sun, Cloudy, Rainy. Suppose today is day $1$ and is Sun, what's the probability of raining in day $3$ and $4$?

The transition matrix is known and is given by :

$$P=\begin{pmatrix} 0.5 & 0.3 & 0.2 \\ 0.5 & 0.2 & 0.3 \\ 0.4 & 0.5 & 0.1 \end{pmatrix}$$

My question here is the following, If I do $P^2$ I can know the weather in day $3$ and if I do $P^3$ I can know the weather for day $4$. However, how can I know the weather simultaneously for those days?

• $$\mathbb P (\text{Rain}_3 \land \text{Rain}_4) = \mathbb P (\text{Rain}_4 \mid \text{Rain}_3) \cdot \mathbb P (\text{Rain}_3)$$ Jun 1, 2018 at 14:03
• How can I know $P(Rain_4| Rain_3)$ ? I only can get $P(Rain_4| Rain_1)$ Isn't everything deppending from day one? Jun 1, 2018 at 14:22
• You know $\Bbb P (Rain_4 | Rain_3 )$ by considering one Markov step with your transition matrix. By giving a transition matrix this way we can suppose that the chain is homogenuous, that means the transition steps do not depend on the time. Jun 1, 2018 at 14:25
• @Numbermind The matrix gives you the probabilities of the transitions from one day to the next. Jun 1, 2018 at 14:27
• @RodrigodeAzevedo So, $P(Rain_4|Rain_1)=0.1$ and $P(Rain_3| Sun_1)=0.21$? Sorry for so many questions, I'm new to this subject. Jun 1, 2018 at 14:42

Denoting your state space by $\{S,C,R\}$, you are searching for:
$$\Bbb P (X_4 = R, X_3 = R | X_1 = S) = \Bbb P(X_4 = R | X_3 = R,X_1=S)\Bbb P (X_3=R|X_1=S)$$ Can you go further by yourself? This step should be an answer to your question already.
EDIT: Further, by the markov property above equals $$\Bbb P(X_4 = R | X_3 = R)\Bbb P (X_3=R|X_1=S) = P(R,R)\cdot P^2(S,R) = 0.1\cdot 0.21$$