# Determining probability of a rainy day

I have the following problem:

• If today is a sunny day, a probability that it will rain tomorrow is $$0.2$$.
• If today is a rainy day, a probability that it will be sunny tomorrow is $$0.4$$.

I need to find the probability that if it's rainy on the third of May, it will also rain on the third of June.

My initial idea was to write a program that will create the binary tree with all possible combinations and then I just traverse through all of them and sum the probabilities accordingly, but unfortunately, I have to do this by hand, so any help is very welcome.

• You can diagonalize the transition matrix and raise it to the desired power. – SmileyCraft Dec 12 '18 at 18:28
• It is easy to compute the limiting probabilities...you might imagine that $30$ days (or whatever) is long enough for the probabilities to be in their limiting state. Running it quickly on a spreadsheet, it looks like they get to the limit much quicker than that. – lulu Dec 12 '18 at 18:49

A binary tree is definitely a possible way to solve this problem.

Another way to think about it though is maybe in the language or linear algebra.

We can represent day as the vector: $$\begin{pmatrix} s \\ r\end{pmatrix}$$ where $$s$$ is the probability of sun on that day and $$r$$ represents the chance of rain, and then the matrix: $$\begin{pmatrix} 0.8 & 0.4 \\ 0.2 & 0.6 \end{pmatrix}$$ would represent the transition function from one day to another.

So if we have rain on the 3rd of May, the probability vector for the 4th of May will be $$\begin{pmatrix} 0.8 & 0.4 \\ 0.2 & 0.6 \end{pmatrix} \begin{pmatrix} 0 \\ 1\end{pmatrix}$$.

More generally, $$\begin{pmatrix} 0.8 & 0.4 \\ 0.2 & 0.6 \end{pmatrix}^n \begin{pmatrix} 0 \\ 1\end{pmatrix}$$ the probability vector for the nth day after the 3rd of May. For your problem, I think $$n = 31$$.

edit I notice now that SmileyCraft makes a good point to diagonize this transition matrix and this makes the power easier to work with.

• This is hands down the most elegant solution ever on this site. Wow. – smiljanic997 Dec 13 '18 at 18:19


• I think there are more than four $3$s at the start of the final decimal. Perhaps $11$? – Henry Dec 12 '18 at 23:49
• @Henry That's true. – Felix Marin Dec 13 '18 at 1:21