hcju/proofwikiqa huggingface dataset:
Consider the sample space $\Omega$ of all sequences $\left \langle{X_i}\right \rangle$ of length $n$. The $i$th entry of any such sequence is the result of the $i$th trial. We have that $\Omega$ is finite. Let us take the event space $\Sigma$ to be the power set of $\Omega$. As the elements of $\Omega$ are independent, by definition of the Bernoulli process, we have that: :$\forall \omega \in \Omega: \Pr \left({\omega}\right) = p^{s \left({\omega}\right)} \left({1 - p}\right)^{n - s \left({\omega}\right)}$ where $s \left({\omega}\right)$ is the number of successes in $\omega$. In the same way: :$\displaystyle \forall A \in \Sigma: \Pr \left({A}\right) = \sum_{\omega \mathop \in A} \Pr \left({\omega}\right)$ Now, let us define the discrete random variable $Y_i$ as follows: :$Y_i \left({\omega}\right) = \begin{cases} 1 & : \omega_i \text { is a success} \\ 0 & : \omega_i \text { is a failure} \\ \end{cases}$ where $\omega_i$ is the $i$th element of $\omega$. Thus, each $Y_i$ has image $\left\{{0, 1}\right\}$ and a probability mass function: :$\Pr \left({Y_i = 0}\right) = \Pr \left({\left\{{\omega \in \Omega: \omega_i \text { is a success}}\right\}}\right)$ Thus we have: {{begin-eqn}} {{eqn | l = \Pr \left({Y_i = 1}\right)       | r = \sum_{\omega: \omega_i \text{ success} } p^{s \left({\omega}\right)} \left({1 - p}\right)^{n - s \left({\omega}\right)} }} {{eqn | r = \sum_{r \mathop = 1}^n \sum_{ \substack{ \omega: \omega_i \text{ success} \\ s \left({\omega}\right) = r } } p^r \left({1 - p}\right)^{n - r} }} {{eqn | r = \sum_{r \mathop = 1}^n \binom {n-1} {r-1} p^r \left({1 - p}\right)^{n - r}       | c = As we already know the position of one success (namely $i$) }} {{eqn | r = p \sum_{r \mathop = 0}^{n-1} \binom {n-1} r p^r \left({1 - p}\right)^{\left({n - 1}\right) - r}       | c = Switching summation index }} {{eqn | r = p \left({p + \left({1 - p}\right)}\right)^{n-1}       | c = Binomial Theorem }} {{eqn | r = p }} {{end-eqn}} Then: :$\Pr \left({Y_i = 0}\right) = 1 - \Pr \left({Y_i = 1}\right) = 1 - p$ So (by a roundabout route) we have confirmed that $Y_i$ has the Bernoulli distribution with parameter $p$. Now, let us define the random variable: : $\displaystyle S_n \left({\omega}\right) = \sum_{i \mathop = 1}^n Y_i \left({\omega}\right)$ By definition: * $S_n \left({\omega}\right)$ is the number of successes in $\omega$ * $S_n$ takes values in $\left\{{0, 1, 2, \ldots, n}\right\}$ (as each $Y_i$ can be $0$ or $1$). Also, we have that: {{begin-eqn}} {{eqn | l=\Pr \left({S_n = k}\right)       | r=\Pr \left({\left\{ {\omega \in \Omega: s \left({\omega}\right) = k}\right\} }\right) }} {{eqn | r=\sum_{\omega: s \left({\omega}\right) \mathop = k} \Pr \left({\omega}\right) }} {{eqn | r=\sum_{\omega: s \left({\omega}\right) \mathop = k} p^k \left({1 - p}\right)^{n-k} }} {{eqn | r=\binom n k p^k \left({1 - p}\right)^{n-k} }} {{end-eqn}} Hence the result. {{qed}}
Follows directly from the definition of geometric distribution. Let $X$ be the discrete random variable defined as the number of successes before a failure is encountered. Thus the last trial (and the last trial only) will be a failure, and the others will be successes. The probability that $k$ successes are followed by a failure is: :$\Pr \left({X = k}\right) = p^k \left({1 - p}\right)$ Hence the result. {{Qed}} Category:Bernoulli Distribution Category:Geometric Distribution 6cvcdj83j7p6m5x555dz1f19chig0qh
As $\Img X$ is countable, then so is $\Img {g \sqbrk X}$. Now consider $g^{-1} \sqbrk Y$. We have that: :$\forall x \in \R: \map {X^{-1} } x \in \Sigma$ We also have that: :$\displaystyle \forall y \in \R: \map {g^{-1} } y = \bigcup_{x: \map g x = y} \set x$ But $\Sigma$ is a sigma-algebra and therefore closed for unions. Thus: :$\forall y \in \R: \map {X^{-1} } {\map {g^{-1} } y} \in \Sigma$ Hence the result. {{qed}}
Let $\Omega_X = \Img X = I$. Let $Y = g \sqbrk X$. Thus: :$\Omega_Y = \Img Y = g \sqbrk I$ So: {{begin-eqn}} {{eqn | l = \expect Y       | r = \sum_{y \mathop \in g \sqbrk I} y \, \map \Pr {Y = y}       | c =  }} {{eqn | r = \sum_{y \mathop \in g \sqbrk I} y \sum_{ {x \mathop \in I} \atop {\map g x \mathop = y} } \map \Pr {X = x}       | c = Probability Mass Function of Function of Discrete Random Variable }} {{eqn | r = \sum_{x \mathop \in I} \map g x \, \map \Pr {X = x}       | c =  }} {{end-eqn}} From the definition of expectation, this last sum applies only when the last sum is absolutely convergent. {{qed}}
By Function of Discrete Random Variable we have that $Y$ is itself a discrete random variable. Thus: {{begin-eqn}} {{eqn | l=p_Y \left({y}\right)       | r=\Pr \left({Y = y}\right)       | c= }} {{eqn | r=\Pr \left({g \left({X}\right) = y}\right)       | c= }} {{eqn | r=\Pr \left({X \in g^{-1} \left({Y}\right)}\right)       | c= }} {{eqn | r=\sum_{x \mathop \in g^{-1} \left({y}\right)} \Pr \left({X = x}\right)       | c= }} {{end-eqn}} {{qed}}
=== Discrete Random Variable === {{:Variance as Expectation of Square minus Square of Expectation/Discrete}} === Continuous Random Variable === {{:Variance as Expectation of Square minus Square of Expectation/Continuous}}
We have from Power Rule for Derivatives that: :$\displaystyle \frac \d {\d x} \sum_{n \mathop \ge 1} x^n = \sum_{n \mathop \ge 1} n x^{n-1}$ But from Sum of Infinite Geometric Sequence: Corollary: :$\displaystyle \sum_{n \mathop \ge 1} x^n = \frac x {1-x}$ The result follows by Power Rule for Derivatives and the Chain Rule for Derivatives applied to $\dfrac x {1 - x}$. {{qed}}
From the definition of expectation: :$\expect X = \displaystyle \sum_{x \mathop \in \Omega_X} x \map \Pr {X = x}$ By definition of shifted geometric distribution: :$\expect X = \displaystyle \sum_{k \mathop \in \Omega_X} k p \paren {1 - p}^{k - 1}$ Let $q = 1 - p$: {{begin-eqn}} {{eqn | l = \expect X       | r = p \sum_{k \mathop \ge 0} k q^{k - 1}       | c = as $\Omega_X = \N$ }} {{eqn | r = p \sum_{k \mathop \ge 1} k q^{k - 1}       | c = The term in $k = 0$ vanishes }} {{eqn | r = p \frac 1 {\paren {1 - q}^2}       | c = Derivative of Geometric Sequence }} {{eqn | r = \frac p {p^2}       | c = as $q = 1 - p$ }} {{eqn | r = \frac 1 p }} {{end-eqn}} {{qed}}
From the Probability Generating Function of Shifted Geometric Distribution, we have: :$\map {\Pi_X} s = \dfrac {p s} {1 - q s}$ where $q = 1 - p$. From Expectation of Discrete Random Variable from PGF, we have: :$\expect X = \map {\Pi'_X} 1$ We have: {{begin-eqn}} {{eqn | l = \map {\Pi'_X} s       | r = \map {\frac \d {\d s} } {\frac {p s} {1 - q s} } }} {{eqn | r = \frac p {\paren {1 - q s}^2}       | c = Derivatives of PGF of Shifted Geometric Distribution }} {{end-eqn}} Plugging in $s = 1$: {{begin-eqn}} {{eqn | l = \map {\Pi'_X} 1       | r = \frac p {\paren {1 - q}^2} }} {{eqn | r = \frac p {p^2}       | c = as $q = 1 - p$ }} {{eqn | r = \frac 1 p }} {{end-eqn}} Hence the result. {{qed}}
From the definition of expectation: :$\displaystyle \expect X = \sum_{x \mathop \in \Img X} x \, \map \Pr {X = x}$ By definition of Bernoulli distribution: :$\expect X = 1 \times p + 0 \times \paren {1 - p}$ Hence the result. {{qed}}
Follows directly from Expectation of Binomial Distribution, putting $n = 1$. {{qed}}
From the Probability Generating Function of Bernoulli Distribution, we have: :$\map {\Pi_X} s = q + p s$ where $q = 1 - p$. From Expectation of Discrete Random Variable from PGF, we have: :$\expect X = \map { {\Pi_X}'} 1$ From Derivatives of PGF of Bernoulli Distribution: :$\map { {\Pi_X}'} s = p$ Hence the result. {{qed}}
From Moment Generating Function of Bernoulli Distribution, the moment generating function of $X$, $M_X$, is given by:  :$\map {M_X} t = q + p e^t$ where $q = 1 - p$.  By Moment in terms of Moment Generating Function: :$\expect X = \map {M_X'} 0$ We have:  {{begin-eqn}} {{eqn	| l = \map {M_X'} t 	| r = \frac \d {\d t} \paren {q + p e^t} }} {{eqn	| r = p e^t 	| c = Derivative of Constant, Derivative of Exponential Function }} {{end-eqn}} Setting $t = 0$ gives:  {{begin-eqn}} {{eqn	| l = \expect X 	| r = p e^0 }} {{eqn	| r = p 	| c = Exponential of Zero }} {{end-eqn}} {{qed}}
From the definition of expectation: :$\displaystyle \expect X = \sum_{x \mathop \in \Omega_X} x \map \Pr {X = x}$ Thus: {{begin-eqn}} {{eqn | l = \expect X       | r = \sum_{k \mathop = 0}^n k \binom n k p^k q^{n - k}       | c = Definition of Binomial Distribution, with $p + q = 1$ }} {{eqn | r = \sum_{k \mathop = 1}^n k \binom n k p^k q^{n - k}       | c = since for $k = 0$, $k \dbinom n k p^k q^{n - k} = 0$ }} {{eqn | r = \sum_{k \mathop = 1}^n n \binom {n - 1} {k - 1} p^k q^{n - k}       | c = Factors of Binomial Coefficient: $k \dbinom n k = n \dbinom {n - 1} {k - 1}$ }} {{eqn | r = n p \sum_{k \mathop = 1}^n \binom {n - 1} {k - 1} p^{k - 1} q^{\paren {n - 1} - \paren {k - 1} }       | c = taking out $n p$ and using $\paren {n - 1} - \paren {k - 1} = n - k$ }} {{eqn | r = n p \sum_{j \mathop = 0}^m \binom m j p^j q^{m - j}       | c = putting $m = n - 1, j = k - 1$ }} {{eqn | r = n p       | c = Binomial Theorem and $p + q = 1$ }} {{end-eqn}} {{qed}}
From Bernoulli Process as Binomial Distribution, we see that $X$ as defined here is a sum of discrete random variables $Y_i$ that model the Bernoulli distribution: :$\displaystyle X = \sum_{i \mathop = 1}^n Y_i$ Each of the Bernoulli trials is independent of each other, by definition of a Bernoulli process. It follows that: {{begin-eqn}} {{eqn| l = E \left({X}\right)      | r = E \left({ \sum_{i \mathop = 1}^n Y_i }\right) }} {{eqn| r = \sum_{i \mathop = 1}^n E \left({Y_i}\right)      | c = Sum of Expectations of Independent Trials }} {{eqn| r = \sum_{i \mathop = 1}^n \ p      | c = Expectation of Bernoulli Distribution }} {{eqn| r = n p      | c = Sum of Identical Terms }} {{end-eqn}} {{qed}}
From the Probability Generating Function of Binomial Distribution, we have: :$\displaystyle \Pi_X \left({s}\right) = \left({q + ps}\right)^n$ where $q = 1 - p$. From Expectation of Discrete Random Variable from PGF, we have: :$\displaystyle E \left({X}\right) = \Pi'_X \left({1}\right)$ We have: {{begin-eqn}}      {{eqn | l=\Pi'_X \left({s}\right)       | r=\frac {\mathrm d} {\mathrm d s} \left({q + ps}\right)^n       | c= }} {{eqn | r=n p \left({q + ps}\right)^{n-1}       | c=Derivatives of PGF of Binomial Distribution }} {{end-eqn}} Plugging in $s = 1$: :$\displaystyle\Pi'_X \left({1}\right) = n p \left({q + p}\right)$ Hence the result, as $q + p = 1$. {{qed}}
From Moment Generating Function of Binomial Distribution, the moment generating function of $X$, $M_X$, is given by: :$\displaystyle \map {M_X} t = \paren {1 - p + pe^t}^n$ By Moment in terms of Moment Generating Function: :$\displaystyle \expect X = \map {M_X'} 0$ We have:  {{begin-eqn}} {{eqn	| l = \map {M_X'} t  	| r = \frac \d {\d t} \paren {1 - p + pe^t}^n }} {{eqn	| r = \map {\frac \d {\d t} } {1 - p + pe^t} \map {\frac \d {\map \d {1 - p + pe^t} } } {1 - p + pe^t}^n 	| c = Chain Rule for Derivatives }} {{eqn	| r = n p e^t \paren {1 - p + pe^t}^{n - 1} 	| c = Derivative of Exponential Function, Derivative of Power }} {{end-eqn}} Setting $t = 0$ gives: {{begin-eqn}} {{eqn	| l = \expect X 	| r = n p e^0 \paren {1 - p + p e^0}^{n - 1} }} {{eqn	| r = n p \paren {1 - p + p}^{n - 1} 	| c = Exponential of Zero }} {{eqn	| r = n p }} {{end-eqn}} {{qed}}
From the definition of expectation: :$\displaystyle \expect X = \sum_{x \mathop \in \Img X} x \map \Pr {X = x}$ By definition of Poisson distribution: :$\displaystyle \expect X = \sum_{k \mathop \ge 0} k \frac 1 {k!} \lambda^k e^{-\lambda}$ Then: {{begin-eqn}} {{eqn | l = \expect X       | r = \lambda e^{-\lambda} \sum_{k \mathop \ge 1} \frac 1 {\paren {k - 1}!} \lambda^{k-1}       | c = as the $k = 0$ term vanishes }} {{eqn | r = \lambda e^{-\lambda} \sum_{j \mathop \ge 0} \frac {\lambda^j} {j!}       | c = putting $j = k - 1$ }} {{eqn | r = \lambda e^{-\lambda} e^{\lambda}       | c = Taylor Series Expansion for Exponential Function }} {{eqn | r = \lambda }} {{end-eqn}} {{qed}}
From the Probability Generating Function of Poisson Distribution, we have: :$\Pi_X \left({s}\right) = e^{-\lambda \left({1-s}\right)}$ From Expectation of Discrete Random Variable from PGF, we have: :$E \left({X}\right) = \Pi'_X \left({1}\right)$ We have: {{begin-eqn}} {{eqn | l = \Pi'_X \left({s}\right)       | r = \frac {\mathrm d} {\mathrm ds} e^{-\lambda \left({1-s}\right)}       | c =  }} {{eqn | r = \lambda e^{- \lambda \left({1-s}\right)}       | c = Derivatives of PGF of Poisson Distribution }} {{end-eqn}} Plugging in $s = 1$: :$\Pi'_X \left({1}\right) = \lambda e^{- \lambda \left({1-1}\right)} = \lambda e^0$ Hence the result from Exponential of Zero: : $e^0 = 1$ {{qed}}
From Moment Generating Function of Poisson Distribution, the moment generating function of $X$, $M_X$, is given by:  :$\map {M_X} t = e^{\lambda \paren {e^t - 1} }$ By Moment in terms of Moment Generating Function: :$\expect X = \map {M_X'} 0$ We have:  {{begin-eqn}} {{eqn	| l = \map {M_X'} t  	| r = \map {\frac \d {\d t} } {e^{\lambda \paren {e^t - 1} } } }} {{eqn	| r = \map {\frac \d {\d t} } {\lambda \paren {e^t - 1} } \frac \d {\map \d {\lambda \paren {e^t - 1} } } \paren {e^{\lambda \paren {e^t - 1} } } 	| c = Chain Rule for Derivatives }} {{eqn	| r = \lambda e^t e^{\lambda \paren {e^t - 1} } 	| c = Derivative of Exponential Function }} {{end-eqn}} Setting $t = 0$ gives:  {{begin-eqn}} {{eqn	| l = \expect X 	| r = \lambda e^0 e^{\lambda \paren {e^0 - 1} } }} {{eqn	| r = \lambda 	| c = Exponential of Zero }} {{end-eqn}} {{qed}}
From Moment Generating Function of Bernoulli Distribution, the moment generating function of $X$, $M_X$, is given by:  :$\displaystyle \map {M_X} t = q + p e^t$ From Variance as Expectation of Square minus Square of Expectation, we have:  :$\displaystyle \var X = \expect {X^2} - \paren {\expect X}^2$ From Moment in terms of Moment Generating Function: :$\displaystyle \expect {X^2} = \map {M_X''} 0$ We have:  {{begin-eqn}} {{eqn	| l = \map {M_X''} t 	| r = \frac {\d^2} {\d t^2} \paren {q + p e^t} }} {{eqn	| r = p \frac \d {\d t} \paren {e^t} 	| c = Derivative of Constant, Derivative of Exponential Function }} {{eqn	| r = p e^t 	| c = Derivative of Exponential Function }} {{end-eqn}} Setting $t = 0$ gives:  {{begin-eqn}} {{eqn	| l = \expect {X^2} 	| r = p e^0 }} {{eqn	| r = p 	| c = Exponential of Zero }} {{end-eqn}} In Expectation of Bernoulli Distribution, it is shown that:  :$\displaystyle \expect X = p$ So:  {{begin-eqn}} {{eqn	| l = \var X 	| r = p - p^2 }} {{eqn	| r = p \paren {1 - p} }} {{end-eqn}} {{qed}}
From the definition of Variance as Expectation of Square minus Square of Expectation: :$\var X = \expect {X^2} - \paren {\expect X}^2$ From Expectation of Function of Discrete Random Variable: :$\displaystyle \expect {X^2} = \sum_{x \mathop \in \Omega_X} x^2 \, \map \Pr {X = x}$ So: {{begin-eqn}} {{eqn | l = \expect {X^2}       | r = \sum_{k \mathop \ge 0} {k^2 \dfrac 1 {k!} \lambda^k e^{-\lambda} }       | c = {{Defof|Poisson Distribution}} }} {{eqn | r = \lambda e^{-\lambda} \sum_{k \mathop \ge 1} {k \dfrac 1 {\paren {k - 1}!} \lambda^{k - 1} }       | c = Note change of limit: term is zero when $k=0$ }} {{eqn | r = \lambda e^{-\lambda} \paren {\sum_{k \mathop \ge 1} {\paren {k - 1} \dfrac 1 {\paren {k - 1}!} \lambda^{k - 1} } + \sum_{k \mathop \ge 1} {\frac 1 {\paren {k - 1}!} \lambda^{k - 1} } }       | c = straightforward algebra }} {{eqn | r = \lambda e^{-\lambda} \paren {\lambda \sum_{k \mathop \ge 2} {\dfrac 1 {\paren {k - 2}!} \lambda^{k - 2} } + \sum_{k \mathop \ge 1} {\dfrac 1 {\paren {k - 1}!} \lambda^{k - 1} } }       | c = Again, note change of limit: term is zero when $k-1=0$ }} {{eqn | r = \lambda e^{-\lambda} \paren {\lambda \sum_{i \mathop \ge 0} {\dfrac 1 {i!} \lambda^i} + \sum_{j \mathop \ge 0} {\dfrac 1 {j!} \lambda^j} }       | c = putting $i = k - 2, j = k - 1$ }} {{eqn | r = \lambda e^{-\lambda} \paren {\lambda e^\lambda + e^\lambda}       | c = Taylor Series Expansion for Exponential Function }} {{eqn | r = \lambda \paren {\lambda + 1}       | c =  }} {{eqn | r = \lambda^2 + \lambda       | c =  }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \var X       | r = \expect {X^2} - \paren {\expect X}^2       | c =  }} {{eqn | r = \lambda^2 + \lambda - \lambda^2       | c = Expectation of Poisson Distribution: $\expect X = \lambda$ }} {{eqn | r = \lambda       | c =  }} {{end-eqn}} {{qed}}
From Moment Generating Function of Poisson Distribution, the moment generating function of $X$, $M_X$, is given by:  :$\map {M_X} t = e^{\lambda \paren {e^t - 1} }$ From Variance as Expectation of Square minus Square of Expectation, we have:  :$\var X = \expect {X^2} - \paren {\expect X}^2$ From Moment in terms of Moment Generating Function: :$\expect {X^2} = \map {M_X''} 0$ In Expectation of Poisson Distribution, it is shown that:  :$\map {M_X'} t = \lambda e^t e^{\lambda \paren {e^t - 1} }$ Then: {{begin-eqn}} {{eqn	| l = \map {M''_X} t 	| r = \map {\frac \d {\d t} } {\lambda e^t e^{\lambda \paren {e^t - 1} } } }} {{eqn	| r = \lambda \map {\frac \d {\d t} } {e^{\lambda \paren {e^t - 1} + t} } }} {{eqn	| r = \lambda \map {\frac \d {\d t} } {\lambda \paren {e^t - 1} + t} \frac \d {\map \d {\lambda \paren {e^t - 1} + t} } \paren {e^{\lambda \paren {e^t - 1} + t} } 	| c = Chain Rule for Derivatives }} {{eqn	| r = \lambda \paren {\lambda e^t + 1} e^{\lambda \paren {e^t - 1} + t} 	| c = Derivative of Power, Derivative of Exponential Function }} {{end-eqn}} Setting $t = 0$:  {{begin-eqn}} {{eqn	| l = \expect {X^2} 	| r = \lambda \paren {\lambda e^0 + 1} e^{\lambda \paren {e^0 - 1} + 0} }} {{eqn	| r = \lambda \paren {\lambda + 1} 	| c = Exponential of Zero }} {{eqn	| r = \lambda^2 + \lambda }} {{end-eqn}} From Expectation of Poisson Distribution:  :$\expect X = \lambda$ So:  :$\var X = \lambda^2 + \lambda - \lambda^2 = \lambda$ {{qed}}
From the definition of Variance as Expectation of Square minus Square of Expectation: :$\var X = \expect {X^2} - \left({\expect X}\right)^2$ From Expectation of Function of Discrete Random Variable: :$\displaystyle \expect {X^2} = \sum_{x \mathop \in \Img X} x^2 \Pr \paren {X = x}$ To simplify the algebra a bit, let $q = 1 - p$, so $p + q = 1$. So: {{begin-eqn}} {{eqn | l = \expect {X^2}       | r = \sum_{k \mathop \ge 0}^n k^2 \binom n k p^k q^{n - k}       | c = Definition of Binomial Distribution: $p + q = 1$ }} {{eqn | r = \sum_{k \mathop = 0}^n k n \binom {n - 1} {k - 1} p^k q^{n - k}       | c = Factors of Binomial Coefficient: $k \dbinom n k = n \dbinom {n - 1} {k - 1}$ }} {{eqn | r = n p \sum_{k \mathop = 1}^n k \binom {n - 1} {k - 1} p^{k - 1} q^{\paren {n - 1} - \paren {k - 1} }       | c = Change of limit: term is zero when $k - 1 = 0$ }} {{eqn | r = n p \sum_{j \mathop = 0}^m \paren {j + 1} \binom m j p^j q^{m - j}       | c = putting $j = k - 1, m = n - 1$ }} {{eqn | r = n p \paren {\sum_{j \mathop = 0}^m j \binom m j p^j q^{m - j} + \sum_{j \mathop = 0}^m \binom m j p^j q^{m - j} }       | c = splitting sum up into two }} {{eqn | r = n p \paren {\sum_{j \mathop = 0}^m m \binom {m - 1} {j - 1} p^j q^{m - j} + \sum_{j \mathop = 0}^m \binom m j p^j q^{m - j} }       | c = Factors of Binomial Coefficient: $j \dbinom m j = m \dbinom {m - 1} {j - 1}$ }} {{eqn | r = n p \paren {\paren {n - 1} p \sum_{j \mathop = 1}^m \binom {m - 1} {j - 1} p^{j - 1} q^{\paren {m - 1} - \paren {j - 1} } + \sum_{j \mathop = 0}^m \binom m j p^j q^{m - j} }       | c = Change of limit: term is zero when $j - 1 = 0$ }} {{eqn | r = n p \paren {\paren {n - 1} p \paren {p + q}^{m - 1} + \paren {p + q}^m}       | c = Binomial Theorem }} {{eqn | r = n p \paren {\paren {n - 1} p + 1}       | c = as $p + q = 1$ }} {{eqn | r = n^2 p^2 + n p \paren {1 - p}       | c = by algebra }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \var X       | r = \expect {X^2} - \paren {\expect X}^2       | c =  }} {{eqn | r = n p \paren {1 - p} + n^2 p^2 - \paren {n p}^2       | c = Expectation of Binomial Distribution: $\expect X = n p$ }} {{eqn | r = n p \paren {1 - p}       | c =  }} {{end-eqn}} as required. {{qed}}
From Variance of Discrete Random Variable from PGF: :$\var X = \map {\Pi''_X} 1 + \mu - \mu^2$ where $\mu = \expect X$ is the expectation of $X$. From the Probability Generating Function of Binomial Distribution: :$\map {\Pi_X} s = \paren {q + p s}^n$ where $q = 1 - p$. From Expectation of Binomial Distribution: :$\mu = n p$ From Derivatives of PGF of Binomial Distribution: :$\map {\Pi''_X} s = n \paren {n - 1} p^2 \paren {q + p s}^{n - 2}$ Setting $s = 1$ and using the formula $\map {\Pi''_X} 1 + \mu - \mu^2$: :$\var X = n \paren {n - 1} p^2 + n p - n^2 p^2$ Hence the result. {{qed}}
From Bernoulli Process as Binomial Distribution, we see that $X$ as defined here is the sum of the discrete random variables that model the Bernoulli distribution. Each of the Bernoulli trials is independent of each other. Hence we can use Sum of Variances of Independent Trials. The Variance of Bernoulli Distribution is $p \paren {1 - p}$. Thus the variance of $\Binomial n p$ is $n p \paren {1 - p}$. {{qed}}
The proof proceeds by induction on the number of terms $n$ in the sum. For all $n \in \Z_{\ge 0}$, let $\map P n$ be the proposition: :$\displaystyle \expect {\sum_{j \mathop = 1}^n X_j} = \sum_{j \mathop = 1}^n \expect {X_j}$ === Basis for the Induction === $\map P 1$ is the case: :$\displaystyle \expect {\sum_{j \mathop = 1}^1 X_j} = \sum_{j \mathop = 1}^1 \expect {X_j}$ That is: :$\expect {X_1} = \expect {X_1}$ which is tautologically true. This is our basis for the induction. === Induction Hypothesis === Now it needs to be shown that if $\map P k$ is true, where $k \ge 1$, then it logically follows that $\map P {k + 1}$ is true. So this is the induction hypothesis: $\displaystyle \expect {\sum_{j \mathop = 1}^k X_j} = \sum_{j \mathop = 1}^k \expect {X_j}$ from which it is to be shown that: $\displaystyle \expect {\sum_{j \mathop = 1}^{k + 1} X_j} = \sum_{j \mathop = 1}^{k + 1} \expect {X_j}$ === Induction Step === This is the induction step: Denote the random variable $Y = \displaystyle \sum_{j \mathop = 1}^k X_j$. Then we compute: {{begin-eqn}} {{eqn | l = \expect {\sum_{j \mathop = 1}^{k + 1} X_j}       | r = \expect {Y + X_{k + 1} } }} {{eqn | r = \expect Y  + \expect {X_{k + 1} }       | c = Linearity of Expectation Function }} {{eqn | r = \sum_{j \mathop = 1}^{k + 1} \expect {X_j}       | c = by the Induction Hypothesis }} {{end-eqn}} The result follows by the Principle of Mathematical Induction. {{qed}}
{{begin-eqn}} {{eqn | l = \var {\sum_{j \mathop = 1}^n X_j}       | r = \expect {\paren {\sum_{j \mathop = 1}^n X_j}^2} - \expect {\sum_{j \mathop = 1}^n X_j}^2       | c = Variance as Expectation of Square minus Square of Expectation/Discrete }} {{eqn | r = \expect {\sum_{0 \mathop < i \mathop < j \mathop \le n} 2 X_i X_j + \sum_{j \mathop = 1}^n X_j^2} - 2 \sum_{0 \mathop < i \mathop < j \mathop \le n} \expect {X_i} \expect {X_j} - \sum_{j \mathop = 1}^n \expect{X_j}^2       | c =  }} {{eqn | r = \sum_{0 \mathop < i \mathop < j \mathop \le n} 2 \expect {X_i X_j} + \sum_{j \mathop = 1}^n \expect {X_j^2} - 2 \sum_{0 \mathop < i \mathop < j \mathop \le n} \expect {X_i} \expect {X_j} - \sum_{j \mathop = 1}^n \expect{X_j}^2       | c = Linearity of Expectation Function/Discrete }} {{eqn | r = 2 \sum_{0 \mathop < i \mathop < j \mathop \le n} \expect {X_i} \expect {X_j} + \sum_{j \mathop = 1}^n \expect {X_j^2} - 2 \sum_{0 \mathop < i \mathop < j \mathop \le n} \expect {X_i} \expect {X_j} - \sum_ {j \mathop = 1}^n \expect {X_j}^2       | c = Condition for Independence from Product of Expectations/Corollary }} {{eqn | r = \sum_{j \mathop = 1}^n \expect {X_j^2} - \sum_{j \mathop = 1}^n \expect {X_j}^2       | c =  }} {{eqn | r = \sum_{j \mathop = 1}^n \expect {X_j^2} - \expect {X_j}^2       | c =  }} {{eqn | r = \sum_{j \mathop = 1}^n \var {X_j}       | c = Variance as Expectation of Square minus Square of Expectation/Discrete }} {{end-eqn}} {{qed}} Category:Expectation lk4ah5bp3z6aiv92s4ihponj2vtn74w