5 Binomial distribution
\[ \require{physics} \require{braket} \]
\[ \newcommand{\dl}[1]{{\hspace{#1mu}\mathrm d}} \newcommand{\me}{{\mathrm e}} \]
\[ \newcommand{\Exp}{\operatorname{E}} \newcommand{\Var}{\operatorname{Var}} \newcommand{\Mode}{\operatorname{mode}} \]
\[ \newcommand{\pdfbinom}{{\tt binom}} \newcommand{\pdfbeta}{{\tt beta}} \newcommand{\pdfpois}{{\tt poisson}} \newcommand{\pdfgamma}{{\tt gamma}} \newcommand{\pdfnormal}{{\tt norm}} \newcommand{\pdfexp}{{\tt expon}} \]
\[ \newcommand{\distbinom}{\operatorname{B}} \newcommand{\distbeta}{\operatorname{Beta}} \newcommand{\distgamma}{\operatorname{Gamma}} \newcommand{\distexp}{\operatorname{Exp}} \newcommand{\distpois}{\operatorname{Poisson}} \newcommand{\distnormal}{\operatorname{\mathcal N}} \]
Let \(\mathcal Y=\set{0,\ldots,n}\).
Definition 5.1 (Binomial distribution) \(Y\in\mathcal Y\) has a binomial distribution with probability \(\theta\), denoted by \(Y\sim\distbinom(n, \theta)\), if \[ \Pr(y\mid\theta)=\Pr\qty(Y=y\mid \theta)=\pdfbinom(y,n,\theta)=\dbinom{n}{y}\theta^y(1-\theta)^{n-y}. \]
5.1 Expected values
Theorem 5.1 Let \(Y\sim\distbinom(n,\theta)\). Then \[ \Exp\qty(Y)=n\theta. \]
\[ \begin{split} \Exp\qty(Y)&=\sum_{y=0}^n\dbinom{n}{y}y\theta^y(1-\theta)^{n-y}\\ &=\sum_{y=0}^n\frac{n!}{y!(n-y)!}y\theta^y(1-\theta)^{n-y}\\ &=\sum_{y=1}^n\frac{n(n-1)!}{y(y-1)!(n-y)!}y\theta^{1+(y-1)}(1-\theta)^{n-y}\\ &=\sum_{y=1}^nn\theta\frac{(n-1)!}{(y-1)!\qty((n-1)-(y-1))!}\theta^{y-1}(1-\theta)^{(n-1)-(y-1)}\\ &=\sum_{y=0}^{n-1}n\theta\frac{(n-1)!}{y!(n-1-y)!}\theta^{y}(1-\theta)^{(n-1)-y}\\ &=n\theta\sum_{y=0}^{n-1}\dbinom{n-1}{y}\theta^y(1-\theta)^{n-1-y}\\ &=n\theta(\theta+1-\theta)^{n-1}\\ &=n\theta. \end{split} \]
5.2 Variance
dd