Difference between revisions of "Expectation of the geometric distribution"

From Maths
Jump to: navigation, search
(Saving work)
 
(Finishing proof, there's case extension to be done as there's no reason it can't cover p in [0,1) for case 2, rather than just (0,1) as it does now)
 
Line 1: Line 1:
 
{{Stub page|grade=A|msg=Finish in morning}}
 
{{Stub page|grade=A|msg=Finish in morning}}
{{ProbMacros}}
+
{{ProbMacros}}{{M|\newcommand{\d}[0]{\mathrm{d} } }}
 
__TOC__
 
__TOC__
 
==Statement==
 
==Statement==
Line 33: Line 33:
 
We now consider the {{M|S'_n}} terms:
 
We now consider the {{M|S'_n}} terms:
 
* {{MM|S'_n\eq pS_n\eq p\left(\sum^n_{k\eq 1}kq^{k-1}\right)}} - {{0^0}} comes up here
 
* {{MM|S'_n\eq pS_n\eq p\left(\sum^n_{k\eq 1}kq^{k-1}\right)}} - {{0^0}} comes up here
===Case 2: {{M|p\in (0,1)\subseteq\mathbb{R} }}===
+
===Case 2: {{M|p\in (0,1)\subseteq\mathbb{R} }} - {{XXX|EXTENSION}}===
Here we use:
+
: {{XXX|This case can be extended to {{M|p\in (0,1]}} and should be}} as there's no reason we can't cope with the {{M|q\eq 0}} case - {{XXX|SORT THIS OUT}}
* {{MM|\frac{\mathrm{d} }{\mathrm{d}q}\Big[q^k\Big]\Bigg\vert_q\eq kq^{k-1} }} and then the {{MM|\sum^n_{k\eq 1}q^k}} is a [[geometric series]] - starting at {{M|q}} though not {{M|1}}
+
'''[[Lemmas|Lemmas used]]:'''
 +
# {{MM|\frac{\mathrm{d} }{\mathrm{d}q}\Big[q^k\Big]\Bigg\vert_q\eq kq^{k-1} }} which is the first result covered in [[differentiation]]<ref group="Note">I'd really like to link to something here so {{XXX|Link to the actual result!}}</ref>
 +
# {{MM|\sum^n_{k\eq 1}r^{k-1}\eq \frac{1-r^n}{1-r} }} (from the result on the ''[[geometric series]]'' page), and,
 +
#* Note that {{MM|\sum_{k\eq 1}^nr^k\eq r\sum^n_{k\eq 1}r^{k-1} }} so we will really use:
 +
#** {{MM|\sum^n_{k\eq 1}r^k\eq r\frac{1-r^n}{1-r} }}
 +
 
 +
 
 +
'''Proof:'''
 +
* Let {{M|p\in}}[[open interval|{{M|(0,1)}}]]{{M|\subseteq}}[[Reals|{{M|\mathbb{R} }}]] be given, and let {{M|X\sim}}[[Geometric distribution|{{M|\text{Geo} }}]]{{M|(p)}} so {{M|\P{X\eq k}:\eq (1-p)^{k-1}p}} for {{M|k\in\mathbb{N}_{\ge 1} }}, now:
 +
** {{MM|\E{X}:\eq\sum^\infty_{k\eq 1}k\cdot\P{X\eq k}\eq \sum^\infty_{k\eq 1}k(1-p)^{k-1}p\eq p\sum^\infty_{k\eq 1}kq^{k-1} }} where we have substituted {{M|q^{k-1} }} for {{M|(1-p)^{k-1} }} at the end there.
 +
*** We use the first lemma described above to observe that {{MM|kq^{k-1}\eq\frac{\d }{\d q}\Big[q^k\Big]\Big\vert_q}}, thus:
 +
**** {{MM|\E{X}\eq p\sum^\infty_{k\eq 1}\frac{\d}{\d q}\Big[q^k\Big]\Big\vert_q}}
 +
****: {{MM|\eq p\cdot\left(\frac{\d}{\d q}\left[\sum^\infty_{k\eq 1}q^k\middle]\right\vert_q\right)}}<ref group="Note" name="CalculusSum"/>
 +
** We now work on the expression: {{MM|\sum^\infty_{k\eq 1}q^k}}, taking it as {{MM|\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}q^k\right) }} and operate on the {{MM|\sum^n_{k\eq 1}q^k}} first
 +
*** By the ''second lemma'' above:
 +
**** {{MM|\sum^n_{k\eq 1}q^k\eq q\frac{1-q^n}{1-q} }}
 +
****: {{MM|\eq \frac{q}{1-q}\cdot(1-q^n) }}
 +
*** Now we consider {{MM|\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}q^k\right) }},
 +
**** {{MM|\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}q^k\right) \eq \lim_{n\rightarrow\infty}\left(\frac{q}{1-q}\cdot(1-q^n) \right) }}
 +
****: {{MM|\eq\frac{q}{1-q}\cdot\lim_{n\rightarrow\infty}\Big((1-q^n)\Big) }}
 +
**** Let us operate on the {{MM|\lim_{n\rightarrow\infty}\Big((1-q^n)\Big) }} now
 +
***** We have three cases, {{M|q\eq 0}}, {{M|q\in(0,1)}} and {{M|q\eq 1}} - {{Notice|But as we are explicitly in the {{M|q\in(0,1)}} case we don't need to consider them really, we do so for demonstration purposes only}}
 +
****: All of these are applications of [[limit of integer powers of a real value]]
 +
****:# {{M|q\eq 0}} then obviously {{M|0^n}} for {{M|n\in\mathbb{N}_{\ge 1} }} is always {{M|0}} (with [[0^0|{{M|0^0}}]] "disputed" but not relevant here) so
 +
****:#* {{M|\lim_{n\rightarrow\infty}(1-q^n)\eq 1-0\eq 1}}
 +
****:# {{M|q\in(0,1)}} then {{M|q^n}} gets smaller as {{M|n}} increases so {{M|q^n\rightarrow 0}} so {{M|1-q^n\rightarrow 1}}, thus
 +
****:#* {{M|\lim_{n\rightarrow\infty}(1-q^n)\eq 1-0\eq 1}} also
 +
****:# {{M|q\eq 1}} then {{M|q^n\eq 1}} always so
 +
****:#* {{M|\lim_{n\rightarrow\infty}(1-q^n)\eq 1-1\eq 0}}
 +
***** So we see that {{M|q\in [0,1) }}<ref group="Note">I'm extending the range slightly but as {{M|(0,1)\subseteq [0,1)}} we're fine to do so</ref> means that {{M|\lim_{n\rightarrow\infty}(1-q^n)\eq 1}}
 +
**** Substituting our findings we see for the relevant range of this case that:
 +
***** {{MM|\frac{q}{1-q}\cdot\lim_{n\rightarrow\infty}\Big((1-q^n)\Big) \eq \frac{q}{1-q} }}
 +
**** Thus:
 +
***** {{MM|\sum^\infty_{k\eq 1}q^k:\eq \lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}q^k\right) \eq \frac{q}{1-q} }}
 +
** We combine this into our expression for {{M|\E{X} }}:
 +
*** {{MM|\E{X}\eq p\cdot\left(\frac{\d}{\d q}\left[\sum^\infty_{k\eq 1}q^k\middle]\right\vert_q\right)}}
 +
***: {{MM|\eq p\cdot\frac{\d}{\d q}\left[\frac{q}{1-q}\middle]\right\vert_q}}
 +
*** We now operate on {{M|\frac{\d}{\d q}\big[q\cdot (1-q)^{-1}\big]\big\vert_q }} and - as writing it this way implies - will use the [[product rule]]:
 +
**** {{MM|\frac{\d}{\d q}\Big[q\cdot (1-q)^{-1}\Big]\Big\vert_q \eq q\frac{\d}{\d q}\left[(1-q)^{-1}\middle]\right\vert_q+\frac{1}{1-q}\frac{\d}{\d q}\left[q\right]\Big\vert_q}}
 +
****: {{MM|\eq\frac{-q}{(1-q)^2}\cdot\frac{\d}{\d q}\Big[(1-q)\Big]\Big\vert_q +\frac{1}{1-q} }} - notice the [[chain rule|chain ruling]] being applied here
 +
****: {{MM|\eq\frac{-q}{(1-q)^2}(-1) +\frac{1}{1-q} }}
 +
****: {{MM|\eq \frac{1}{1-q}\left(1+\frac{q}{1-q}\right) }}
 +
****: {{MM|\eq \frac{1}{1-q}\left(\frac{1-q}{1-q}+\frac{q}{1-q}\right) }}
 +
****: {{MM|\eq \frac{1}{1-q}\left(\frac{1}{1-q}\right) }}
 +
****: {{MM|\eq\frac{1}{(1-q)^2} }} or {{M|\eq (1-q)^{-2} }}
 +
**** Finally: {{MM|\frac{\d}{\d q}\big[q\cdot (1-q)^{-1}\big]\big\vert_q \eq \frac{1}{(1-q)^2} }}
 +
***** So now we have: {{MM|\E{X} \eq p\cdot\frac{\d}{\d q}\left[\frac{q}{1-q}\middle]\right\vert_q\eq p\frac{1}{(1-q)^2} }}
 +
*** Lastly we operate on {{MM|\E{X}\eq p\frac{1}{(1-q)^2} }}
 +
**** Recall that {{M|q:\eq 1-p}} so {{M|1-q\eq 1-(1-p)\eq 1-1+p\eq p}} - we have {{M|1-q\eq p}} now, substitute this in and we see:
 +
***** {{MM|\E{X}\eq p\frac{1}{p^2} }}
 +
*****: {{MM|\eq \frac{1}{p} }}
 +
** So we have {{MM|\E{X}\eq \frac{1}{p} }} given our value of {{M|p}}
 +
* Since our choice of {{M|p\in(0,1)}} was arbitrary we have shown:
 +
** {{MM|\forall p\in(0,1)\left[\E{\text{Geo}(p)}\eq\frac{1}{p}\right] }} - as required
 
==Notes==
 
==Notes==
<references group="Note"/>
+
<references group="Note">
{{Theorem Of|Probability|Elementary Probability|Statistics}}[[Category:Variance Calculations]]
+
<ref group="Note" name="CalculusSum">Remember {{MM|\sum^\infty_{k\eq 1}a_k}} is just short hand for {{MM|\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}a_k\right)}} - see [[limits]] and [[limit of a series]] - and remember that {{MM|\frac{\d}{\d x}\Big[f(x)\Big]\Big\vert_x+\frac{\d}{\d x}\Big[g(x)\Big]\Big\vert_x\eq\frac{\d}{\d x}\Big[f(x)+g(x)\Big]\Big\vert_x}} - as per [[linearity of the derivative]].
 +
* {{XXX|More links?}}</ref>
 +
</references>
 +
{{Theorem Of|Probability|Elementary Probability|Statistics}}[[Category:Expectation Calculations]]

Latest revision as of 02:55, 16 January 2018

Stub grade: A
This page is a stub
This page is a stub, so it contains little or minimal information and is on a to-do list for being expanded.The message provided is:
Finish in morning
[ilmath]\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} }[/ilmath]
[ilmath]\newcommand{\E}[1]{ {\mathbb{E}{\left[{#1}\right]} } } [/ilmath][ilmath]\newcommand{\Mdm}[1]{\text{Mdm}{\left({#1}\right) } } [/ilmath][ilmath]\newcommand{\Var}[1]{\text{Var}{\left({#1}\right) } } [/ilmath][ilmath]\newcommand{\ncr}[2]{ \vphantom{C}^{#1}\!C_{#2} } [/ilmath][ilmath]\newcommand{\d}[0]{\mathrm{d} } [/ilmath]

Statement

Let [ilmath]X\sim[/ilmath][ilmath]\text{Geo} [/ilmath][ilmath](p)[/ilmath] where [ilmath]p[/ilmath] is the probability of any trial being a success, and each trial is i.i.d as [ilmath]X_i\sim[/ilmath][ilmath]\text{Borv} [/ilmath][ilmath](p)[/ilmath], from this we have:

  • For [ilmath]k\in\mathbb{N}_{\ge 1} [/ilmath] that [ilmath]\P{X\eq k}\eq p(1-p)^{k-1} [/ilmath]

We now define [ilmath]q:\eq 1-p[/ilmath] as this will simplify calculations further on, meaning that now:

  • For [ilmath]k\in\mathbb{N}_{\ge 1} [/ilmath] that [ilmath]\P{X\eq k}\eq pq^{k-1} [/ilmath]


Expectation

  • The expectation of [ilmath]X[/ilmath] is:
    • [math]\sum^\infty_{k\eq 1}k\P{X\eq k} [/math] which of course is actually a limit of a series, [math]\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}k\P{X\eq k}\right)[/math]
We claim that that [ilmath]\E{X}\eq\frac{1}{p} [/ilmath] for [ilmath]p\in[/ilmath][ilmath](0,1][/ilmath][ilmath]\subseteq\mathbb{R} [/ilmath] and undefined for [ilmath]p\eq 0[/ilmath]


To do so we will consider the 3 cases, [ilmath]p\eq 0[/ilmath], [ilmath]p\in (0,1)\subseteq\mathbb{R} [/ilmath] and [ilmath]p\eq 1[/ilmath] separately and in reverse of this order.

See also

Proof

We introduce the following for short.

  1. [math]S'_n:\eq\sum^n_{k\eq 1}kpq^{k-1} [/math] - this forms the sequence used in the limit - which is a series.
    • Thus [math]\E{X}\eq\lim_{n\rightarrow\infty}\Big(S'_n\Big)[/math]
  2. [math]S_n:\eq\sum^n_{k\eq 1}kq^{k-1} [/math]
    • This comes from the sequence inside the limit, [math]\sum^n_{k\eq 1}k\P{X\eq k}\eq\sum^n_{k\eq 1}kpq^{k-1}\eq p\sum^n_{k\eq 1} kq^{k-1} \eq pS_n[/math], so:
      • [math]\E{X}\eq\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}k\P{X\eq k}\right)\eq\lim_{n\rightarrow\infty}\Big(pS_n\Big)[/math]

Notice that [ilmath]S'_n\eq pS_n[/ilmath] - introduced purely to save typing.

Case 1: [ilmath]p\eq 1[/ilmath]

Notice that in this case, [ilmath]q\eq 1-p\eq 0[/ilmath].

We now consider the [ilmath]S'_n[/ilmath] terms:

  • [math]S'_n\eq pS_n\eq p\left(\sum^n_{k\eq 1}kq^{k-1}\right)[/math] - [ilmath]0^0[/ilmath] comes up here

Case 2: [ilmath]p\in (0,1)\subseteq\mathbb{R} [/ilmath] -
TODO: EXTENSION

TODO: This case can be extended to [ilmath]p\in (0,1][/ilmath] and should be
as there's no reason we can't cope with the [ilmath]q\eq 0[/ilmath] case -
TODO: SORT THIS OUT

Lemmas used:

  1. [math]\frac{\mathrm{d} }{\mathrm{d}q}\Big[q^k\Big]\Bigg\vert_q\eq kq^{k-1} [/math] which is the first result covered in differentiation[Note 1]
  2. [math]\sum^n_{k\eq 1}r^{k-1}\eq \frac{1-r^n}{1-r} [/math] (from the result on the geometric series page), and,
    • Note that [math]\sum_{k\eq 1}^nr^k\eq r\sum^n_{k\eq 1}r^{k-1} [/math] so we will really use:
      • [math]\sum^n_{k\eq 1}r^k\eq r\frac{1-r^n}{1-r} [/math]


Proof:

  • Let [ilmath]p\in[/ilmath][ilmath](0,1)[/ilmath][ilmath]\subseteq[/ilmath][ilmath]\mathbb{R} [/ilmath] be given, and let [ilmath]X\sim[/ilmath][ilmath]\text{Geo} [/ilmath][ilmath](p)[/ilmath] so [ilmath]\P{X\eq k}:\eq (1-p)^{k-1}p[/ilmath] for [ilmath]k\in\mathbb{N}_{\ge 1} [/ilmath], now:
    • [math]\E{X}:\eq\sum^\infty_{k\eq 1}k\cdot\P{X\eq k}\eq \sum^\infty_{k\eq 1}k(1-p)^{k-1}p\eq p\sum^\infty_{k\eq 1}kq^{k-1} [/math] where we have substituted [ilmath]q^{k-1} [/ilmath] for [ilmath](1-p)^{k-1} [/ilmath] at the end there.
      • We use the first lemma described above to observe that [math]kq^{k-1}\eq\frac{\d }{\d q}\Big[q^k\Big]\Big\vert_q[/math], thus:
        • [math]\E{X}\eq p\sum^\infty_{k\eq 1}\frac{\d}{\d q}\Big[q^k\Big]\Big\vert_q[/math]
          [math]\eq p\cdot\left(\frac{\d}{\d q}\left[\sum^\infty_{k\eq 1}q^k\middle]\right\vert_q\right)[/math][Note 2]
    • We now work on the expression: [math]\sum^\infty_{k\eq 1}q^k[/math], taking it as [math]\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}q^k\right) [/math] and operate on the [math]\sum^n_{k\eq 1}q^k[/math] first
      • By the second lemma above:
        • [math]\sum^n_{k\eq 1}q^k\eq q\frac{1-q^n}{1-q} [/math]
          [math]\eq \frac{q}{1-q}\cdot(1-q^n) [/math]
      • Now we consider [math]\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}q^k\right) [/math],
        • [math]\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}q^k\right) \eq \lim_{n\rightarrow\infty}\left(\frac{q}{1-q}\cdot(1-q^n) \right) [/math]
          [math]\eq\frac{q}{1-q}\cdot\lim_{n\rightarrow\infty}\Big((1-q^n)\Big) [/math]
        • Let us operate on the [math]\lim_{n\rightarrow\infty}\Big((1-q^n)\Big) [/math] now
          • We have three cases, [ilmath]q\eq 0[/ilmath], [ilmath]q\in(0,1)[/ilmath] and [ilmath]q\eq 1[/ilmath] - But as we are explicitly in the [ilmath]q\in(0,1)[/ilmath] case we don't need to consider them really, we do so for demonstration purposes only
          All of these are applications of limit of integer powers of a real value
          1. [ilmath]q\eq 0[/ilmath] then obviously [ilmath]0^n[/ilmath] for [ilmath]n\in\mathbb{N}_{\ge 1} [/ilmath] is always [ilmath]0[/ilmath] (with [ilmath]0^0[/ilmath] "disputed" but not relevant here) so
            • [ilmath]\lim_{n\rightarrow\infty}(1-q^n)\eq 1-0\eq 1[/ilmath]
          2. [ilmath]q\in(0,1)[/ilmath] then [ilmath]q^n[/ilmath] gets smaller as [ilmath]n[/ilmath] increases so [ilmath]q^n\rightarrow 0[/ilmath] so [ilmath]1-q^n\rightarrow 1[/ilmath], thus
            • [ilmath]\lim_{n\rightarrow\infty}(1-q^n)\eq 1-0\eq 1[/ilmath] also
          3. [ilmath]q\eq 1[/ilmath] then [ilmath]q^n\eq 1[/ilmath] always so
            • [ilmath]\lim_{n\rightarrow\infty}(1-q^n)\eq 1-1\eq 0[/ilmath]
          • So we see that [ilmath]q\in [0,1) [/ilmath][Note 3] means that [ilmath]\lim_{n\rightarrow\infty}(1-q^n)\eq 1[/ilmath]
        • Substituting our findings we see for the relevant range of this case that:
          • [math]\frac{q}{1-q}\cdot\lim_{n\rightarrow\infty}\Big((1-q^n)\Big) \eq \frac{q}{1-q} [/math]
        • Thus:
          • [math]\sum^\infty_{k\eq 1}q^k:\eq \lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}q^k\right) \eq \frac{q}{1-q} [/math]
    • We combine this into our expression for [ilmath]\E{X} [/ilmath]:
      • [math]\E{X}\eq p\cdot\left(\frac{\d}{\d q}\left[\sum^\infty_{k\eq 1}q^k\middle]\right\vert_q\right)[/math]
        [math]\eq p\cdot\frac{\d}{\d q}\left[\frac{q}{1-q}\middle]\right\vert_q[/math]
      • We now operate on [ilmath]\frac{\d}{\d q}\big[q\cdot (1-q)^{-1}\big]\big\vert_q [/ilmath] and - as writing it this way implies - will use the product rule:
        • [math]\frac{\d}{\d q}\Big[q\cdot (1-q)^{-1}\Big]\Big\vert_q \eq q\frac{\d}{\d q}\left[(1-q)^{-1}\middle]\right\vert_q+\frac{1}{1-q}\frac{\d}{\d q}\left[q\right]\Big\vert_q[/math]
          [math]\eq\frac{-q}{(1-q)^2}\cdot\frac{\d}{\d q}\Big[(1-q)\Big]\Big\vert_q +\frac{1}{1-q} [/math] - notice the chain ruling being applied here
          [math]\eq\frac{-q}{(1-q)^2}(-1) +\frac{1}{1-q} [/math]
          [math]\eq \frac{1}{1-q}\left(1+\frac{q}{1-q}\right) [/math]
          [math]\eq \frac{1}{1-q}\left(\frac{1-q}{1-q}+\frac{q}{1-q}\right) [/math]
          [math]\eq \frac{1}{1-q}\left(\frac{1}{1-q}\right) [/math]
          [math]\eq\frac{1}{(1-q)^2} [/math] or [ilmath]\eq (1-q)^{-2} [/ilmath]
        • Finally: [math]\frac{\d}{\d q}\big[q\cdot (1-q)^{-1}\big]\big\vert_q \eq \frac{1}{(1-q)^2} [/math]
          • So now we have: [math]\E{X} \eq p\cdot\frac{\d}{\d q}\left[\frac{q}{1-q}\middle]\right\vert_q\eq p\frac{1}{(1-q)^2} [/math]
      • Lastly we operate on [math]\E{X}\eq p\frac{1}{(1-q)^2} [/math]
        • Recall that [ilmath]q:\eq 1-p[/ilmath] so [ilmath]1-q\eq 1-(1-p)\eq 1-1+p\eq p[/ilmath] - we have [ilmath]1-q\eq p[/ilmath] now, substitute this in and we see:
          • [math]\E{X}\eq p\frac{1}{p^2} [/math]
            [math]\eq \frac{1}{p} [/math]
    • So we have [math]\E{X}\eq \frac{1}{p} [/math] given our value of [ilmath]p[/ilmath]
  • Since our choice of [ilmath]p\in(0,1)[/ilmath] was arbitrary we have shown:
    • [math]\forall p\in(0,1)\left[\E{\text{Geo}(p)}\eq\frac{1}{p}\right] [/math] - as required

Notes

  1. I'd really like to link to something here so
    TODO: Link to the actual result!
  2. Remember [math]\sum^\infty_{k\eq 1}a_k[/math] is just short hand for [math]\lim_{n\rightarrow\infty}\left(\sum^n_{k\eq 1}a_k\right)[/math] - see limits and limit of a series - and remember that [math]\frac{\d}{\d x}\Big[f(x)\Big]\Big\vert_x+\frac{\d}{\d x}\Big[g(x)\Big]\Big\vert_x\eq\frac{\d}{\d x}\Big[f(x)+g(x)\Big]\Big\vert_x[/math] - as per linearity of the derivative.
    • TODO: More links?
  3. I'm extending the range slightly but as [ilmath](0,1)\subseteq [0,1)[/ilmath] we're fine to do so