일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- differential
- triangle
- mathematics
- 바이어슈트라스
- solution
- algebraic
- DENOMINATOR
- test
- Maths
- equation
- 치환
- Order
- College
- t-치환
- Oxford
- fractions
- factor
- Partial
- 영국
- division
- 학년
- factors
- Admissions
- integral
- 적분
- a-level
- GCSE
- 제도
- 교육
- Weierstrass
Archives
- Today
- Total
Cambridge Maths Academy
FS1 §3.2 Mean and variance of a geometric distribution 본문
A-level Further Maths/Further Statistics 1
FS1 §3.2 Mean and variance of a geometric distribution
Cambridge Maths Academy 2022. 9. 16. 02:23반응형
Further statistics 1
Table of contents
- Probability mass function
- Probability generating function
- Moment generating function
- Moments
- Using moment generating function
- Central moments
- Standardised moments
- Edexcel FS1 Ch Exercise (under construction)
1. Probability mass function
The probability mass function for a geometric distribution, $ X \sim \textrm{Geo}(p)$, is $$ \begin{align} \mathbb P(x) = p q^{x-1}, \qquad x = 1,2,3,\cdots \end{align} $$ where $ p + q = 1 $.Sum of probabilities is 1
$$ \begin{align} \sum_{ x = 1 }^\infty \mathbb P(x) &= \sum_{ x = 1 }^\infty p q^{x-1} \\ &= p \left( \frac{ 1 }{ 1 - q } \right) \\ &= p \cdot \frac{ 1 }{ p } \\ &= 1 \end{align} $$2. Probability generating function
$$ \begin{align} G_X(t) &= \mathbb P(0) + \mathbb P(1) t + \mathbb P(2) t^2 + \mathbb P(3) t^3 + \cdots \\ &= \sum_{x=1}^\infty \mathbb P(x) t^x = \left\langle t^X \right\rangle \\ &= \sum_{x=1}^\infty p q^{x-1} t^x \\ &= \frac{p}{q} \sum_{x=1}^\infty (qt)^x \\ &= \frac{p}{q} \cdot \frac{ qt }{ 1 - qt } \\ &= \frac{ pt }{ 1 - qt } \\ &= \frac{ pt }{ 1 - (1 - p)t } \end{align} $$3. Moment generating function
$$ \begin{align} M_X(t) &= 1 + \langle X \rangle t + \frac{ 1 }{ 2! } \left\langle X^2 \right\rangle t^2 + \frac{ 1 }{ 3! } \left\langle X^3 \right\rangle t^3 + \cdots \\ &= \left\langle 1 + Xt + \frac{ 1 }{ 2! } (Xt)^2 + \frac{ 1 }{ 3! } (Xt)^3 + \cdots \right\rangle \\ &= \left\langle \textrm{e}^{Xt} \right\rangle \\ &= \sum_{x=1}^\infty \mathbb P(x) \textrm{e}^{xt} \\ &= \sum_{x=1}^\infty pq^{x-1} \left( \textrm{e}^{t} \right)^x \\ &= \frac{p}{q} \sum_{x=1}^\infty \left( q \textrm{e}^{t} \right)^x \\ &= \frac{p}{q} \cdot \frac{ q \textrm{e}^{t} }{ 1 - q \textrm{e}^{t} } \\ &= \frac{ p \textrm{e}^{t} }{ 1 - q \textrm{e}^{t} } \\ &= \frac{ p \textrm{e}^{t} }{ 1 - (1 - p) \textrm{e}^{t} } \end{align} $$4. Moments
4.1. Mean = First moment
$$ \begin{align} \mathbb E ( X ) &= \sum_{x=1}^\infty x \mathbb P(X = x) \\ &= \sum_{x=1}^\infty x p q^{x-1} \\ &= \frac{p}{q} \sum_{x=1}^\infty x q^x \\ &= \frac{p}{q} \left( q \frac{ \partial }{ \partial q } \right) \sum_{x=1}^\infty q^x \\ &= \frac{p}{q} \left( q \frac{ \partial }{ \partial q } \right) \frac{ q }{ 1 - q } \\ &= \frac{p}{q} \left( q \frac{ \partial }{ \partial q } \right) \left[ \frac{ q - 1 + 1 }{ 1 - q } \right] \\ &= \frac{p}{q} \left( q \frac{ \partial }{ \partial q } \right) \left[ - 1 + \frac{ 1 }{ 1 - q } \right] \\ &= \frac{p}{q} \cdot \frac{ q }{ ( 1 - q )^2 } \\ &= \frac{ p }{ ( 1 - q )^2 } \\ &= \frac{ 1 }{ p } \end{align} $$ since $ p + q = 1 $.Aside. An alternative way to evaluate $ \sum x q^x $: $$ \begin{align} && S &= \sum_{x=1}^\infty x q^x = q + 2 q^2 + 3 q^3 + 4 q^4 + \cdots \\ && q S &= \sum_{x=1}^\infty x q^{x+1} = q^2 + 2 q^3 + 3 q^4 + 4 q^5 + \cdots \\ \\ &\Rightarrow & (1 - q) S &= q + q^2 + q^3 + q^4 + \cdots = \sum_{x=1}^\infty q^x = \frac{ q }{ 1 - q } \\ &\Rightarrow & S &= \frac{ q }{ (1 - q)^2 } \qquad \checkmark \end{align} $$ When dealing with $ \left\langle X^2 \right\rangle$, we shall also look at a similar way to evaluate $ \sum x^2 q^x $.
4.2. A preparation for higher moments
$$ \begin{align} \mathbb E ( X^n ) &= \sum_{x=1}^\infty x^n \mathbb P(X = x) \\ &= \sum_{x=1}^\infty x^n p q^{x-1} \\ &= \frac{p}{q} \sum_{x=1}^\infty x^n q^x \\ &= \frac{p}{q} \left( q \frac{ \partial }{ \partial q } \right)^n \sum_{x=1}^\infty q^x \\ &= \frac{p}{q} \left( q \frac{ \partial }{ \partial q } \right)^n \frac{ q }{ 1 - q } \end{align} $$ It is convenient to work out: $$ \begin{align} \left( q \frac{\partial}{\partial q} \right)^2 &= q \frac{\partial}{\partial q} + q^2 \frac{\partial^2}{\partial q^2} \\ \\ \left( q \frac{\partial}{\partial q} \right)^3 &= q \frac{\partial}{\partial q} \left( q \frac{\partial}{\partial q} + q^2 \frac{\partial^2}{\partial q^2} \right) \\ &= \left( q \frac{\partial}{\partial q} + q^2 \frac{\partial^2}{\partial q^2} \right) + \left( 2 q^2 \frac{\partial^2}{\partial q^2} + q^3 \frac{\partial^3}{\partial q^3} \right) \\ &= q \frac{\partial}{\partial q} + 3 q^2 \frac{\partial^2}{\partial q^2} + q^3 \frac{\partial^3}{\partial q^3} \\ \\ \left( q \frac{\partial}{\partial q} \right)^4 &= q \frac{\partial}{\partial q} \left( q \frac{\partial}{\partial q} + 3 q^2 \frac{\partial^2}{\partial q^2} + q^3 \frac{\partial^3}{\partial q^3} \right) \\ &= \left( q \frac{\partial}{\partial q} + q^2 \frac{\partial^2}{\partial q^2} \right) + \left( 6 q^2 \frac{\partial^2}{\partial q^2} + 3 q^3 \frac{\partial^3}{\partial q^3} \right) + \left( 3 q^3 \frac{\partial^3}{\partial q^3} + q^4 \frac{\partial^4}{\partial q^4} \right) \\ &= q \frac{\partial}{\partial q} + 7 q^2 \frac{\partial^2}{\partial q^2} + 6 q^3 \frac{\partial^3}{\partial q^3} + q^4 \frac{\partial^4}{\partial q^4} \\ \\ \left( q \frac{\partial}{\partial q} \right)^5 &= q \frac{\partial}{\partial q} \left( q \frac{\partial}{\partial q} + 7 q^2 \frac{\partial^2}{\partial q^2} + 6 q^3 \frac{\partial^3}{\partial q^3} + q^4 \frac{\partial^4}{\partial q^4} \right) \\ &= \left( q \frac{\partial}{\partial q} + q^2 \frac{\partial^2}{\partial q^2} \right) + \left( 14 q^2 \frac{\partial^2}{\partial q^2} + 7 q^3 \frac{\partial^3}{\partial q^3} \right) + \left( 18 q^3 \frac{\partial^3}{\partial q^3} + 6 q^4 \frac{\partial^4}{\partial q^4} \right) + \left( 4 q^4 \frac{\partial^4}{\partial q^4} + q^5 \frac{\partial^5}{\partial q^5} \right) \\ &= q \frac{\partial}{\partial q} + 15 q^2 \frac{\partial^2}{\partial q^2} + 25 q^3 \frac{\partial^3}{\partial q^3} + 10 q^4 \frac{\partial^4}{\partial q^4} + q^5 \frac{\partial^5}{\partial q^5} \\ \\ \left( q \frac{\partial}{\partial q} \right)^6 &= q \frac{\partial}{\partial q} \left( q \frac{\partial}{\partial q} + 15 q^2 \frac{\partial^2}{\partial q^2} + 25 q^3 \frac{\partial^3}{\partial q^3} + 10 q^4 \frac{\partial^4}{\partial q^4} + q^5 \frac{\partial^5}{\partial q^5} \right) \\ &= \left( q \frac{\partial}{\partial q} + q^2 \frac{\partial^2}{\partial q^2} \right) + \left( 30 q^2 \frac{\partial^2}{\partial q^2} + 15 q^3 \frac{\partial^3}{\partial q^3} \right) + \left( 75 q^3 \frac{\partial^3}{\partial q^3} + 25 q^4 \frac{\partial^4}{\partial q^4} \right) \\ &\qquad + \left( 40 q^4 \frac{\partial^4}{\partial q^4} + 10 q^5 \frac{\partial^5}{\partial q^5} \right) + \left( 5 q^5 \frac{\partial^5}{\partial q^5} + q^6 \frac{\partial^6}{\partial q^6} \right) \\ &= q \frac{\partial}{\partial q} + 31 q^2 \frac{\partial^2}{\partial q^2} + 90 q^3 \frac{\partial^3}{\partial q^3} + 65 q^4 \frac{\partial^4}{\partial q^4} + 15 q^5 \frac{\partial^5}{\partial q^5} + q^6 \frac{\partial^6}{\partial q^6} \\ \\ \left( q \frac{\partial}{\partial q} \right)^7 &= q \frac{\partial}{\partial q} \left( q \frac{\partial}{\partial q} + 31 q^2 \frac{\partial^2}{\partial q^2} + 90 q^3 \frac{\partial^3}{\partial q^3} + 65 q^4 \frac{\partial^4}{\partial q^4} + 15 q^5 \frac{\partial^5}{\partial q^5} + q^6 \frac{\partial^6}{\partial q^6} \right) \\ &= \left( q \frac{\partial}{\partial q} + q^2 \frac{\partial^2}{\partial q^2} \right) + \left( 62 q^2 \frac{\partial^2}{\partial q^2} + 31 q^3 \frac{\partial^3}{\partial q^3} \right) + \left( 270 q^3 \frac{\partial^3}{\partial q^3} + 90 q^4 \frac{\partial^4}{\partial q^4} \right) \\ &\qquad + \left( 260 q^4 \frac{\partial^4}{\partial q^4} + 65 q^5 \frac{\partial^5}{\partial q^5} \right) + \left( 75 q^5 \frac{\partial^5}{\partial q^5} + 15 q^6 \frac{\partial^6}{\partial q^6} \right) + \left( 6 q^6 \frac{\partial^6}{\partial q^6} + q^7 \frac{\partial^7}{\partial q^7} \right) \\ &= q \frac{\partial}{\partial q} + 63 q^2 \frac{\partial^2}{\partial q^2} + 301 q^3 \frac{\partial^3}{\partial q^3} + 350 q^4 \frac{\partial^4}{\partial q^4} + 140 q^5 \frac{\partial^5}{\partial q^5} + 21 q^6 \frac{\partial^6}{\partial q^6} + q^7 \frac{\partial^7}{\partial q^7} \\ \\ \left( q \frac{\partial}{\partial q} \right)^8 &= q \frac{\partial}{\partial q} \left( q \frac{\partial}{\partial q} + 63 q^2 \frac{\partial^2}{\partial q^2} + 301 q^3 \frac{\partial^3}{\partial q^3} + 350 q^4 \frac{\partial^4}{\partial q^4} + 140 q^5 \frac{\partial^5}{\partial q^5} + 21 q^6 \frac{\partial^6}{\partial q^6} + q^7 \frac{\partial^7}{\partial q^7} \right) \\ &= \left( q \frac{\partial}{\partial q} + q^2 \frac{\partial^2}{\partial q^2} \right) + \left( 126 q^2 \frac{\partial^2}{\partial q^2} + 63 q^3 \frac{\partial^3}{\partial q^3} \right) + \left( 903 q^3 \frac{\partial^3}{\partial q^3} + 301 q^4 \frac{\partial^4}{\partial q^4} \right) \\ &\qquad + \left( 1400 q^4 \frac{\partial^4}{\partial q^4} + 350 q^5 \frac{\partial^5}{\partial q^5} \right) + \left( 700 q^5 \frac{\partial^5}{\partial q^5} + 140 q^6 \frac{\partial^6}{\partial q^6} \right) + \left( 126 q^6 \frac{\partial^6}{\partial q^6} + 21 q^7 \frac{\partial^7}{\partial q^7} \right) \\ &\qquad + \left( 7 q^7 \frac{\partial^7}{\partial q^7} + q^8 \frac{\partial^8}{\partial q^8} \right) \\ &= q \frac{\partial}{\partial q} + 127 q^2 \frac{\partial^2}{\partial q^2} + 966 q^3 \frac{\partial^3}{\partial q^3} + 1701 q^4 \frac{\partial^4}{\partial q^4} + 1050 q^5 \frac{\partial^5}{\partial q^5} + 266 q^6 \frac{\partial^6}{\partial q^6} + 28 q^7 \frac{\partial^7}{\partial q^7} + q^8 \frac{\partial^8}{\partial q^8} \end{align} $$$$ \begin{align} \left( q \partial_q \right)^2 &= q \partial_q + q^2 \partial_q^2 \\ \\ \left( q \partial_q \right)^3 &= q \partial_q \left( q \partial_q + q^2 \partial_q^2 \right) \\ &= \left( q \partial_q + q^2 \partial_q^2 \right) + \left( 2 q^2 \partial_q^2 + q^3 \partial_q^3 \right) \\ &= q \partial_q + 3 q^2 \partial_q^2 + q^3 \partial_q^3 \\ \\ \left( q \partial_q \right)^4 &= q \partial_q \left( q \partial_q + 3 q^2 \partial_q^2 + q^3 \partial_q^3 \right) \\ &= \left( q \partial_q + q^2 \partial_q^2 \right) + \left( 6 q^2 \partial_q^2 + 3 q^3 \partial_q^3 \right) + \left( 3 q^3 \partial_q^3 + q^4 \partial_q^4 \right) \\ &= q \partial_q + 7 q^2 \partial_q^2 + 6 q^3 \partial_q^3 + q^4 \partial_q^4 \\ \\ \left( q \partial_q \right)^5 &= q \partial_q \left( q \partial_q + 7 q^2 \partial_q^2 + 6 q^3 \partial_q^3 + q^4 \partial_q^4 \right) \\ &= \left( q \partial_q + q^2 \partial_q^2 \right) + \left( 14 q^2 \partial_q^2 + 7 q^3 \partial_q^3 \right) + \left( 18 q^3 \partial_q^3 + 6 q^4 \partial_q^4 \right) + \left( 4 q^4 \partial_q^4 + q^5 \partial_q^5 \right) \\ &= q \partial_q + 15 q^2 \partial_q^2 + 25 q^3 \partial_q^3 + 10 q^4 \partial_q^4 + q^5 \partial_q^5 \\ \\ \left( q \partial_q \right)^6 &= q \partial_q \left( q \partial_q + 15 q^2 \partial_q^2 + 25 q^3 \partial_q^3 + 10 q^4 \partial_q^4 + q^5 \partial_q^5 \right) \\ &= \left( q \partial_q + q^2 \partial_q^2 \right) + \left( 30 q^2 \partial_q^2 + 15 q^3 \partial_q^3 \right) + \left( 75 q^3 \partial_q^3 + 25 q^4 \partial_q^4 \right) + \left( 40 q^4 \partial_q^4 + 10 q^5 \partial_q^5 \right) + \left( 5 q^5 \partial_q^5 + q^6 \partial_q^6 \right) \\ &= q \partial_q + 31 q^2 \partial_q^2 + 90 q^3 \partial_q^3 + 65 q^4 \partial_q^4 + 15 q^5 \partial_q^5 + q^6 \partial_q^6 \\ \\ \left( q \partial_q \right)^7 &= q \partial_q \left( q \partial_q + 31 q^2 \partial_q^2 + 90 q^3 \partial_q^3 + 65 q^4 \partial_q^4 + 15 q^5 \partial_q^5 + q^6 \partial_q^6 \right) \\ &= \left( q \partial_q + q^2 \partial_q^2 \right) + \left( 62 q^2 \partial_q^2 + 31 q^3 \partial_q^3 \right) + \left( 270 q^3 \partial_q^3 + 90 q^4 \partial_q^4 \right) \\ &\qquad + \left( 260 q^4 \partial_q^4 + 65 q^5 \partial_q^5 \right) + \left( 75 q^5 \partial_q^5 + 15 q^6 \partial_q^6 \right) + \left( 6 q^6 \partial_q^6 + q^7 \partial_q^7 \right) \\ &= q \partial_q + 63 q^2 \partial_q^2 + 301 q^3 \partial_q^3 + 350 q^4 \partial_q^4 + 140 q^5 \partial_q^5 + 21 q^6 \partial_q^6 + q^7 \partial_q^7 \\ \\ \left( q \partial_q \right)^8 &= q \partial_q \left( q \partial_q + 63 q^2 \partial_q^2 + 301 q^3 \partial_q^3 + 350 q^4 \partial_q^4 + 140 q^5 \partial_q^5 + 21 q^6 \partial_q^6 + q^7 \partial_q^7 \right) \\ &= \left( q \partial_q + q^2 \partial_q^2 \right) + \left( 126 q^2 \partial_q^2 + 63 q^3 \partial_q^3 \right) + \left( 903 q^3 \partial_q^3 + 301 q^4 \partial_q^4 \right) \\ &\qquad + \left( 1400 q^4 \partial_q^4 + 350 q^5 \partial_q^5 \right) + \left( 700 q^5 \partial_q^5 + 140 q^6 \partial_q^6 \right) + \left( 126 q^6 \partial_q^6 + 21 q^7 \partial_q^7 \right) + \left( 7 q^7 \partial_q^7 + q^8 \partial_q^8 \right) \\ &= q \partial_q + 127 q^2 \partial_q^2 + 966 q^3 \partial_q^3 + 1701 q^4 \partial_q^4 + 1050 q^5 \partial_q^5 + 266 q^6 \partial_q^6 + 28 q^7 \partial_q^7 + q^8 \partial_q^8 \end{align} $$
In summary, $$ \begin{align} \left( q \partial_q \right)^2 &= q \partial_q + q^2 \partial_q^2 \\ \left( q \partial_q \right)^3 &= q \partial_q + 3 q^2 \partial_q^2 + q^3 \partial_q^3 \\ \left( q \partial_q \right)^4 &= q \partial_q + 7 q^2 \partial_q^2 + 6 q^3 \partial_q^3 + q^4 \partial_q^4 \\ \left( q \partial_q \right)^5 &= q \partial_q + 15 q^2 \partial_q^2 + 25 q^3 \partial_q^3 + 10 q^4 \partial_q^4 + q^5 \partial_q^5 \\ \left( q \partial_q \right)^6 &= q \partial_q + 31 q^2 \partial_q^2 + 90 q^3 \partial_q^3 + 65 q^4 \partial_q^4 + 15 q^5 \partial_q^5 + q^6 \partial_q^6 \\ \left( q \partial_q \right)^7 &= q \partial_q + 63 q^2 \partial_q^2 + 301 q^3 \partial_q^3 + 350 q^4 \partial_q^4 + 140 q^5 \partial_q^5 + 21 q^6 \partial_q^6 + q^7 \partial_q^7 \\ \left( q \partial_q \right)^8 &= q \partial_q + 127 q^2 \partial_q^2 + 966 q^3 \partial_q^3 + 1701 q^4 \partial_q^4 + 1050 q^5 \partial_q^5 + 266 q^6 \partial_q^6 + 28 q^7 \partial_q^7 + q^8 \partial_q^8 \end{align} $$
It is useful to Taylor expand $ q^n $ in powers of $ (1 - q) $. Note that we observe the binomial coefficients: $$ \begin{align} q &= 1 - ( 1 - q ) \\ q^2 &= 1 - 2 ( 1 - q ) + ( 1 - q )^2 \\ q^3 &= 1 - 3 ( 1 - q ) + 3 ( 1 - q )^2 - ( 1 - q )^3 \\ q^4 &= 1 - 4 ( 1 - q ) + 6 ( 1 - q )^2 - 4 ( 1 - q )^3 + ( 1 - q )^4 \\ q^5 &= 1 - 5 ( 1 - q ) + 10 ( 1 - q )^2 - 10 ( 1 - q )^3 + 5 ( 1 - q )^4 - ( 1 - q )^5 \\ q^6 &= 1 - 6 ( 1 - q ) + 15 ( 1 - q )^2 - 20 ( 1 - q )^3 + 15 ( 1 - q )^4 - 6 ( 1 - q )^5 + ( 1 - q )^6 \\ q^7 &= 1 - 7 ( 1 - q ) + 21 ( 1 - q )^2 + 35 ( 1 - q )^3 - 35 ( 1 - q )^4 + 21 ( 1 - q )^5 - 7 ( 1 - q )^6 + ( 1 - q )^7 \\ q^8 &= 1 - 8 ( 1 - q ) + 28 ( 1 - q )^2 + 56 ( 1 - q )^3 - 70 ( 1 - q )^4 + 56 ( 1 - q )^5 - 28 ( 1 - q )^6 + 8 ( 1 - q )^7 - ( 1 - q )^8 \\ \end{align} $$ The Taylor expansions above are used to express the following derivatives in partial fractions: $$ \begin{align} \left( q \frac{ \partial }{ \partial q } \right) \frac{ q }{ 1 - q } &= \left( q \frac{ \partial }{ \partial q } \right) \left[ \frac{ q - 1 + 1 }{ 1 - q } \right] \\ &= \left( q \frac{ \partial }{ \partial q } \right) \left[ - 1 + \frac{ 1 }{ 1 - q } \right] \\ &= \frac{ q }{ ( 1 - q )^2 } \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^2 \frac{ q }{ 1 - q } &= \left( q \partial_q + q^2 \partial_q^2 \right) \left[ \frac{ q - 1 + 1 }{ 1 - q } \right] \\ &= \left( q \partial_q + q^2 \partial_q^2 \right) \left[ -1 + \frac{ 1 }{ 1 - q } \right] \\ &= \frac{ q }{ (1 - q)^2 } + \frac{ 2! q^2 }{ (1 - q)^3 } \\ &= q \left[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 2! q }{ (1 - q)^3 } \right] \\ &= q \left[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 2 [ 1 - ( 1 - q) ] }{ (1 - q)^3 } \right] \\ &= q \left[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 2 }{ (1 - q)^3 } - \frac{ 2 }{ (1 - q)^2 } \right] \\ &= q \left[ - \frac{ 1 }{ (1 - q)^2 } + \frac{ 2 }{ (1 - q)^3 } \right] \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^3 \frac{ q }{ 1 - q } &= \left( q \partial_q + 3 q^2 \partial_q^2 + q^3 \partial_q^3 \right) \left[ - 1 + \frac{ 1 }{ 1 - q } \right] \\ &= \frac{ q }{ (1 - q)^2 } + \frac{ (3 \cdot 2!) q^2 }{ (1 - q)^3 } + \frac{ 3! q^3 }{ (1 - q)^4 } \\ &= q \left[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 6 q }{ (1 - q)^3 } + \frac{ 6 q^2 }{ (1 - q)^4 } \right] \\ &= q \left[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 6 [ 1 - ( 1 - q ) ] }{ (1 - q)^3 } + \frac{ 6 \left[ 1 - 2 ( 1 - q ) + ( 1 - q )^2 \right] }{ (1 - q)^4 } \right] \\ &= q \left[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 6 }{ (1 - q)^3 } - \frac{ 6 }{ (1 - q)^2 } + \frac{ 6 }{ (1 - q)^4 } - \frac{ 12 }{ (1 - q)^3 } + \frac{ 6 }{ (1 - q)^2 } \right] \\ &= q \left[ \frac{ 1 }{ (1 - q)^2 } - \frac{ 6 }{ (1 - q)^3 } + \frac{ 6 }{ (1 - q)^4 } \right] \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^4 \frac{ q }{ 1 - q } &= \left( q \partial_q + 7 q^2 \partial_q^2 + 6 q^3 \partial_q^3 + q^4 \partial_q^4 \right) \left[ - 1 + \frac{ 1 }{ 1 - q } \right] \\ &= \frac{ q }{ (1 - q)^2 } + \frac{ (7 \cdot 2!) q^2 }{ (1 - q)^3 } + \frac{ (6 \cdot 3!) q^3 }{ (1 - q)^4 } + \frac{ 4! q^4 }{ (1 - q)^5 } \\ &= q \left[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 14 q }{ (1 - q)^3 } + \frac{ 36 q^2 }{ (1 - q)^4 } + \frac{ 24 q^3 }{ (1 - q)^5 } \right] \\ &= q \bigg[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 14 [ 1 - ( 1 - q ) ] }{ (1 - q)^3 } + \frac{ 36 \left[ 1 - 2 ( 1 - q ) + ( 1 - q )^2 \right] }{ (1 - q)^4 } \\ &\qquad + \frac{ 24 \left[ 1 - 3 ( 1 - q ) + 3 ( 1 - q )^2 - ( 1 - q )^3 \right] }{ (1 - q)^5 } \bigg] \\ &= q \bigg[ \frac{ 1 }{ (1 - q)^2 } + \frac{ 14 }{ (1 - q)^3 } - \frac{ 14 }{ (1 - q)^2 } + \frac{ 36 }{ (1 - q)^4 } - \frac{ 72 }{ (1 - q)^3 } + \frac{ 36 }{ (1 - q)^2 } \\ &\qquad + \frac{ 24 }{ (1 - q)^5 } - \frac{ 72 }{ (1 - q)^4 } + \frac{ 72 }{ (1 - q)^3 } - \frac{ 24 }{ (1 - q)^2 } \bigg] \\ &= q \bigg[ - \frac{ 1 }{ (1 - q)^2 } + \frac{ 14 }{ (1 - q)^3 } - \frac{ 36 }{ (1 - q)^4 } + \frac{ 24 }{ (1 - q)^5 } \bigg] \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^5 \frac{ q }{ 1 - q } &= \left( q \partial_q + 15 q^2 \partial_q^2 + 25 q^3 \partial_q^3 + 10 q^4 \partial_q^4 + q^5 \partial_q^5 \right) \left[ - 1 + \frac{ 1 }{ 1 - q } \right] \\ &= q \left[ \frac{ 1 }{ ( 1 - q )^2 } - \frac{ 30 }{ ( 1 - q )^3 } + \frac{ 150 }{ ( 1 - q )^4 } - \frac{ 240 }{ ( 1 - q )^5 } + \frac{ 120 }{ ( 1 - q )^6 } \right] \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^6 \frac{ q }{ 1 - q } &= \left( q \partial_q + 31 q^2 \partial_q^2 + 90 q^3 \partial_q^3 + 65 q^4 \partial_q^4 + 15 q^5 \partial_q^5 + q^6 \partial_q^6 \right) \left[ - 1 + \frac{ 1 }{ 1 - q } \right] \\ &= q \left[ - \frac{ 1 }{ ( 1 - q )^2 } + \frac{ 62 }{ ( 1 - q )^3 } - \frac{ 540 }{ ( 1 - q )^4 } + \frac{ 1560 }{ ( 1 - q )^5 } - \frac{ 1800 }{ ( 1 - q )^6 } + \frac{ 720 }{ ( 1 - q )^7 } \right] \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^7 \frac{ q }{ 1 - q } &= \left( q \partial_q + 63 q^2 \partial_q^2 + 301 q^3 \partial_q^3 + 350 q^4 \partial_q^4 + 140 q^5 \partial_q^5 + 21 q^6 \partial_q^6 + q^7 \partial_q^7 \right) \left[ - 1 + \frac{ 1 }{ 1 - q } \right] \\ &= q \left[ \frac{ 1 }{ ( 1 - q )^2 } - \frac{ 126 }{ ( 1 - q )^3 } + \frac{ 1860 }{ ( 1 - q )^4 } - \frac{ 8400 }{ ( 1 - q )^5 } + \frac{ 16800 }{ ( 1 - q )^6 } - \frac{ 15120 }{ ( 1 - q )^7 } + \frac{ 5040 }{ ( 1 - q )^8 } \right] \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^8 \frac{ q }{ 1 - q } &= \left( q \partial_q + 127 q^2 \partial_q^2 + 966 q^3 \partial_q^3 + 1701 q^4 \partial_q^4 + 1050 q^5 \partial_q^5 + 266 q^6 \partial_q^6 + 28 q^7 \partial_q^7 + q^8 \partial_q^8 \right) \left[ - 1 + \frac{ 1 }{ 1 - q } \right] \\ &= q \left[ - \frac{ 1 }{ ( 1 - q )^2 } + \frac{ 254 }{ ( 1 - q )^3 } - \frac{ 5796 }{ ( 1 - q )^4 } + \frac{ 40824 }{ ( 1 - q )^5 } - \frac{ 126000 }{ ( 1 - q )^6 } + \frac{ 191520 }{ ( 1 - q )^7 } - \frac{ 141120 }{ ( 1 - q )^8 } + \frac{ 40320 }{ ( 1 - q )^9 } \right] \end{align} $$
The moments: $$ \begin{align} & \left( q \frac{ \partial }{ \partial q } \right) \frac{ q }{ 1 - q } = \frac{ q }{ p^2 } \\ \Rightarrow \qquad & \mathbb E \left( X \right) = \frac{ p }{ q } \left( q \frac{ \partial }{ \partial q } \right) \frac{ q }{ 1 - q } = \frac{ 1 }{ p } \\ \\ & \left( q \frac{ \partial }{ \partial q } \right)^2 \frac{ q }{ 1 - q } = q \left[ - \frac{ 1 }{ p^2 } + \frac{ 2 }{ p^3 } \right] \\ \Rightarrow \qquad & \mathbb E \left( X^2 \right) = \frac{ p }{ q } \left( q \frac{ \partial }{ \partial q } \right)^2 \frac{ q }{ 1 - q } = - \frac{ 1 }{ p} + \frac{ 2 }{ p^2 } \\ \\ & \left( q \frac{ \partial }{ \partial q } \right)^3 \frac{ q }{ 1 - q } = q \left[ \frac{ 1 }{ p^2 } - \frac{ 6 }{ p^3 } + \frac{ 6 }{ p^4 } \right] \\ \Rightarrow \qquad & \mathbb E \left( X^3 \right) = \frac{ p }{ q } \left( q \frac{ \partial }{ \partial q } \right)^3 \frac{ q }{ 1 - q } = \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \\ \\ & \left( q \frac{ \partial }{ \partial q } \right)^4 \frac{ q }{ 1 - q } = q \bigg[ - \frac{ 1 }{ p^2 } + \frac{ 14 }{ p^3 } - \frac{ 36 }{ p^4 } + \frac{ 24 }{ p^5 } \bigg] \\ \Rightarrow \qquad & \mathbb E \left( X^4 \right) = \frac{ p }{ q } \left( q \frac{ \partial }{ \partial q } \right)^4 \frac{ q }{ 1 - q } = - \frac{ 1 }{ p } + \frac{ 14 }{ p^2 } - \frac{ 36 }{ p^3 } + \frac{ 24 }{ p^4 } \\ \\ & \left( q \frac{ \partial }{ \partial q } \right)^5 \frac{ q }{ 1 - q } = q \left[ \frac{ 1 }{ p^2 } - \frac{ 30 }{ p^3 } + \frac{ 150 }{ p^4 } - \frac{ 240 }{ p^5 } + \frac{ 120 }{ p^6 } \right] \\ \Rightarrow \qquad & \mathbb E \left( X^5 \right) = \frac{ p }{ q } \left( q \frac{ \partial }{ \partial q } \right)^5 \frac{ q }{ 1 - q } = \frac{ 1 }{ p } - \frac{ 30 }{ p^2 } + \frac{ 150 }{ p^3 } - \frac{ 240 }{ p^4 } + \frac{ 120 }{ p^5 } \\ \\ & \left( q \frac{ \partial }{ \partial q } \right)^6 \frac{ q }{ 1 - q } = q \left[ - \frac{ 1 }{ p^2 } + \frac{ 62 }{ p^3 } - \frac{ 540 }{ p^4 } + \frac{ 1560 }{ p^5 } - \frac{ 1800 }{ p^6 } + \frac{ 720 }{ p^7 } \right] \\ \Rightarrow \qquad & \mathbb E \left( X^6 \right) = \frac{ p }{ q } \left( q \frac{ \partial }{ \partial q } \right)^6 \frac{ q }{ 1 - q } = - \frac{ 1 }{ p } + \frac{ 62 }{ p^2 } - \frac{ 540 }{ p^3 } + \frac{ 1560 }{ p^4 } - \frac{ 1800 }{ p^5 } + \frac{ 720 }{ p^6 } \\ \\ & \left( q \frac{ \partial }{ \partial q } \right)^7 \frac{ q }{ 1 - q } = q \left[ \frac{ 1 }{ p^2 } - \frac{ 126 }{ p^3 } + \frac{ 1860 }{ p^4 } - \frac{ 8400 }{ p^5 } + \frac{ 16800 }{ p^6 } - \frac{ 15120 }{ p^7 } + \frac{ 5040 }{ p^8 } \right] \\ \Rightarrow \qquad & \mathbb E \left( X^7 \right) = \frac{ p }{ q } \left( q \frac{ \partial }{ \partial q } \right)^7 \frac{ q }{ 1 - q } = \frac{ 1 }{ p } - \frac{ 126 }{ p^2 } + \frac{ 1860 }{ p^3 } - \frac{ 8400 }{ p^4 } + \frac{ 16800 }{ p^5 } - \frac{ 15120 }{ p^6 } + \frac{ 5040 }{ p^7 } \\ \\ & \left( q \frac{ \partial }{ \partial q } \right)^8 \frac{ q }{ 1 - q } = q \left[ - \frac{ 1 }{ p^2 } + \frac{ 254 }{ p^3 } - \frac{ 5796 }{ p^4 } + \frac{ 40824 }{ p^5 } - \frac{ 126000 }{ p^6 } + \frac{ 191520 }{ p^7 } - \frac{ 141120 }{ p^8 } + \frac{ 40320 }{ p^9 } \right] \\ \Rightarrow \qquad & \mathbb E \left( X^8 \right) = \frac{ p }{ q } \left( q \frac{ \partial }{ \partial q } \right)^8 \frac{ q }{ 1 - q } = - \frac{ 1 }{ p } + \frac{ 254 }{ p^2 } - \frac{ 5796 }{ p^3 } + \frac{ 40824 }{ p^4 } - \frac{ 126000 }{ p^5 } + \frac{ 191520 }{ p^6 } - \frac{ 141120 }{ p^7 } + \frac{ 40320 }{ p^8 } \end{align} $$
For a geometric distribution, $ X \sim \textrm{Geo}(p)$, $$ \begin{align} \mathbb E \left( X^n \right) = \sum_{x=1}^\infty x^n p q ^{x-1} \end{align} $$ $$ \begin{align} \mathbb E \left( X \right) &= \frac{ 1 }{ p } \\ \mathbb E \left( X^2 \right) &= - \frac{ 1 }{ p} + \frac{ 2 }{ p^2 } \\ \mathbb E \left( X^3 \right) &= \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \\ \mathbb E \left( X^4 \right) &= - \frac{ 1 }{ p } + \frac{ 14 }{ p^2 } - \frac{ 36 }{ p^3 } + \frac{ 24 }{ p^4 } \\ \mathbb E \left( X^5 \right) &= \frac{ 1 }{ p } - \frac{ 30 }{ p^2 } + \frac{ 150 }{ p^3 } - \frac{ 240 }{ p^4 } + \frac{ 120 }{ p^5 } \\ \mathbb E \left( X^6 \right) &= - \frac{ 1 }{ p } + \frac{ 62 }{ p^2 } - \frac{ 540 }{ p^3 } + \frac{ 1560 }{ p^4 } - \frac{ 1800 }{ p^5 } + \frac{ 720 }{ p^6 } \\ \mathbb E \left( X^7 \right) &= \frac{ 1 }{ p } - \frac{ 126 }{ p^2 } + \frac{ 1860 }{ p^3 } - \frac{ 8400 }{ p^4 } + \frac{ 16800 }{ p^5 } - \frac{ 15120 }{ p^6 } + \frac{ 5040 }{ p^7 } \\ \mathbb E \left( X^8 \right) &= - \frac{ 1 }{ p } + \frac{ 254 }{ p^2 } - \frac{ 5796 }{ p^3 } + \frac{ 40824 }{ p^4 } - \frac{ 126000 }{ p^5 } + \frac{ 191520 }{ p^6 } - \frac{ 141120 }{ p^7 } + \frac{ 40320 }{ p^8 } \end{align} $$
$$ \begin{align} \mathbb E \left( X \right) &= \frac{ 1 }{ p } \\ \mathbb E \left( X^2 \right) &= - \frac{ 1 }{ p} + \frac{ 2 }{ p^2 } \\ &= \frac{ 2 - p }{ p^2 } \\ \mathbb E \left( X^3 \right) &= \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \\ &= \frac{ p^2 - 6p + 6 }{ p^3 } \\ \mathbb E \left( X^4 \right) &= - \frac{ 1 }{ p } + \frac{ 14 }{ p^2 } - \frac{ 36 }{ p^3 } + \frac{ 24 }{ p^4 } \\ &= \frac{ ( 2 - p ) \left( 12 - 12 p + p^2 \right) }{ p^4 } \\ \mathbb E \left( X^5 \right) &= \frac{ 1 }{ p } - \frac{ 30 }{ p^2 } + \frac{ 150 }{ p^3 } - \frac{ 240 }{ p^4 } + \frac{ 120 }{ p^5 } \\ &= \frac{ p^4 - 30 p^3 + 150 p^2 - 240 p + 120 }{ p^5 } \\ \mathbb E \left( X^6 \right) &= - \frac{ 1 }{ p } + \frac{ 62 }{ p^2 } - \frac{ 540 }{ p^3 } + \frac{ 1560 }{ p^4 } - \frac{ 1800 }{ p^5 } + \frac{ 720 }{ p^6 } \\ &= \frac{ ( 2 - p ) \left( 360 - 720 p + 420 p^2 - 60 p^3 + p^4 \right) }{ p^6 } \\ \mathbb E \left( X^7 \right) &= \frac{ 1 }{ p } - \frac{ 126 }{ p^2 } + \frac{ 1860 }{ p^3 } - \frac{ 8400 }{ p^4 } + \frac{ 16800 }{ p^5 } - \frac{ 15120 }{ p^6 } + \frac{ 5040 }{ p^7 } \\ &= \frac{ p^6 - 126 p^5 + 1860 p^4 - 8400 p^3 + 16800 p^2 - 15120 p + 5040 }{ p^7 } \\ \mathbb E \left( X^8 \right) &= - \frac{ 1 }{ p } + \frac{ 254 }{ p^2 } - \frac{ 5796 }{ p^3 } + \frac{ 40824 }{ p^4 } - \frac{ 126000 }{ p^5 } + \frac{ 191520 }{ p^6 } - \frac{ 141120 }{ p^7 } + \frac{ 40320 }{ p^8 } \\ &= \frac{ ( 2 - p ) \left( 20160 - 60480 p + 65520 p^2 - 30240 p^3 + 5292 p^4 - 252 p^5 + p^6 \right) }{ p^8 } \end{align} $$
4.3. $ \mathbb E \left( X^2 \right) $ and variance
For variance, $$ \begin{align}\ \textrm{Var}( X ) &= \mathbb E \left[ (X - \mu)^2 \right] \\ &= \left\langle X^2 \right\rangle - \langle X \rangle^2 \\ &= \left( - \frac{ 1 }{ p } + \frac{ 2 }{ p^2 } \right) - \left( \frac1p \right)^2 \\ &= - \frac{1}{p} + \frac{1}{p^2} \\ &= \frac{ 1 - p }{p^2} \\ &= \frac{ q }{ p^2 } \end{align} $$Aside. An alternative way to evaluate $ \sum x^2 q^x $: $$ \begin{align} && S &= \sum_{x=1}^\infty x^2 q^x = q + 4 q^2 + 9 q^3 + 16 q^4 + \cdots \\ && q S &= \sum_{x=1}^\infty x^2 q^{x+1} = q^2 + 4 q^3 + 9 q^4 + 16 q^5 + \cdots \\ \\ &\Rightarrow & (1 - q) S &= q + 3 q^2 + 5 q^3 + 7 q^4 + \cdots = \sum_{x=1}^\infty (2x-1) q^x \\ && q (1 - q) S &= q^2 + 3 q^3 + 5 q^4 + 7 q^5 + \cdots = \sum_{x=1}^\infty (2x-1) q^{x+1} \\ \\ &\Rightarrow & (1 - q)^2 S &= q + 2 q^2 + 2 q^3 + 2 q^4 + \cdots = 2 \left( q + q^2 + q^3 + \cdots \right) - q = \frac{ 2q }{ 1 - q } - q = \frac{ 2q - q(1-q) }{ 1 - q } \\ &\Rightarrow & S &= \frac{ q (1 + q) }{ (1 - q)^3 } = \frac{ q ( 2 - p ) }{ p^3 } \qquad \checkmark \end{align} $$
4.4. $ \mathbb E \left( X^3 \right) $ and skewness
Recall: $$ \begin{align} \mathbb E \left( X \right) &= \frac{ 1 }{ p } \\ \mathbb E \left( X^2 \right) &= - \frac{ 1 }{ p} + \frac{ 2 }{ p^2 } \\ \mathbb E \left( X^3 \right) &= \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \\ \mathbb E \left( X^4 \right) &= - \frac{ 1 }{ p } + \frac{ 14 }{ p^2 } - \frac{ 36 }{ p^3 } + \frac{ 24 }{ p^4 } \\ \end{align} $$ The skewness is defined by $$ \begin{align} \mathbb E \left[ \left( \frac{ X - \mu }{ \sigma } \right)^3 \right] &= \mathbb E \left[ \frac{ X^3 - 3 \mu X^2 + 3 \mu^2 X - \mu^3 }{ \sigma^3 } \right] \\ &= \frac{ \left\langle X^3 \right\rangle - 3 \mu \left\langle X^2 \right\rangle + 2 \mu^3 }{ \sigma^3 } \end{align} $$ and thus $$ \begin{align} \mathbb E \left[ \left( \frac{ X - \mu }{ \sigma } \right)^3 \right] &= \frac{ \left\langle X^3 \right\rangle - 3 \mu \left\langle X^2 \right\rangle + 2 \mu^3 }{ \sigma^3 } \\ &= \frac{ \left( \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \right) - \frac{ 3 }{ p } \left( - \frac{ 1 }{ p} + \frac{ 2 }{ p^2 } \right) + \frac{ 2 }{ p^3 } } { \left( \frac{ q }{ p^2 } \right)^{ \frac32 } } \\ &= \frac{ \frac{ 2 - 3p + p^2 }{ p^3 } }{ \left( \frac{ q }{ p^2 } \right)^{ \frac32 } } \\ &= \frac{ ( 1 - p ) ( 2 - p ) }{ q^{ \frac32 } } \\ &= \frac{ 2 - p }{ \sqrt{ 1 - p }} \qquad \checkmark \end{align} $$4.5. $ \mathbb E \left( X^4 \right) $ and skewness
Recall: $$ \begin{align} \mathbb E \left( X \right) &= \frac{ 1 }{ p } \\ \mathbb E \left( X^2 \right) &= - \frac{ 1 }{ p} + \frac{ 2 }{ p^2 } \\ \mathbb E \left( X^3 \right) &= \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \\ \mathbb E \left( X^4 \right) &= - \frac{ 1 }{ p } + \frac{ 14 }{ p^2 } - \frac{ 36 }{ p^3 } + \frac{ 24 }{ p^4 } \\ \end{align} $$ The kurtosis is defined by $$ \begin{align} \mathbb E \left[ \left( \frac{ X - \mu }{ \sigma } \right)^4 \right] &= \mathbb E \left[ \frac{ X^4 - 4 \mu X^3 + 6 \mu^2 X^2 - 4 \mu^3 X + \mu^4 }{ \sigma^4 } \right] \\ &= \frac{ \left\langle X^4 \right\rangle - 4 \mu \left\langle X^3 \right\rangle + 6 \mu^2 \left\langle X^2 \right\rangle - 3 \mu^4 }{ \sigma^4 } \end{align} $$ and thus $$ \begin{align} \mathbb E \left[ \left( \frac{ X - \mu }{ \sigma } \right)^4 \right] &= \frac{ \left\langle X^4 \right\rangle - 4 \mu \left\langle X^3 \right\rangle + 6 \mu^2 \left\langle X^2 \right\rangle - 3 \mu^4 }{ \sigma^4 } \\ &= \frac{ \left( - \frac{ 1 }{ p } + \frac{ 14 }{ p^2 } - \frac{ 36 }{ p^3 } + \frac{ 24 }{ p^4 } \right) - \frac{ 4 }{ p } \left( \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \right) + \frac{ 6 }{ p^2 } \left( - \frac{ 1 }{ p} + \frac{ 2 }{ p^2 } \right) - \frac{ 3 }{ p^4 } }{ \frac{ q^2 }{ p^4 } } \\ &= \frac{ \frac{ 9 - 18 p + 10 p^2 - p^3 }{ p^4 } }{ \frac{ q^2 }{ p^4 } } \\ &= \frac{ ( 1 - p ) \left( 9 - 9 p + p^2 \right) }{ (1 - p)^2 } \\ &= \frac{ 9 - 9 p + p^2 }{ 1 - p } \\ &= 9 + \frac{ p^2 }{ 1 - p } \qquad \checkmark \end{align} $$5. Using moment generating function
5.1 Series expansion
As we Taylor-expand $ M_X(t) $, $$ \begin{align} M_X(t) &= \frac{ p \textrm{e}^{t} }{ 1 - q \textrm{e}^{t} } \\ &= p \textrm{e}^{t} \left( 1 - q \textrm{e}^{t} \right)^{ -1 } \\ &= p \left( \sum_{n=0}^\infty \frac{ t^n }{ n! } \right) \Big[ 1 + q \textrm{e}^{t} + q^2 \textrm{e}^{2t} + q^3 \textrm{e}^{3t} + \cdots \Big] \\ &= p \left( \sum_{n=0}^\infty \frac{ t^n }{ n! } \right) \left[ \sum_{k=0}^\infty \left( q \textrm{e}^{t} \right)^k \right] \\ &= p \left( 1 + t + \frac{t^2}{2!} + \frac{t^3}{3!} + \frac{t^4}{4!} + \cdots \right) \\ &\quad \times \bigg[ 1 + q \left( 1 + t + \frac{t^2}{2!} + \frac{t^3}{3!} + \frac{t^4}{4!} + \cdots \right) \\ &\qquad + q^2 \left( 1 + 2t + \frac{2^2 t^2}{2!} + \frac{2^3 t^3}{3!} + \frac{2^4 t^4}{4!} + \cdots \right) \\ &\qquad + q^3 \left( 1 + 3t + \frac{3^2 t^2}{2!} + \frac{3^3 t^3}{3!} + \frac{3^4 t^4}{4!} + \cdots \right) \\ &\qquad + q^4 \left( 1 + 4t + \frac{4^2 t^2}{2!} + \frac{4^3 t^3}{3!} + \frac{4^4 t^4}{4!} + \cdots \right) + \cdots \bigg] \\ &= p \left( 1 + t + \frac{t^2}{2!} + \frac{t^3}{3!} + \frac{t^4}{4!} + \cdots \right) \\ & \qquad \times \left[ \left( \sum_{k=0}^\infty q^k \right) + \left( \sum_{k=0}^\infty kq^k \right) t + \left( \sum_{k=0}^\infty k^2q^k \right) \frac{ t^2 }{ 2! } + \left( \sum_{k=0}^\infty k^3q^k \right) \frac{ t^3 }{ 3! } + \left( \sum_{k=0}^\infty k^4q^k \right) \frac{ t^4 }{ 4! } + \cdots \right] \end{align} $$ Note that: $$ \begin{align} \sum_{k=0}^\infty q^k &= \frac1{ 1 - q } \\ \sum_{k=0}^\infty kq^k &= \left( q \frac{ \partial }{ \partial q } \right) \sum_{k=0}^\infty q^k = \frac{ q }{ (1 - q)^2 } = - \frac{ 1 }{ (1 - q) } + \frac{ 1 }{ (1 - q)^2 } \\ \sum_{k=0}^\infty k^2q^k &= \left( q \frac{ \partial }{ \partial q } \right)^2 \sum_{k=0}^\infty q^k = \frac{ q ( 1 + q ) }{ (1 - q)^3 } = \frac{ 1 }{ (1 - q) } - \frac{ 3 }{ (1 - q)^2 } + \frac{ 2 }{ (1 - q)^3 } \\ \sum_{k=0}^\infty k^3q^k &= \left( q \frac{ \partial }{ \partial q } \right)^3 \sum_{k=0}^\infty q^k = \frac{ q \left( 1 + 4q + q^2 \right) }{ (1 - q)^4 } = - \frac{ 1 }{ (1 - q) } + \frac{ 7 }{ (1 - q)^2 } - \frac{ 12 }{ (1 - q)^3 } + \frac{ 6 }{ (1 - q)^4 } \\ \sum_{k=0}^\infty k^4q^k &= \left( q \frac{ \partial }{ \partial q } \right)^4 \sum_{k=0}^\infty q^k = \frac{ q \left( 1 + 11q + 11q^2 + q^3 \right) }{ (1 - q)^5 } = \frac{ 1 }{ (1 - q) } - \frac{ 15 }{ (1 - q)^2 } + \frac{ 50 }{ (1 - q)^3 } - \frac{ 60 }{ (1 - q)^4 } + \frac{ 24 }{ (1 - q)^5 } \end{align} $$ We find: $$ \begin{align} \Rightarrow \qquad M_X(t) &= p \left( 1 + t + \frac{t^2}{2!} + \frac{t^3}{3!} + \frac{t^4}{4!} + \cdots \right) \\ &\qquad \times \left[ \frac1{ 1 - q } + \left( \frac{ q }{ (1 - q)^2 } \right) t + \left( \frac{ q ( 1 + q ) }{ (1 - q)^3 } \right) \frac{ t^2 }{ 2! } + \left( \frac{ q \left( 1 + 4q + q^2 \right) }{ (1 - q)^4 } \right) \frac{ t^3 }{ 3! } + \left( \frac{ q \left( 1 + 11q + 11q^2 + q^3 \right) }{ (1 - q)^5 } \right) \frac{ t^4 }{ 4! } + \cdots \right] \\ &= \frac{ p }{ 1 - q } + p \left( \frac1{ 1 - q } + \frac{ q }{ (1 - q)^2 } \right) t + p \left( \frac1{ (1 - q) } + \frac{ 2! q }{ (1 - q)^2 } + \frac{ q ( 1 + q ) }{ (1 - q)^3 } \right) \frac{ t^2 }{ 2! } \\ &\qquad + p \left( \frac1{ (1 - q) } + \frac{ 3! q }{ 2! (1 - q)^2 } + \frac{ 3! q ( 1 + q ) }{ 2! (1 - q)^3 } + \frac{ q \left( 1 + 4q + q^2 \right) }{ (1 - q)^4 } \right) \frac{ t^3 }{ 3! } \\ &\qquad + p \left( \frac1{ (1 - q) } + \frac{ 4! q }{ 3!(1 - q)^2 } + \frac{ 4! q ( 1 + q ) }{ 2!2!(1 - q)^3 } + \frac{ 4! q \left( 1 + 4q + q^2 \right) }{ 3!(1 - q)^4 } + \frac{ q \left( 1 + 11q + 11q^2 + q^3 \right) }{ (1 - q)^5 } \right) \frac{ t^4 }{ 4! } + \cdots \\ &= \frac{ p }{ 1 - q } + \frac{ p }{ (1 - q)^2 } t + \frac{ p (1 + q) }{ (1 - q)^3 } \frac{ t^2 }{ 2! } + \frac{ p \left( 1 + 4q + q^2 \right) }{ (1 - q)^4 } \frac{ t^3 }{ 3! } + \frac{ p (1 + q) \left( 1 + 10q + q^2 \right) }{ (1 - q)^5 } \frac{ t^4 }{ 4! } + \cdots \\ &= 1 + \frac{ 1 }{ p } t + \frac{ (2 - p) }{ p^2 } \frac{ t^2 }{ 2! } + \frac{ \left( 6 - 6p + p^2 \right) }{ p^3 } \frac{ t^3 }{ 3! } + \frac{ (2 - p) \left( 12 - 12p + p^2 \right) }{ p^4 } \frac{ t^4 }{ 4! } + \cdots \\ &= 1 + \frac{ 1 }{ p } t + \left( - \frac{ 1 }{ p } + \frac{ 2 }{ p^2 } \right) \frac{ t^2 }{ 2! } + \left( \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \right) \frac{ t^3 }{ 3! } + \left( - \frac{ 1 }{ p } + \frac{ 14 }{ p^2 } - \frac{ 36 }{ p^3 } + \frac{ 24 }{ p^4 } \right) \frac{ t^4 }{ 4! } + \cdots \end{align} $$ which yields: $$ \begin{align} \left\langle X \right\rangle &= \frac{ 1 }{ p } \\ \left\langle X^2 \right\rangle &= \frac{ (2 - p) }{ p^2 } = - \frac{ 1 }{ p } + \frac{ 2 }{ p^2 } \\ \left\langle X^3 \right\rangle &= \frac{ 6 - 6p + p^2 }{ p^3 } = \frac{ 1 }{ p } - \frac{ 6 }{ p^2 } + \frac{ 6 }{ p^3 } \\ \left\langle X^4 \right\rangle &= \frac{ (2 - p) \left( 12 - 12p + p^2 \right) }{ p^4 } = - \frac{ 1 }{ p } + \frac{ 14 }{ p^2 } - \frac{ 36 }{ p^3 } + \frac{ 24 }{ p^4 } \\ \left\langle X^5 \right\rangle &= \frac{ 120 - 240 p + 150 p^2 - 30 p^3 + p^4 }{ p^5 } \\ &= \frac{ 1 }{ p } - \frac{ 30 }{ p^2 } + \frac{ 150 }{ p^3 } - \frac{ 240 }{ p^4 } + \frac{ 120 }{ p^5 } \\ \left\langle X^6 \right\rangle &= \frac{ (2 - p) \left( 360 - 720 p + 420 p^2 - 60 p^3 + p^4 \right) }{ p^6 } \\ &= - \frac{ 1 }{ p } + \frac{ 62 }{ p^2 } - \frac{ 540 }{ p^3 } + \frac{ 1560 }{ p^4 } - \frac{ 1800 }{ p^5 } + \frac{ 720 }{ p^6 } \\ \left\langle X^7 \right\rangle &= \frac{ 5040 - 15120 p + 16800 p^2 - 8400 p^3 + 1806 p^4 - 126 p^5 + p^6 }{ p^7 } \\ &= \frac{ 1 }{ p } - \frac{ 126 }{ p^2 } + \frac{ 1860 }{ p^3 } - \frac{ 8400 }{ p^4 } + \frac{ 16800 }{ p^5 } - \frac{ 15120 }{ p^6 } + \frac{ 5040 }{ p^7 } \\ \left\langle X^8 \right\rangle &= \frac{ (2 - p) \left( 20160 - 60480 p + 65520 p^2 - 30240 p^3 + 5292 p^4 - 252 p^5 + p^6 \right) }{ p^8 } \\ &= - \frac{ 1 }{ p } + \frac{ 254 }{ p^2 } - \frac{ 5796 }{ p^3 } + \frac{ 40824 }{ p^4 } - \frac{ 126000 }{ p^5 } + \frac{ 191520 }{ p^6 } - \frac{ 141120 }{ p^7 } + \frac{ 40320 }{ p^8 } \end{align} $$5.2 Derivatives of MGF
$$ \begin{align} \left\langle X^n \right\rangle = \left. \frac{ \textrm d^n M_X(t) }{ \textrm dt^n } \right\vert_{ t = 0 } = M^{ (n) }_X(0) \end{align} $$ We find the derivatives: $$ \begin{align} M_X(t) &= \frac{ p \textrm{e}^{t} }{ 1 - q \textrm{e}^{t} } \\ \\ \frac{ \textrm d }{ \textrm dt } M_X(t) &= \frac{ \textrm d }{ \textrm dt } \left( \frac{ p \textrm{e}^{t} }{ 1 - q \textrm{e}^{t} } \right) \\ &= \frac{ p \textrm{e}^{t} \left( 1 - q \textrm{e}^{t} \right) + p \textrm{e}^{ t } \cdot q \textrm{e}^{ t } }{ \left( 1 - q \textrm{e}^{t} \right)^2 } \\ &= \frac{ p \textrm{e}^{t} }{ \left( 1 - q \textrm{e}^{t} \right)^2 } \\ \\ \frac{ \textrm d^2 }{ \textrm dt^2 } M_X(t) &= \frac{ \textrm d }{ \textrm dt } \left( \frac{ p \textrm{e}^{t} }{ \left( 1 - q \textrm{e}^{t} \right)^2 } \right) \\ &= \frac{ p \textrm{e}^{t} \left( 1 - q \textrm{e}^{t} \right)^2 + 2 p \textrm{e}^{t} \cdot q \textrm{e}^{t} \left( 1 - q \textrm{e}^{t} \right) }{ \left( 1 - q \textrm{e}^{t} \right)^4 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 - q \textrm{e}^{t} \right) + 2 p \textrm{e}^{t} \cdot q \textrm{e}^{t} }{ \left( 1 - q \textrm{e}^{t} \right)^3 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) }{ \left( 1 - q \textrm{e}^{t} \right)^3 } \\ \\ \frac{ \textrm d^3 }{ \textrm dt^3 } M_X(t) &= \frac{ \textrm d }{ \textrm dt } \left( \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) }{ \left( 1 - q \textrm{e}^{t} \right)^3 } \right) \\ &= \frac{ \left[ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) + p \textrm{e}^{t} \cdot q \textrm{e}^{t} \right] \left( 1 - q \textrm{e}^{t} \right)^3 + 3 p \textrm{e}^{t} \cdot q \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) \left( 1 - q \textrm{e}^{t} \right)^2 }{ \left( 1 - q \textrm{e}^{t} \right)^6 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + 2 q \textrm{e}^{t} \right) \left( 1 - q \textrm{e}^{t} \right) + 3 p \textrm{e}^{t} \cdot q \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) }{ \left( 1 - q \textrm{e}^{t} \right)^4 } \\ &= \frac{ p \textrm{e}^{t} \left[ \left( 1 + 2 q \textrm{e}^{t} \right) \left( 1 - q \textrm{e}^{t} \right) + 3 q \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) \right] }{ \left( 1 - q \textrm{e}^{t} \right)^4 } \\ &= \frac{ p \textrm{e}^{t} \left[ \left( 1 + q \textrm{e}^{t} - 2q^2 \textrm{e}^{ 2t } \right) + \left( 3 q \textrm{e}^{t} + 3 q^2 \textrm{e}^{ 2t } \right) \right] }{ \left( 1 - q \textrm{e}^{t} \right)^4 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + 4 q \textrm{e}^{t} + q^2 \textrm{e}^{ 2t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^4 } \\ \\ \frac{ \textrm d^4 }{ \textrm dt^4 } M_X(t) &= \frac{ \textrm d }{ \textrm dt } \left( \frac{ p \textrm{e}^{t} \left( 1 + 4 q \textrm{e}^{t} + q^2 \textrm{e}^{ 2t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^4 } \right) \\ &= \frac{ \left[ p \textrm{e}^{t} \left( 1 + 4 q \textrm{e}^{t} + q^2 \textrm{e}^{ 2t } \right) + p \textrm{e}^{t} \left( 4 q \textrm{e}^{t} + 2 q^2 \textrm{e}^{ 2t } \right) \right] \left( 1 - q \textrm{e}^{t} \right)^4 }{ \left( 1 - q \textrm{e}^{t} \right)^8 } \\ &\qquad + \frac{ p \textrm{e}^{t} \cdot 4 q \textrm{e}^{t} \left( 1 + 4 q \textrm{e}^{t} + q^2 \textrm{e}^{ 2t } \right) \left( 1 - q \textrm{e}^{t} \right)^3 }{ \left( 1 - q \textrm{e}^{t} \right)^8 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + 8 q \textrm{e}^{t} + 3 q^2 \textrm{e}^{ 2t } \right) \left( 1 - q \textrm{e}^{t} \right) + p \textrm{e}^{t} \cdot 4 q \textrm{e}^{t} \left( 1 + 4 q \textrm{e}^{t} + q^2 \textrm{e}^{ 2t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^5 } \\ &= \frac{ p \textrm{e}^{t} \left[ \left( 1 + 7 q \textrm{e}^{t} - 5 q^2 \textrm{e}^{ 2t } - 3 q^3 \textrm{e}^{ 3t } \right) + \left( 4 q \textrm{e}^{t} + 16 q^2 \textrm{e}^{ 2t } + 4 q^3 \textrm{e}^{ 3t } \right) \right] }{ \left( 1 - q \textrm{e}^{t} \right)^5 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + 11 q \textrm{e}^{t} + 11 q^2 \textrm{e}^{ 2t } + q^3 \textrm{e}^{ 3t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^5 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) \left( 1 + 10 q \textrm{e}^{t} +11 q^2 \textrm{e}^{ 2t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^5 } \\ \\ \frac{ \textrm d^5 }{ \textrm dt^5 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 26 q \textrm{e}^{t} + 66 q^2 \textrm{e}^{ 2t } + 26 q^3 \textrm{e}^{ 3t } + q^4 \textrm{e}^{ 4t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^6 } \\ \\ \frac{ \textrm d^6 }{ \textrm dt^6 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 57 q \textrm{e}^{t} + 302 q^2 \textrm{e}^{ 2t } + 302 q^3 \textrm{e}^{ 3t } + 57 q^4 \textrm{e}^{ 4t } + q^5 \textrm{e}^{ 5t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^7 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) \left( 1 + 56 q \textrm{e}^{t} + 246 q^2 \textrm{e}^{ 2t } + 56 q^3 \textrm{e}^{ 3t } + q^4 \textrm{e}^{ 4t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^7 } \\ \\ \frac{ \textrm d^7 }{ \textrm dt^7 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 120 q \textrm{e}^{t} + 1191 q^2 \textrm{e}^{ 2t } + 2416 q^3 \textrm{e}^{ 3t } + 1191 q^4 \textrm{e}^{ 4t } + 120 q^5 \textrm{e}^{ 5t } + q^6 \textrm{e}^{ 6t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^8 } \\ \\ \frac{ \textrm d^8 }{ \textrm dt^8 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 247 q \textrm{e}^{t} + 4293 q^2 \textrm{e}^{ 2t } + 15619 q^3 \textrm{e}^{ 3t } + 15619 q^4 \textrm{e}^{ 4t } + 4293 q^5 \textrm{e}^{ 5t } + 247 q^6 \textrm{e}^{ 6t } + q^7 \textrm{e}^{ 7t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^9 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) \left( 1 + 246 q \textrm{e}^{t} + 4047 q^2 \textrm{e}^{ 2t } + 11572 q^3 \textrm{e}^{ 3t } + 4047 q^4 \textrm{e}^{ 4t } + 246 q^5 \textrm{e}^{ 5t } + q^6 \textrm{e}^{ 6t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^9 } \end{align} $$In summary, $$ \begin{align} M_X(t) &= \frac{ p \textrm{e}^{t} }{ 1 - q \textrm{e}^{t} } \\ \\ \frac{ \textrm d }{ \textrm dt } M_X(t) &= \frac{ p \textrm{e}^{t} }{ \left( 1 - q \textrm{e}^{t} \right)^2 } \\ \\ \frac{ \textrm d^2 }{ \textrm dt^2 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) }{ \left( 1 - q \textrm{e}^{t} \right)^3 } \\ \\ \frac{ \textrm d^3 }{ \textrm dt^3 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 4 q \textrm{e}^{t} + q^2 \textrm{e}^{ 2t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^4 } \\ \\ \frac{ \textrm d^4 }{ \textrm dt^4 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 11 q \textrm{e}^{t} + 11 q^2 \textrm{e}^{ 2t } + q^3 \textrm{e}^{ 3t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^5 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) \left( 1 + 10 q \textrm{e}^{t} +11 q^2 \textrm{e}^{ 2t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^5 } \\ \\ \frac{ \textrm d^5 }{ \textrm dt^5 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 26 q \textrm{e}^{t} + 66 q^2 \textrm{e}^{ 2t } + 26 q^3 \textrm{e}^{ 3t } + q^4 \textrm{e}^{ 4t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^6 } \\ \\ \frac{ \textrm d^6 }{ \textrm dt^6 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 57 q \textrm{e}^{t} + 302 q^2 \textrm{e}^{ 2t } + 302 q^3 \textrm{e}^{ 3t } + 57 q^4 \textrm{e}^{ 4t } + q^5 \textrm{e}^{ 5t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^7 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) \left( 1 + 56 q \textrm{e}^{t} + 246 q^2 \textrm{e}^{ 2t } + 56 q^3 \textrm{e}^{ 3t } + q^4 \textrm{e}^{ 4t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^7 } \\ \\ \frac{ \textrm d^7 }{ \textrm dt^7 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 120 q \textrm{e}^{t} + 1191 q^2 \textrm{e}^{ 2t } + 2416 q^3 \textrm{e}^{ 3t } + 1191 q^4 \textrm{e}^{ 4t } + 120 q^5 \textrm{e}^{ 5t } + q^6 \textrm{e}^{ 6t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^8 } \\ \\ \frac{ \textrm d^8 }{ \textrm dt^8 } M_X(t) &= \frac{ p \textrm{e}^{t} \left( 1 + 247 q \textrm{e}^{t} + 4293 q^2 \textrm{e}^{ 2t } + 15619 q^3 \textrm{e}^{ 3t } + 15619 q^4 \textrm{e}^{ 4t } + 4293 q^5 \textrm{e}^{ 5t } + 247 q^6 \textrm{e}^{ 6t } + q^7 \textrm{e}^{ 7t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^9 } \\ &= \frac{ p \textrm{e}^{t} \left( 1 + q \textrm{e}^{t} \right) \left( 1 + 246 q \textrm{e}^{t} + 4047 q^2 \textrm{e}^{ 2t } + 11572 q^3 \textrm{e}^{ 3t } + 4047 q^4 \textrm{e}^{ 4t } + 246 q^5 \textrm{e}^{ 5t } + q^6 \textrm{e}^{ 6t } \right) }{ \left( 1 - q \textrm{e}^{t} \right)^9 } \end{align} $$
Evaluating the derivatives at $ t = 0 $ yield moments: $$ \begin{align} \left\langle X \right\rangle = M'_X(0) &= \frac{ p }{ \left( 1 - q \right)^2 } = \frac1p \\ \\ \left\langle X^2 \right\rangle = M''_X(0) &= \frac{ 1 + q }{ p^2 } \\ \\ \left\langle X^3 \right\rangle = M^{ (3) }_X(0) &= \frac{ 1 + 4 q + q^2 }{ p^3 } \\ \\ \left\langle X^4 \right\rangle = M^{ (4) }_X(0) &= \frac{ \left( 1 + 11 q + 11 q^2 + q^3 \right) }{ p^4 } \\ &= \frac{ \left( 1 + q \right) \left( 1 + 10 q + 11 q^2 \right) }{ p^4 } \\ \\ \left\langle X^5 \right\rangle = M^{ (5) }_X(0) &= \frac{ 1 + 26 q + 66 q^2 + 26 q^3 + q^4 }{ p^5 } \\ \\ \left\langle X^6 \right\rangle = M^{ (6) }_X(0) &= \frac{ 1 + 57 q + 302 q^2 + 302 q^3 + 57 q^4 + q^5 }{ p^6 } \\ &= \frac{ \left( 1 + q \right) \left( 1 + 56 q + 246 q^2 + 56 q^3 + q^4 \right) }{ p^6 } \\ \\ \left\langle X^7 \right\rangle = M^{ (7) }_X(0) &= \frac{ \left( 1 + 120 q + 1191 q^2 + 2416 q^3 + 1191 q^4 + 120 q^5 + q^6 \right) }{ p^7 } \\ \\ \left\langle X^8 \right\rangle = M^{ (8) }_X(0) &= \frac{ \left( 1 + 247 q + 4293 q^2 + 15619 q^3 + 15619 q^4 + 4293 q^5 + 247 q^6 + q^7 \right) }{ p^8 } \\ &= \frac{ \left( 1 + q \right) \left( 1 + 246 q + 4047 q^2 + 11572 q^3 + 4047 q^4 + 246 q^5 + q^6 \right) }{ p^8 } \end{align} $$
6. Central moments
The central moments are the moments about the mean value, i.e. $$ \begin{align} \mu_n = \mathbb E \left[ (X-\mu)^n \right] = \sum_{x} (x-\mu)^n \mathbb P(x) \end{align} $$ For a geometric distribution, $ X \sim \textrm{Geo}(p) $, $$ \begin{align} \mu_n = \mathbb E \left[ (X-\mu)^n \right] &= \sum_{x=1}^\infty (x-\mu)^n pq^{x-1} \\ &= \sum_{x=1}^\infty (x-\mu)^n pq^{x-\mu+\mu-1} \\ &= pq^{\mu-1} \sum_{x=1}^\infty (x-\mu)^n q^{x-\mu} \\ &= pq^{\mu-1} \left( q \frac{ \partial }{ \partial q } \right)^n \sum_{x=1}^\infty q^{x-\mu} \\ &= pq^{\mu-1} \left( q \frac{ \partial }{ \partial q } \right)^n \frac{ q^{1 - \mu} }{ 1 - q } \end{align} $$ We note that: $$ \begin{align} \left( q \frac{ \partial }{ \partial q } \right) \frac{ q^{1 - \mu} }{ 1 - q } &= \frac{ (1-\mu) q^{1-\mu }}{ 1-q } + \frac{ q^{2-\mu} }{ (1-q)^2 } \\ &= \frac{ q^{1-\mu} [ - \mu (1-q) + 1 ] }{ (1-q)^2 } \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^2 \frac{ q^{1 - \mu} }{ 1 - q } &= \frac{ (1 - \mu)^2 q^{1-\mu} }{ 1-q } + \frac{ (3 - 2\mu) q^{2-\mu} }{ (1-q)^2 } + \frac{ 2 q^{3-\mu} }{ (1-q)^3 } \\ &= \frac{ q^{1-\mu} \left[ \mu^2 (1-q)^2 - 2\mu (1-q) + (1+q) \right] }{ (1-q)^3 } \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^3 \frac{ q^{1 - \mu} }{ 1 - q } &= \frac{ (1 - \mu)^3 q^{1-\mu} }{ 1-q } + \frac{ \left( 7 - 9 \mu + 3 \mu^2 \right) q^{2-\mu} }{ (1-q)^2 } + \frac{ 6 ( 2 - \mu ) q^{3-\mu} }{ (1-q)^3 } + \frac{ 6 q^{4-\mu} }{ (1-q)^4 } \\ &= \frac{ q^{1-\mu} \left[ - \mu^3 (1-q)^3 + 3 \mu^2 (1-q)^2 - 3\mu (1+q)(1-q) + \left( 1 + 4q + q^2 \right) \right] }{ (1-q)^4 } \\ \\ \left( q \frac{ \partial }{ \partial q } \right)^4 \frac{ q^{1 - \mu} }{ 1 - q } &= \frac{ (1 - \mu)^4 q^{1-\mu} }{ 1-q } + \frac{ \left( 15 - 28 \mu + 18 \mu^2 - 4 \mu^3 \right) q^{2-\mu} }{ (1-q)^2 } + \frac{ 2 \left( 25 - 24 \mu + 6 \mu^2 \right) q^{3-\mu} }{ (1-q)^3 } + \frac{ 12 ( 5 - 2 \mu ) q^{4-\mu} }{ (1-q)^4 } + \frac{ 24 q^{5-\mu} }{ (1-q)^4 } \\ &= \frac{ q^{1-\mu} \left[ \mu^4 (1-q)^4 - 4 \mu^3 (1-q)^3 + 6 \mu^2 (1+q)(1-q)^2 - 4 \mu \left(1 + 4q +q^2 \right)(1-q) + (1+q) \left( 1 + 10q + q^2 \right) \right] }{ (1-q)^5 } \end{align} $$ and, noting that $ \mu (1-q) = \frac{1}{p} \times p = 1 $, $$ \begin{align} \mu_1 &= \left\langle (X-\mu) \right\rangle \\ &= \frac{ p [ - \mu (1-q) + 1 ] }{ (1-q)^2 } = 0 \\ \\ \mu_2 &= \left\langle (X-\mu)^2 \right\rangle \\ &= \frac{ p \left[ \mu^2 (1-q)^2 - 2 \mu (1-q) + (1+q) \right] }{ (1-q)^3 } \\ &= \frac{ p \left[ 1 - 2 + (1+q) \right] }{ p^3 } \\ &= \frac{ q }{ p^2 } \\ &= \frac{ 1-p }{ p^2 } \\ \\ \mu_3 &= \left\langle (X-\mu)^3 \right\rangle \\ &= \frac{ p \left[ - \mu^3 (1-q)^3 + 3 \mu^2 (1-q)^2 - 3\mu (1+q)(1-q) + \left( 1 + 4q + q^2 \right) \right] }{ (1-q)^4 } \\ &= \frac{ p \left[ - 1 + 3 - 3 (1+q) + \left( 1 + 4q + q^2 \right) \right] }{ p^4 } \\ &= \frac{ - 1 -3q + \left( 1 + 4q + q^2 \right) }{ p^3 } \\ &= \frac{ q + q^2 }{ p^3 } \\ &= \frac{ (1-p)(2-p) }{ p^3 } \\ \\ \mu_4 &= \left\langle (X-\mu)^4 \right\rangle \\ &= \frac{ p \left[ \mu^4 (1-q)^4 - 4 \mu^3 (1-q)^3 + 6 \mu^2 (1+q)(1-q)^2 - 4 \mu \left(1 + 4q +q^2 \right)(1-q) + (1+q) \left( 1 + 10q + q^2 \right) \right] }{ (1-q)^5 } \\ &= \frac{ p \left[ 1 - 4 + 6 (1+q) - 4 \left(1 + 4q +q^2 \right) + \left( 1 + 11q + 11q^2 + q^3 \right) \right] }{ p^5 } \\ &= \frac{ q + 7q^2 + q^3 }{ p^4 } \\ &= \frac{ 9 - 18 p + 10 p^2 - p^3 }{ p^4 } \\ &= \frac{ (1-p) \left( 9 - 9p + p^2 \right) }{ p^4 } \\ \end{align} $$ In addition, $$ \begin{align} \mu_5 &= \left\langle (X-\mu)^5 \right\rangle = \frac{ (1-p)(2-p) \left( p^2 - 22p + 22 \right) }{ p^5 } \\ \mu_6 &= \left\langle (X-\mu)^6 \right\rangle = \frac{ (1-p) \left( p^4 - 55 p^3 + 320 p^2 - 530 p + 265 \right) }{ p^6 } \\ \mu_7 &= \left\langle (X-\mu)^7 \right\rangle = \frac{ (1-p)(2-p) \left( p^4 - 116 p^3 + 1043 p^2 - 1854 p + 927 \right) }{ p^7 } \\ \mu_8 &= \left\langle (X-\mu)^8 \right\rangle = \frac{ (1-p) \left( p^6 - 245 p^5 + 4571 p^4 - 23485 p^3 + 48825 p^2 - 44499 p + 14833 \right) }{ p^8 } \\ \end{align} $$7. Standardised moments
$$ \begin{align} \mathbb E \left[ \left( \frac{ X-\mu }{ \sigma } \right)^n \right] = \sum_{x=1}^\infty \left( \frac{ X-\mu }{ \sigma } \right)^n \mathbb P(x) \end{align} $$$$ \begin{align} \mathbb E \left[ \frac{ X-\mu }{ \sigma } \right] &= \frac{ \mu_1 }{ \sqrt{ \mu_2 } } = 0 \\ \mathbb E \left[ \left( \frac{ X-\mu }{ \sigma } \right)^2 \right] &= \frac{ \mu_2 }{ \mu_2 } = 1 \\ \mathbb E \left[ \left( \frac{ X-\mu }{ \sigma } \right)^3 \right] &= \frac{ \mu_3 }{ \mu_2^{\frac32} } = \frac{ (1-p)(2-p) }{ p^3 } \cdot \frac{ p^3 }{ (1-p)^{\frac32} } = \frac{ 2 - p }{ \sqrt{ 1 - p } } \\ \mathbb E \left[ \left( \frac{ X-\mu }{ \sigma } \right)^4 \right] &= \frac{ \mu_4 }{ \mu_2^2 } = \frac{ (1-p) \left( 9 - 9p + p^2 \right) }{ p^4 } \cdot \frac{ p^4 }{ (1-p)^2 } = \frac{ 9 - 9p + p^2 }{ 1 - p } = 9 + \frac{ p^2 }{ 1 - p } \\ \mathbb E \left[ \left( \frac{ X-\mu }{ \sigma } \right)^5 \right] &= \frac{ \mu_5 }{ \mu_2^{\frac52} } = \frac{ (1-p)(2-p) \left( p^2 - 22p + 22 \right) }{ p^5 } \cdot \frac{ p^5 }{ (1-p)^{\frac52} } \\ &= \frac{ (2-p) \left( p^2 - 22p + 22 \right) }{ (1-p)^{\frac32} } \\ \mathbb E \left[ \left( \frac{ X-\mu }{ \sigma } \right)^6 \right] &= \frac{ \mu_6 }{ \mu_2^3 } = \frac{ (1-p) \left( p^4 - 55 p^3 + 320 p^2 - 530 p + 265 \right) }{ p^6 } \cdot \frac{ p^6 }{ (1-p)^3 } \\ &= \frac{ p^4 - 55 p^3 + 320 p^2 - 530 p + 265 }{ (1-p)^2 } \\ \mathbb E \left[ \left( \frac{ X-\mu }{ \sigma } \right)^7 \right] &= \frac{ \mu_7 }{ \mu_2^{\frac72} } = \frac{ (1-p)(2-p) \left( p^4 - 116 p^3 + 1043 p^2 - 1854 p + 927 \right) }{ p^7 } \cdot \frac{ p^7 }{ (1-p)^{\frac72} } \\ &= \frac{ (2-p) \left( p^4 - 116 p^3 + 1043 p^2 - 1854 p + 927 \right) }{ (1-p)^{\frac52} } \\ \mathbb E \left[ \left( \frac{ X-\mu }{ \sigma } \right)^8 \right] &= \frac{ \mu_8 }{ \mu_2^4 } = \frac{ (1-p) \left( p^6 - 245 p^5 + 4571 p^4 - 23485 p^3 + 48825 p^2 - 44499 p + 14833 \right) }{ p^8 } \cdot \frac{ p^8 }{ (1-p)^4 } \\ &= \frac{ p^6 - 245 p^5 + 4571 p^4 - 23485 p^3 + 48825 p^2 - 44499 p + 14833 }{ (1-p)^3 } \\ \end{align} $$
반응형
'A-level Further Maths > Further Statistics 1' 카테고리의 다른 글
FS1 Mean and variance of a normal distribution (0) | 2022.09.23 |
---|
Comments