# Number of storms in a rainy season

This is a follow-up to my previous question. Now instead of finding a probability I would like to now find the expectation too. I will restate the question and my solution below. I would appreciate if somebody could verify my work.

The number of storms in the upcoming rainy season is Poisson distributed but with a parameter value that is uniformly distributed between (0,5). That is Λ is uniformly distributed over (0,5), and given Λ = λ, the number of storms is Poisson with mean λ. Find the probability there are at least three storms this season.

Probability:
By observation, we have $$P(X \geq 3) = 1-P(X<3)$$ By the definition of joint probability (of independent events) we have $$P(X \geq 3, \Lambda = \lambda ) = P( X \geq 3) P(\Lambda = \lambda), ~ \{\lambda ~ \epsilon ~ \Re\}$$

By independence of events, we have $$P( X \geq 3| \Lambda = \lambda ) = P(X \geq 3), ~ \{\lambda ~ \epsilon ~ \Re\}$$ So what we want to find is the following for all $\lambda$ (i.e. condition on $\lambda$ and integrate)

$$1- \sum_{i=0}^{2} P(X=i, \Lambda = \lambda), ~~ \{\lambda ~ \epsilon ~ \Re\}$$ $$= 1- \sum_{i=0}^{2} \int_0^5 p(X=i|\Lambda = \lambda)f_\Lambda (\lambda)~d \lambda$$

Because $\Lambda$ is a uniform random variable, its probability density function is $\frac{1}{5}$ for all points on the interval [0,5] and zero elsewhere. So what we get is the following.

$$= 1- \frac{1}{5}\sum_{i=0}^{2} \int_0^5 \frac{e^{- \lambda}\lambda^i}{i!} d \lambda$$ After performing the above integration and summation, we are left with the following solution: $$P(X \geq 3) = 1- \frac{1}{5} \left( (-e^{-5} + 1) + (1-6e^{-5}) + (2 - 37e^{-5}) \right)$$ $$= 1 + \frac{1}{5} \left( \frac{44}{e^{5}} - 4 \right) \approx 0.259294$$

Expectation:
We know that the sum of expectations is the expectation of sums $$E[X] =\sum_{all ~i} E[X_i]$$ and that the mean of a Poisson random variable is $\lambda$

So in order to find the expected number of packet arrivals, we simply integrate $\lambda$ from 0 to 5 as follows.

$$E[X] = \int_0^5 \lambda ~d \lambda = \left[\frac{\lambda^2}{2} \right]_{\lambda=0}^{\lambda = 5} = \frac{25}{2} = 12.5$$

-
That's a lot of storms, particularly since worst case Poisson is $5$. –  André Nicolas Apr 7 at 4:37
Yea, I didn't think the expectation looked quite right either –  audiFanatic Apr 7 at 4:40
"By independence of events"... Ahem! –  Did Apr 7 at 6:00

The expectation of $X$ is $E(E(X|\Lambda))$. The expectation of $X$ given $\Lambda=\lambda$ is $\lambda$. So we want $$\int_0^5 \lambda\cdot\frac{1}{5}\,d\lambda.$$