Computing MGF for Bernoulli Distribution
The moment generating function (MGF) of a Bernoulli variable 𝑋 with parameter 𝑝 is defined as:
- 𝑀𝑋(𝑡) = 1-𝑝 + 𝑒𝑡𝑝
Computation Steps
Let 𝑋 be a Bernoulli distribution with parameter 𝑝. Thus:
- 𝑃(𝑋=1) = 𝑝
- 𝑃(𝑋=0) = 1-𝑝
Let’s compute the moment generating function (MGF) of 𝑋:
- 𝑀𝑋(𝑡) = 𝐄[𝑒𝑡𝑋]
- 𝑀𝑋(𝑡) = 𝛴𝑥∊𝑋[𝑒𝑡𝑥·𝑃(𝑋=𝑥)]
- 𝑀𝑋(𝑡) = 𝑒𝑡0·𝑃(𝑋=0) + 𝑒𝑡1·𝑃(𝑋=1)
- 𝑀𝑋(𝑡) = 𝑃(𝑋=0) + 𝑒𝑡·𝑃(𝑋=1)
- 𝑀𝑋(𝑡) = 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 # from above
- 𝑉𝑎𝑟(𝑋) = 𝑝(1-𝑝)