Mean & Variance — Detailed Derivations

Uniform (continuous) shows full integral work. Binomial, Geometric, Negative Binomial, and Poisson show full summation/series steps. Use the toggles to expand each derivation.

Uniform [a,b]
Binomial (n,p)
Geometric (p)
Negative Binomial (r,p)
Poisson (λ)

Geometric(p) — Detailed Derivations (failures before 1st success)

Definition used here: \(X\in\{0,1,2,\dots\}\) counts failures before the first success in i.i.d. Bernoulli(p) trials.
PMF: \(\displaystyle P(X=k)=(1-p)^k\,p,\; k=0,1,2,\dots\). Let \(q=1-p\).

Step 1 — Series Tools You Need

Step 2 — Mean \(E[X]\)

\(\displaystyle E[X]=\sum_{k=0}^{\infty} k\,P(X=k)=\sum_{k=0}^{\infty} k\,q^{k}p = p\sum_{k=0}^{\infty} k q^{k}.\)
Using \(\sum k r^{k}=\dfrac{r}{(1-r)^2}\) with \(r=q\):
\(\displaystyle E[X]= p\cdot \frac{q}{(1-q)^2}= p\cdot \frac{q}{p^2}=\frac{q}{p}=\frac{1-p}{p}.\)
\(\boxed{\;E[X]=\dfrac{1-p}{p}\;}\)

Step 3 — Second Moment \(E[X^2]\)

\(\displaystyle E[X^{2}] = \sum_{k=0}^{\infty} k^{2} P(X=k) = p\sum_{k=0}^{\infty} k^{2} q^{k}.\)
Using \(\sum k^{2} r^{k}=\dfrac{r(1+r)}{(1-r)^3}\) with \(r=q\):
\(\displaystyle E[X^{2}] = p\cdot \frac{q(1+q)}{(1-q)^{3}} = p\cdot \frac{q(1+q)}{p^{3}} = \frac{q(1+q)}{p^{2}}.\)

Step 4 — Variance and Standard Deviation

\(Var(X)=E[X^{2}]-(E[X])^{2} = \dfrac{q(1+q)}{p^{2}} - \left(\dfrac{q}{p}\right)^{2} = \dfrac{q}{p^{2}}.\)
\(\boxed{\;Var(X)=\dfrac{1-p}{p^{2}}\;}\)
Standard deviation: \(\displaystyle \sigma = \sqrt{\dfrac{1-p}{p^{2}}} = \dfrac{\sqrt{1-p}}{p}.\)

Step 5 — Alternative Parameterization (trials to first success)

Intuition: When \(p\) is small, the expected number of failures before a success grows like \(1/p\) and variability is large (order \(1/p^{2}\)).
Tip for students: After reading the derivations here, go back to your Excel N=10 simulations and check how your sample mean/variance compare to these results.