A fair coin is flipped independently until the first Heads is observed. Let the random variable K be the number of tosses until the first Heads is observed plus 1. For example, if we see TTTHTH, then K= 5. For k = 1,2,...,K, let Xk be a continuous random variable that is uniform over the interval [0, 5]. The Xkare independent of one another and of the coin flips. Let X=sum(Xk). Find the mean and variance of X.

2 answers

I have already posted this problem before 6 days, and never got any response. Please Help.
Firstly, I assume N=K in your solutions. The expected value and variance of X can be found via Law of Iterated Expectation (LIE) and Law of Total Variance (LTV):

E[X]=E[E[X|K]], var(X)=E[var(X|K)]+var(E[X|K])

For the expectation, your approach is correct, but it can be found via LIE:
E[X|K]=KE[Xk]→E[KE[Xk]]=E[K]E[Xk]
You just need to correct your expectation for K: E[K]=1/p+1, since it is of the form 1+Y, where Y is a geometric RV with parameter p. Also, note that var(K)=var(1+Y)=var(Y)=(1−p)/p2 as yours.

For the variance, we need var(X|K)=var(∑Xk|K)=Kvar(Xk), and by LTV:
var(X)=E[Kvar(Xk)]+var(KE[Xk])=var(Xk)E[K]+E[Xk]2var(K)

Substituting:

E[X] = 15/2
Var[X] = 18.75