I need some help with a homework assignment. The question I'm given is: "Suppose that $X_1, X_2,..., X_n, W$ are independent random variables such that $X_i\sim Bin(1,0.4)$ and $P(W=i)=1/n$ for $i=1, 2 ,.., n$. Let
That is, $Y$ is the sum of $W$ independent Bernoulli random variables. Calculate the mean and variance of $Y$"
Since $Y$ is a sum of Bernoulli random variables it would be a binomial random variable with mean $\mu=np$ and variance $\sigma^2=np(1-p)$, but I'm not sure how to handle this problem when $n$ itself is a random variable.
Can anyone show me how to approach this?