Question 19416
  Problem 1: suppose that X has a moment generation function m(t)=(.25 + .75e^t)^12. find P(X>4). 

 Comment 1: Never write any function as {{{.25 + .75e^t}}}, should be
 m(t) = {{{0.25 + 0.75*e^t}}}
  2.Yes, M(0) = 1, M'(0) = E(X) and M"(0) = {{{E(X^2)}}}
   But no differentiation is necessary for solving the pdf P.
  3. The point is to know the the MGF of the binomial function B(x,n;p) 
is (q + p e^t)^n, where q = 1-p. 
[ Since M(t) = {{{SIGMA}}} {{{e^xt*C(n,x)*p^x*q^(n-x)}}} =  {{{SIGMA}}} {{{C(n,x)*(pe^t)^x q^(n-x) }}}
 = {{{(q+pe^t)^n }}}.
 Here, for given m(t) = {{{(0.25 + 0.75e^t)^12}}}, p=0.75 and
the corresponding binomial distribution B(x,n;p) is B(x,12,0.75).
Hence, P(X > 4) = 1 - {{{SIGMA}}} B(x,12,0.75) (x = 0,1,2,3)
 = {{{1 - (0.25^12 + C(12,1)0.75*(0.25)^11 + C(12,2)0.75^2*(0.25)^10 + C(12,3)0.75^3*(0.25)^9) }}} 
= 0.999608
= 1- BINOMDIST(3,12,0.75,TRUE) (by using Excel)

 The next one is difficult for beginners because it should use very high level
 formulas in algebra and combinatorials. 


 Problem 2: Henry is going to keep rolling a die until he obtains four different values. What is the expected number of rolls that he will need?

  Sol: 1) Let the corresponding random variable be X.
Of course, we need to compute the pdf of X ,P(X= n), if {{{n>= 4 }}} first. 
 [Note: P(X= k) = 0 if k <=3]

Note when Henry succeeds (the 4th number) at the nth trial, that means he got exactly 3 distinct numbers in the previous n-1 trials. That is, the same as we consider the sum of all coefficients of the terms of three variables as 
{{{x^i* y^j* z^k}}}  (i,j,k>=1) in the polynomial {{{(x+y+z+w+u+v)^(n-1)}}}.

Since there are C(6,3)=20 such triples as xyz in {{{(x+y+z+w+u+v)^(n-1)}}} , and there are {{{3^k – 3 – 3(2^k-2)  }}} (why?)
= {{{3^k - 3*2^k + 3 }}} terms of 3 variables in (x+y+z)^k. 
Hence, there are {{{20(3^(n-1)- 3*2^(n-1) + 3)}}} terms of 3 variables
(as xyz, yzw,..) in {{{ (x+y+z+w+u+v)^(n-1) }}}. 

That is among the possible {{{6^(n-1)}}} outcomes of first (n-1) rollings, there are {{{20(3^(n-1)- 3*2^(n-1) + 3)}}} possible appearance of 3 different values. 

To be successful(i.e. to make 4 different values), the n th rolling must be one of the remaining 3 numbers. Thus the probability of success at the nth trial is 
P(X=n) = {{{60(3^(n-1)- 3*2^(n-1) + 3)/6^n}}} for {{{n>= 4}}} 
For example, P(X=4) = {{{6*5*4*3/6^4 = 10/6^2}}}, 
P(X=5) = {{{ 60(3^4 - 3*2^4 + 3)/6^5 = 10/6^2 }}}, 
P(X=6) = {{{60(3^5 - 3*2^5 + 3)/6^6 = 250/6^4 }}}. 

[P must be a pdf, checking , {{{SIGMA}}} P(X=n) = 20* {{{SIGMA }}} {{{(1/2)^n}}} - 90*{{{SIGMA}}} {{{(1/3)^n}}} + 180* {{{SIGMA}}} {{{1/6^n }}} {{{n>= 4 }}}
      = {{{ 20* (1/16)/(1-(1/2)) -90* (1/81)/(1-(1/3))
 +180 *(1/6)^4 /(1-(1/6))  }}}
= {{{5/4- (10/9)*(3/2)- 180*(6/5)/(36*36) = 5/2 - 5/3 +1/6 = 5/6+1/6 = 1 }}}
 ... Correct for a well-defined pdf.]

Therefore, E(X) =  {{{SIGMA}}} {{{60*n*(3^(n-1)- 3*2^(n-1) + 3)/6^n  }}}
= {{{20 *SIGMA}}} {{{n*(1/2)^n}}} - {{{90* SIGMA}}}n(1/3)^n + {{{180*SIGMA}}}n/6^n }}} {{{n >=4 }}}
[Note: {{{SIGMA}}} {{{n*r^n }}}=  {{{r*SIGMA}}}{{{n*r^(n-1)}}} = {{{r*SIGMA}}} ({{{r^n)}}})' = r({{{(1/(1-r))}}})'  = {{{r/(1-r)^2}}} - {{{r(1+2r+3r^2)}}} for {{{n >=4 }}}
We obtain E(X) = 20 {{{SIGMA}}}{{{n*(1/2)^n}}} - 90 {{{SIGMA}}} {{{n(1/3)^n}}} + 180 {{{SIGMA}}} {{{n/6^n }}}
= {{{(20/2) *( 4 - (1+1+3/4)) - (90/3) *( 9/4 -(1 + 2/3+ 1/3)) + (180/6)( 36/25 -(1+1/3+1/12))}}}
= {{{ 10*(4- 11/4) - 30*(9/4 - 2) + 30*(36/25 - 17/12) }}}
= 5.7 

 Good luck !!

 Kenny
 
 PS 1: I have doubly checked that the answer should be correct.
    2. Don't feel bad that you could not do Problem2, but it is a good
       exercise for prob. Try to read and understand the above details.
    3. You posted these questions in wrong place. I am sure almost nobody 
      knows what you asked about here.    
    4. To answer Problem 2, you can write
       Let the random variable be X.       
      (i)Since the the sum of all coefficients of the terms of three variables 
        in in the polynomial {{{(x+y+z+w+u+v)^(n-1)}}} is 
        {{{20(3^(n-1)- 3*2^(n-1) + 3)}}}
      (ii) For {{{n>=4}}}, P(X =n) = {{{60(3^(n-1)- 3*2^(n-1) + 3)/6^n}}}
      (iii) E(X) =  {{{SIGMA}}} {{{60*n*(3^(n-1)- 3*2^(n-1) + 3)/6^n  }}}
                 = 5.7
          [Using {{{SIGMA}}} {{{n*r^n }}}={{{r/(1-r)^2}}} - {{{r(1+2r+3r^2)}}}
           for {{{n>=4}}} ]