I choose a number from the integers 1,2,…,(2n−1) and the outcome is the random variable N. Calculate E(N) and E(N2).
I then repeat a certain experiment N times, the outcome of the ith experiment being the random variable Xi (1≤i≤N). For each i, the random variable Xi has mean μ and variance σ2, and Xi is independent of Xj for i=j and also independent of N. The random variable Y is defined by Y=∑i=1NXi. Show that E(Y)=nμ and that Cov(Y,N)=31n(n−1)μ. Find Var(Y) in terms of n, σ2 and μ.