1

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?

JMoravitz
  • 79,518
Jamgreen
  • 809
  • What... are you not counting RRRRR as having two consecutive rainy days? What about RSRRS? What exactly do you mean then by "having two consecutive rainy days"? That in the period of time you have exactly two rainy days and the rest are sunny and furthermore that those two rainy days occur consecutively? That is not at all how I would interpret the phrase... – JMoravitz Nov 16 '16 at 07:05
  • You're right :D There are many more – Jamgreen Nov 16 '16 at 07:09
  • So then, that brings us back to my question. What exactly do you mean by "having two consecutive rainy days"? Do you mean that the longest run of consecutive rainy days is equal to exactly two? (RRRSS doesn't count then) Do you mean that the longest run of consecutive rainy days is equal to at least two? (RRRSS does count) – JMoravitz Nov 16 '16 at 07:11
  • As jmoravitz points out there are many more ways to have consecutive rainy days then just the 4 you list. It'd be easy to count the numbers of ways you can't have consecutive rainy day and subtract from 32. 1)no rainy days at all. Then there are five ways to valve 1. How many ways are there to have two or three non consecutive rainy days? Four? – fleablood Nov 16 '16 at 07:13
  • I would expect that this older post should match the most reasonable interpretation of your question. – JMoravitz Nov 16 '16 at 07:20

1 Answers1

1

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.

barak manos
  • 43,109
  • This doesn't answer the more general question in his final line as to how to apply such a technique to a string of $321$ consecutive rainy days in a $31289$ day period. It only seems to generalize nicely to a string of two consecutive rainy days. See my link above (which I think it should be closed as duplicate of, but am unable to cast such a vote). – JMoravitz Nov 16 '16 at 07:40
  • @JMoravitz: I have partially answered that general question (the probability of $2$ consecutive rainy days in a $31289$-day period). – barak manos Nov 16 '16 at 07:43
  • well, the linked question and answer do answer the more general question (run of at least $k$ consecutive rainy days during an $n$ day period), so it makes this post a bit moot. The link again. – JMoravitz Nov 16 '16 at 07:48
  • @JMoravitz: Yep, OK, I did not notice your link up there... – barak manos Nov 16 '16 at 07:50