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?
Best Answer
You can solve this using recurrence relation.
Let $a_n$ denote the number of combinations of $n$ days such that:
Let $b_n$ denote the number of combinations of $n$ days such that:
Then the number of combinations of $5$ days such that no $2$ consecutive days are rainy is $a_5+b_5$.
Now:
So we can compute $a_5$ and $b_5$ gradually:
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.