2. Calculate the expected value and variance of the binomial distribution using the moment generating function.
Sol) For binomial distribution, P(X=k)=(n k).pk.qn−k, where q=1−p.
Expected value and variance are two main moments of the distribution.
Expected value is also known as mean.
From the textbook: g(t) = ∑limit(j=0,n) (nj)(pe^t) ^j .q^n−j
Moment generating function : g(t)=(pet+q)n
For first moment: g′(t) =n(pet+q)n−1pet
For secong moment: g′′(t)=n(n−1)(pet+q)(pe^t)2+n(pet+q)npet
At t = 0 : g′(0) =n.(p+q)^n−1.p
g′′(0)=n(n−1)(p+q)n−1p2+n(p+q)np
=n(n−1)p2+np
Expected value is also known as mean :
μ=μ1=g′(0)=np {since p=q-1,p+q =1}
Variance :
σ2=μ2−μ1^2
=g′′(0)−[g′(0)]^2
σ2=n(n−1)p2+np−(np)2
σ2=np[(n−1)p+1−np]
σ2=np[(np−p)+1−np]
σ2=np[1−p]=npq
Finally we arrived at the known definitions for binomial distribution :- E(X)=np and V(X)=npq.
3. Calculate the expected value and variance of the exponential distribution using the moment generating function.
Sol) For exponential distribution, f(x)=λe^−λx.
Moment generating function :g(t)=∫limit(∞,0)etx.λ.e−λxdx
g(t)=λe^(t−λ)x/t−λ|∞0
g(t)=λ/λ−t
For first moment : g′(t)=λ/(λ−t)2
At t=0 : g′(0)=λ/λ2
Expected value : μ = g′(0)=1/λ.
For second moment :g′′(t)=2λ/(λ−t)^3
At t=0 : g′′(0)=2λ/λ^3
Variance : σ2 =g′′(0)−g′(0)2
=2/λ2−1/λ2
=1/λ^2.
We arrived at the known definitions for Exponential distribution :- E(X)=1/λ and V(X)=1/λ2.