Define X as the following random variable X={1,p=14HHH or TTT0,p=34otherwise

  1. K is simply a binomial distribution, where we want the 2nd success to happen at the K+1th trial. pK(k)=(k1)14234k1since the last trial is success

  2. M = number of tails before first success. Let the success be at N+1. Defin Y as Y={1p=12HHTHTH, or THH2p=12HTTTHT, or TTHE[Y]=1×12+2×12Var(Y)=(132)2×12+(232)2×12E[N+1]=1p=4Var(N+1)=Var(N)=1pp2=114142M=Y1+Y2+YNE[M]=E[Y1+Y2+YN]Var(M)=Var(Y1+Y2+YN) Note that both Y and N are random variables here. Using the formulae for random number of random variables, E[M]=E[E[M|N]]=E[NE[Y]]=E[N]E[Y]=(41)×32=92Var(M)=Var(E[M|N])+E[Var(M|N)]=Var(NE[Y])+E[NVar(Y)]=E[Y]2Var(N)+E[N]Var(Y)=94×12+3×14=1114