1 min read

Geometric Distribution is the first success occurs on kth Bernoulli trial, Negative Binomial is the rth success occurs on kth Bernoulli trial

The Geometric variable X has a pdf like this: \[P_X(k)=P(X=k)=(1-p)^{k-1}p, \quad k=1,2,3,..\]

The moment-generating function for a Geometric random variable X is: \[\begin{align} M_X(t)=E(e^{tX})&=\sum_{all\ k}e^{tk}(1-p)^{k-1}p\\ &=\frac{p}{1-p}\sum_{all\ k}(e^t(1-p))^{k}\\ &=\frac{p}{1-p}(\frac{1}{1-e^t(1-p)}-1)\\ &=\frac{pe^t}{1-(1-p)e^t} \end{align}\]

The expected value is: \[\begin{align} M_X^{(1)}(t)&=\frac{d}{dt}\frac{pe^t}{1-(1-p)e^t}\\ &=\frac{pe^t}{1-(1-p)e^t}+\frac{pe^t(1-p)e^t}{(1-(1-p)e^t)^2}\Bigl|_{t=0}\\ &=1+\frac{p(1-p)}{p^2}\\ &=\frac{1}{p} \end{align}\]

\[\begin{align} M_X^{(2)}(t)&=\frac{d}{dt}\Bigl(\frac{pe^t}{1-(1-p)e^t}+\frac{pe^t(1-p)e^t}{(1-(1-p)e^t)^2}\Bigr)\\ &=\frac{pe^t}{1-(1-p)e^t}+\frac{pe^t(1-p)e^t}{(1-(1-p)e^t)^2}+\frac{2pe^{2t}(1-p)}{(1-(1-p)e^t)^2}+\frac{2pe^{3t}(1-p)^2}{(1-(1-p)e^t)^3}\Biggl|_{t=0}\\ &=1+(1/p-1)+2(1/p-1)+2(1/p-1)^2\\ &=2/p^2-1/p \end{align}\]

Then, the Variance is:\(Var(X)=E(X^2)-(E(X))^2=2/p^2-1/p-1/p^2=1/p^2-1/p=\frac{1-p}{p^2}\)

Negative Binomial is the rth success occurs on kth Bernoulli trial The Negative Binomial variable Y has a pdf like this: \[P_Y(k)=P(Y=k)=\binom{k-1}{r-1}p^r(1-p)^{k-r}, \quad k=r,r+1,r+2,...\] The moment-generating function for a Geometric random variable X is: \(M_Y(t)=E(e^{tY})=[\frac{pe^t}{1-(1-p)e^t}]^r\)

The expected value is:\(M_Y^{(1)}(t)=\frac{r}{p}\) the Variance is:\(Var(Y)=E(Y^2)-(E(Y))^2=\frac{r(1-p)}{p^2}\)