Difference between revisions of "Mdm of the Binomial distribution"
From Maths
(Saving work for restart) |
(Saving work) |
||
Line 6: | Line 6: | ||
==Proof== | ==Proof== | ||
− | * {{ | + | We begin: |
+ | * {{MM|\Mdm{X}:\eq\sum^n_{k\eq 0}{\big\vert k-\E{X}\big\vert\cdot\P{X\eq k} } }} | ||
+ | *: {{MM|\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 {{M|X\eq k}} | ||
+ | |||
+ | We now operate on the {{link|abs|function}} part, there are 2 cases (and we will introduce the [[floor (function)|{{M|\lfloor\cdot\rfloor}}]] or "''[[floor function]]''") | ||
+ | * Note that as {{M|np\ge 0}} we will have {{M|\lfloor np\rfloor\le np}}<ref group="Note">Defining {{link|floor|function}} for negative values can be "controversial"</ref> | ||
+ | Case analysis: | ||
+ | # Suppose {{M|k\ge np}} | ||
+ | #* now {{M|k-np\ge 0}} so by the definition of [[absolute value]] (specifically that if {{M|x\ge 0}} then {{M|\vert x\vert\eq x}}) we see: | ||
+ | #** if {{M|k\ge np}} then {{M|k-np\ge 0}} and if {{M|k-np\ge 0}} then {{M|\vert k-np\vert\eq k-np}} | ||
+ | #*** Conclusion: for this case we have {{M|\vert k-np\vert\eq k-np}} | ||
+ | #* Note additionally that {{M|\lfloor np\rfloor\le np}} so we have: {{M|k\ge np\ge \lfloor np\rfloor}} {{link|implies}} {{M|k\ge \lfloor np\rfloor}} | ||
+ | ==Notes== | ||
+ | <references group="Note"/> |
Latest revision as of 01:32, 12 January 2018
\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: