The day I finally get the second sunny day I leave. the probability that I stayed exactly one week

probability

Each day in Iceland, it rains with a probability p=0.8.

Denote X the number of days I stay until I've had 2 sunny days in my holidays.

What is the p.m.f. of X?

The day I finally get the second sunny day I leave.

What is the probability that I stayed exactly one week?

My Attempt

I know I can model this if it was only one sunny day, but I'm not sure how to do it if it were two. For one sunny day, I can model this as a geometric distribution, which is: $X\sim Geom(p)$ where $p=0.8$. So I need to find the probability of staying for $7$ days:
$$\mathbb{P}(X=k)=(1-p)^{k-1}p=(1-0.2)^{7-1}\cdot 0.2$$

But how would I compute it if I wanted to see two sunny days?

Best Answer

The probability that the $k$th day is the second sunny day is the probability that there was exactly one sunny day in the first $k - 1$ days multiplied by the probability that the $k$th day is sunny. There are $k - 1$ ways for one of the first $k - 1$ days to be sunny. The probability that $k - 2$ of the first $k - 1$ days are rainy and the other day is sunny is $p^{k - 2}(1 - p)$. The probability that the $k$th day is sunny is $1 - p$. Hence, the probability that the $k$th day is the second sunny day is $$\Pr(X = k) = \binom{k - 1}{1}p^{k - 2}(1 - p)^2 = (k - 1)(0.8)^{k - 2}(0.2)^2$$ Setting $k = 7$ will give you the probability of staying exactly one week.

Related Question