Computing MGF for Bernoulli Distribution
The moment generating function (MGF) of a binomial variable 𝑋 with parameters 𝑝 and 𝑛 is defined as:
Computation Steps
Let 𝑋 be a binomial distribution with parameters 𝑝 and 𝑛, where 𝑋 is equal to the sum of 𝑛 Bernoulli variables 𝑌. Thus:
- 𝑋 = 𝛴1≤𝑖≤𝑛𝑌𝑖
Let’s compute the moment generating function (MGF) of 𝑋:
Each 𝐄[𝑒𝑡𝑌] is the moment-generating function of a Bernoulli variable, which is equal to [1 - 𝑝 + 𝑝𝑒𝑡]:
Using the MGF to Compute Moments
Expand ui
Expand ui
Computing Variance(𝑋)
Variance is defined as:
- 𝑉𝑎𝑟(𝑋) = 𝐄[𝑋2] - 𝐄[𝑋]2
Let’s use the MGF of a Bernoulli distribution to calculate the variance of 𝑋:
- 𝑉𝑎𝑟(𝑋) = 𝐄[𝑋2] - 𝐄[𝑋]2
- 𝑉𝑎𝑟(𝑋) = [𝑛2𝑝2 - 𝑛𝑝2 + 𝑛𝑝] - [𝑛𝑝]2 # from above
- 𝑉𝑎𝑟(𝑋) = 𝑛2𝑝2 - 𝑛𝑝2 + 𝑛𝑝 - 𝑛2𝑝2
- 𝑉𝑎𝑟(𝑋) = 𝑛𝑝 - 𝑛𝑝2
- 𝑉𝑎𝑟(𝑋) = 𝑛(𝑝 - 𝑝2)
- 𝑉𝑎𝑟(𝑋) = 𝑛𝑝(1 - 𝑝)