Mdm of the Binomial distribution
From Maths
\newcommand{\P}[2][]{\mathbb{P}#1{\left[{#2}\right]} } \newcommand{\Pcond}[3][]{\mathbb{P}#1{\left[{#2}\!\ \middle\vert\!\ {#3}\right]} } \newcommand{\Plcond}[3][]{\Pcond[#1]{#2}{#3} } \newcommand{\Prcond}[3][]{\Pcond[#1]{#2}{#3} }
\newcommand{\E}[1]{ {\mathbb{E}{\left[{#1}\right]} } } \newcommand{\Mdm}[1]{\text{Mdm}{\left({#1}\right) } } \newcommand{\Var}[1]{\text{Var}{\left({#1}\right) } } \newcommand{\ncr}[2]{ \vphantom{C}^{#1}\!C_{#2} }
Statement
Let n\in\mathbb{N}_{\ge 1} and p\in[0,1]\subseteq\mathbb{R} and:
- X\sim\text{Bin} (n,p) - so X is a Binomial random variable
We will calculate the Mdm of X, \E{\big\vert X-\E{X}\big\vert}
Proof
We begin:
- \Mdm{X}:\eq\sum^n_{k\eq 0}{\big\vert k-\E{X}\big\vert\cdot\P{X\eq k} }
- \eq\sum^n_{k\eq 0}\big\vert k-np\big\vert\cdot\ncr{n}{k}\cdot p^k\cdot (1-p)^{n-k} - by substitution of the expectation of the binomial distribution, as well as the expression for probability of X\eq k
We now operate on the \vert\cdot\vert part, there are 2 cases (and we will introduce the \lfloor\cdot\rfloor or "floor function")
- Note that as np\ge 0 we will have \lfloor np\rfloor\le np[Note 1]
Case analysis:
- Suppose k\ge np
- now k-np\ge 0 so by the definition of absolute value (specifically that if x\ge 0 then \vert x\vert\eq x) we see:
- if k\ge np then k-np\ge 0 and if k-np\ge 0 then \vert k-np\vert\eq k-np
- Conclusion: for this case we have \vert k-np\vert\eq k-np
- if k\ge np then k-np\ge 0 and if k-np\ge 0 then \vert k-np\vert\eq k-np
- Note additionally that \lfloor np\rfloor\le np so we have: k\ge np\ge \lfloor np\rfloor \implies k\ge \lfloor np\rfloor
- now k-np\ge 0 so by the definition of absolute value (specifically that if x\ge 0 then \vert x\vert\eq x) we see: