Chance of rain 50%. If it rains, it rains all the way. Find average number of raining days? I have a sequence of 10 days. Each day, it has a 50% chance of raining. If it rains today, it will rain on all following days as well (that is, if it first rains on day 6th, it will also rain on days 7th, 8th, 9th, 10th).
How do I find the average number of raining days?
My real problem is when the number of days is not an integer. For example, sometimes it's 8, sometimes it's 11, and on average, the number of days is 10.23. How do I calculate the average number of raining days in that case (same raining probability 50%)?
Thank you very much!
===
Edit:
I indeed meant "50% chance of starting to rain". Thanks for the clarification in the comments.
===
Edit 2:
Sorry for the confusion. I'll borrow the clarification from below, since it seems most clear: "the onset of rain (like a monsoon "breaking") has a probability of 0.5 on any day, and it will go on raining till the end thereafter".
 A: There's a 50% chance that it rains on the first day and thus on all of the following day.
Thus, if it doesn't rain on the first day, there cannot be a nonzero probability that it will start raining on another day, because then the chance of rain on the last day would be more than 50%.
Thus the probability distribution is simply 50/50 between "rain throughout" and "dry throughout", and the average number of rainy days is 5.

If you have a variety of periods with different lengths, the average number of rainy days in a particular period will be half the number of days, so the number of rainy days in any period will be the average of half the period count, which is the same as half of the average period length -- even if the latter is not an integer.
A: If what you mean is that during this 10 day window, the onset of rain (like a monsoon "breaking") has a probability of 0.5 on any day, and it will go on raining till the end thereafter,
E(x) = $\sum_{k=1}^{10} 0.5^k\cdot(11-k)  = \frac{9217}{1024}$, ≈ 9.001
This is not an integer, but as has been pointed out, that is not a problem ! 
A: If each day has a $50\%$ chance of raining then the expected average number of raining days is half of them; this is not affected by any dependency between rain on different days. 
If the number of days is a random variable then the expected average number of raining days would then be half the expected average number of days.
A: Here's another approach. This is useful if we also want to know the probability of it raining on a given day.
The probability of it raining on day $n$ is given by
$$\begin{align}p_n&=p_{n-1}+0.5^{n-1}(0.5)\\
&=p_{n-1}+0.5^n\end{align}$$
Assuming that $p_0=0$, telescoping gives
$$\begin{align}p_n&=\sum_{r=1}^n 0.5^n\\
&=1-0.5^n
\end{align}$$
The expected number of days that it would rain is given by 
$$\sum_{n=1}^{10}1\cdot p_n=\sum_{n=1}^{10}(1-0.5^n)=9.001\qquad\blacksquare$$
A: You can find actuarial simulators that show a profile related to your question in this eBook  http://www.amazon.com/gp/product/B00ZEDHW5E?Version=1&entries=0
You can calculate a related numerical result based on a non-integer number of days using logarithms, but can you really have 10.23 days?  I suppose that would translate into 10 days and just under 6 hours, and you could extrapolate using actuarial information.
But if monsoon onset is the scenario you have in mind, the actuarial simulators in the above eBook won't help.
