Since Xj is Poisson with mean 3, E(Xj) = Var(Xj) = 3, for 1 <= j <= n.
Since P(N=n) = 1/2^n = (1/2)(1 - 1/2)^(n-1), n = 1,2,..., we recognize N as a geometric random variable with success probability p = 1/2.
So E(N) = 1/p = 1/(1/2) = 2; Var(N) = (1 - p)/p^2 = (1 - 1/2)/(1/2)^2 = 2.
E(S) = E(E(S|N))
= E(E(Summation of Xj from 1 to N|N))
= E(Summation from 1 to N of E(Xj)) since Xj's are independent of N
= E(3N)
= 3E(N)
= 3(2)
= 6.
Var(S) = Var(E(S|N)) + E(Var(S|N))
= Var(E(Summation of Xj from 1 to N|N)) + E(Var(Summation of Xj from 1 to N|N))
= Var(E(Summation of Xj from 1 to N)) + E(Var(Summation of Xj from 1 to N)), since the Xj's are independent of N
= Var(Summation from 1 to N of E(Xj)) + E(Summation from 1 to N of Var(Xj)), since the assumption that Xj's are independent justifies replacing the variance of the sum of Xj's by the sum of the variances of the Xj's
= Var(3N) + E(3N)
= 3^2 Var(N) + 3E(N)
= 9(2) + 3(2)
= 24.
Lord bless you today!