Chance of having two consecutive rainy days I have the question

If the chance of rain vs. sun is 50:50 what is the chance of having 2 consecutive rainy days in a 5-day period?

I would solve it by saying that two consecutive rainy days can only happen with
RRSSS
SRRSS
SSRRS
SSSRR

and there is a total of $2^5 = 32$ combinations.
So the probability is
$$
P = \frac{4}{2^5} = \frac{4}{32} = \frac{1}{8}
$$
but what if I have to determine the chance of having 321 rainy days in a 31289-day period?
How do I more systematically determine the number of outcomes?
 A: You can solve this using recurrence relation.

Let $a_n$ denote the number of combinations of $n$ days such that:


*

*No $2$ consecutive days are rainy

*The last day was rainy


Let $b_n$ denote the number of combinations of $n$ days such that:


*

*No $2$ consecutive days are rainy

*The last day was not rainy


Then the number of combinations of $5$ days such that no $2$ consecutive days are rainy is $a_5+b_5$.

Now:


*

*$a_1=1$ 

*$b_1=1$

*$a_n=b_{n-1}$

*$b_n=b_{n-1}+a_{n-1}$


So we can compute $a_5$ and $b_5$ gradually:


*

*$a_2=1$

*$b_2=1+1=2$

*$a_3=2$

*$b_3=2+1=3$

*$a_4=3$

*$b_4=3+2=5$

*$a_5=5$

*$b_5=5+3=8$



So the number of combinations of $5$ days such that no $2$ consecutive days are rainy is $8+5=13$.
And the probability of a combination of $5$ days such that no $2$ consecutive days are rainy is $13/32$.
Note that the probability in the general case is $\frac{F_{n+1}+F_n}{2^n}$, where $F_k$ is the $k$th Fibonacci number.
You can use the closed form of $F_n=\left[\frac{\phi^n}{\sqrt5}\right]$ in order to calculate this probability easily.
