Determine the mean value and standard deviation with which the elevator operates per load. The number of people $N$ entering an elevator is approximately distributed as a Poisson of
mean $\lambda = 2.3$. On the other hand, the weight $W$ of a person is modeled by
a Gamma distribution with shape and scale parameters, $\alpha = 53$ and $\beta = 1.25$, respectively.
Determine the mean value and standard deviation with which the elevator operates per load.
I'm not sure if the function is defined like $$f(n,w)=\frac{\lambda^ne^{-\lambda n}}{n!}\frac{w^{\alpha -1}e^{\frac{-w}{\beta}}}{\beta^\alpha \Gamma(\alpha)}I_{\{0,1,...\}}(n)I_{\{0<w<\infty\}}(w)$$
Any suggestions would be great!
 A: You're going to want to condition on the number of people who enter the elevator. Let $T$ be the total load of the elevator. Then the mean can be calculated using the tower law of expectation as follows:
$$\mathbb{E}[T] = \sum_{n = 0}^\infty \mathbb{E}[T ~|~ N = n] \cdot \mathbb{P}[N = n] = \sum_{i = 0}^\infty n \cdot \frac \alpha \beta \cdot \mathbb{P}[N = n] = \frac \alpha \beta \sum_{i = 0}^\infty n \cdot \mathbb{P}[N = n] = \frac \alpha \beta \cdot \mathbb{E}[N]$$
Note that $\mathbb{E}[T]$ conditioned on $N = n$ is simply the expected weight per person times $n$, by linearity of expectation. Hence, the expected load is conveniently the product of expectations: $\mathbb{E}[T] = \boxed{\frac \alpha \beta \cdot \lambda}$.
To calculate the variance of $T$, apply the same strategy to calculate $E[T^2]$:
$$\mathbb{E}[T^2] = \sum_{n = 0}^\infty \mathbb{E}[T^2 ~|~ N = n] \cdot \mathbb{P}[N = n]$$
To calculate the conditioned expectation $\mathbb{E}[T^2 ~|~ N = n]$, note that if we have $n$ passengers, then $T \sim T_n$, where
$$T_n \sim W_1 + W_2 + \cdots + W_n$$
where all the $W_i \sim \text{Gamma}(\alpha, \beta)$ are independent and identically distributed. Note that
$$\mathbb{E}[T_n] = n \cdot \mathbb{E}[W_1] = n \cdot \frac{\alpha}{\beta}, ~~ \text{Var}(T_n) = n \cdot \text{Var}(W_1) = n \cdot \frac{\alpha}{\beta^2}$$
And finally we can conclude that
$$\mathbb{E}[T^2_n] = \text{Var}(T_n) + \mathbb{E}[T_n]^2 = \frac{n \alpha (1 + n \alpha)}{\beta^2}$$
Plugging this expression back into the formula for $\mathbb{E}[T^2]$, we have
$$\mathbb{E}[T^2] = \sum_{n = 0}^\infty \frac{n \alpha (1 + n \alpha)}{\beta^2} \cdot \mathbb{P}[N = n] = \frac{\alpha}{\beta^2} \left[\mathbb{E}[N] + \alpha \mathbb{E}[N^2]\right] = \frac{\alpha}{\beta^2} \left[\lambda + \alpha (\lambda^2 + \lambda)\right]
 $$
Hence, the standard deviation is given by
$$\sigma(T) = \sqrt{\mathbb{E}[T^2] - \mathbb{E}[T]^2} = \boxed{\frac{\sqrt{\lambda \alpha(1 + \alpha)}}{\beta}}$$
A: This is sometimes called 'a random sum of random variables'.
A conditioning argument similar to that of @paulinho's
Answer gives
$$E(T) = E(N)E(W) = \lambda\alpha\beta = 152.38$$ and
$$Var(T) = E(N)V(T) + [E(W)]^2V(N) 
= \lambda\alpha\beta^2 + \lambda\alpha^2\beta^2
= \lambda\alpha\beta^2(1+\alpha).$$
Thus, $SD(T) = \beta\sqrt{\lambda\alpha(1+\alpha)} =101.42.$
lam = 2.3;  a = 53;  b = 5/4
mu = lam*a*b;  mu
[1] 152.375

sd = b*sqrt(lam*a*(1+a));  sd
[1] 101.4165

A simulation in R (where rgamma uses the rate, rather than
the scale parameter) approximates the numerical values above
and illustrates that the distribution of $T$ inherits
'lumpiness' from the discreteness of $N.$ With a million
simulated elevator trips, one can expect about three significant
digits of accuracy from the simulation, in good agreement
with the exact values above. In addition, simulation
provides $P(T \le 350) = 0.9609\pm 0.0004.$
set.seed(712)       # for reproducibility
t = replicate(10^6, sum(rgamma(rpois(1,2.3),53,4/5)))
mean(t);  sd(t)
[1] 152.5289        # aprx E(T) = 152.4
[1] 101.3677        # aprx SD(T) = 101.4
mean(t <= 350)   
[1] 0.960886        # aprx P(T <= 350) = .9609 +/- 0.0004
2*sd(t <= 350)/1000
[1] 0.0003877326    # aprx 95% margin of simulation err

hist(t, prob=T, br=25, col="skyblue2")
  abline(v = 350, col="red", lty="dotted")


