PDF version

PMF

Suppose that independent trials, each having a probability $p$, $0 < p < 1$, of being a success, are performed until a success occurs. If we let $X$ equal the number of failures required, then the geometric distribution mass function is $$f(x; p) =\Pr(X=x) = (1-p)^{x}p$$ for $x=0, 1, 2, \cdots$.

Proof:

$$ \begin{align*} \sum_{x=0}^{\infty}f(x; p) &= \sum_{x=0}^{\infty}(1-p)^{x}p\\ &= p\sum_{x=0}^{\infty}(1-p)^{x}\\ & = p\cdot {1\over 1-(1-p)}\\ & = 1 \end{align*} $$

Mean

The expected value is $$\mu = E[X] = {1-p\over p}$$

Proof:

Firstly, we know that $$\sum_{x=0}^{\infty}p^x = {1\over 1-p}$$ where $0 < p < 1$. Thus $$ \begin{align*} {d\over dp}\sum_{x=0}^{\infty}p^x &= \sum_{x=1}^{\infty}xp^{x-1}\\ &= {1\over(1-p)^2} \end{align*} $$ The expected value is $$ \begin{align*} E[X] &= \sum_{x=0}^{\infty}x(1-p)^{x}p\\ &=p(1-p)\sum_{x=1}^{\infty}x(1-p)^{x-1}\\ &= p(1-p){1\over(1-(1-p))^2}\\ &= {1-p\over p} \end{align*} $$

Variance

The variance is $$\sigma^2 = \mbox{Var}(X) = {1-p\over p^2}$$

Proof:

$$ \begin{align*} E\left[X^2\right] &=\sum_{x=0}^{\infty}x^2(1-p)^{x}p\\ &= (1-p)\sum_{x=1}^{\infty}x^2(1-p)^{x-1}p \end{align*} $$ Rewrite the right hand summation as $$ \begin{align*} \sum_{x=1}^{\infty} x^2(1-p)^{x-1}p&= \sum_{x=1}^{\infty} (x-1+1)^2(1-p)^{x-1}p\\ &= \sum_{x=1}^{\infty} (x-1)^2(1-p)^{x-1}p + \sum_{x=1}^{\infty} 2(x-1)(1-p)^{x-1}p + \sum_{x=1}^{\infty} (1-p)^{x-1}p\\ &= E\left[X^2\right] + 2E[X] + 1\\ &= E\left[X^2\right] + {2-p\over p} \end{align*} $$ Thus $$E\left[X^2\right] = (1-p)E\left[X^2\right] + {(1-p)(2-p) \over p}$$ That is $$E\left[X^2\right]= {(1-p)(2-p)\over p^2}$$ So the variance is $$ \begin{align*} \mbox{Var}(X) &= E\left[X^2\right] - E[X]^2\\ &= {(1-p)(2-p)\over p^2} - {(1-p)^2\over p^2}\\ &= {1-p\over p^2} \end{align*} $$

Examples

1. Let $X$ be geometrically distributed with probability parameter $p={1\over2}$. Determine the expected value $\mu$, the standard deviation $\sigma$, and the probability $P\left(|X-\mu| \geq 2\sigma\right)$. Compare with Chebyshev's Inequality.

Solution:

The geometric distribution mass function is $$f(x; p) = (1-p)^{x}p,\ x=0, 1, 2, \cdots$$ The expected value is $$\mu = {1-p\over p} = 1$$ The standard deviation is $$\sigma = \sqrt{1-p\over p^2} = 1.414214$$ The probability that $X$ takes a value more than two standard deviations from $\mu$ is $$P\left(|X-1| \geq 2.828428\right) = P(X\geq 4) = 0.0625$$ R code:

  1. 1 - sum(dgeom(c(0:3), 1/2))
  2. # [1] 0.0625

Chebyshev's Inequality gives the weaker estimation $$P\left(|X - \mu| \geq 2\sigma\right) \leq {1\over4} = 0.25$$

2. A die is thrown until one gets a 6. Let $V$ be the number of throws used. What is the expected value of $V$? What is the variance of $V$?

Solution:

The PMF of geometric distribution is $$f(x; p) = (1-p)^xp,\ = 0, 1, 2, \cdots$$ where $p = {1\over 6}$. Let $X = V-1$, so the expected value of $V$ is $$ \begin{align*} E[V] &= E[X+1]\\ &= E[X] + 1\\ &= {1-p\over p} + 1\\ &= {1-{1\over6} \over {1\over6}} + 1\\ &= 6 \end{align*} $$ The variance of $V$ is $$ \begin{align*} \mbox{Var}(V) &= \mbox{Var}(X+1)\\ &= \mbox{Var}(X)\\ &= {1-p\over p^2}\\ &= {1-{1\over 6} \over \left({1\over6}\right)^2}\\ &= 30 \end{align*} $$ Note that this is another form of the geometric distribution which is so-called the shifted geometric distribution (i.e. $X$ equals to the number of trials required). By the above process we can see that the expected value of the shifted geometric distribution is $$\mu = {1\over p}$$ and the variance of the shifted geometric distribution is $$\sigma^2 = {1-p\over p^2}$$

3. Assume $W$ is geometrically distributed with probability parameter $p$. What is $P(W < n)$?

Solution:

$$ \begin{align*} P(W < n) &= 1 - P(W \geq n)\\ &= 1-(1-p)^n \end{align*} $$

4. In order to test whether a given die is fair, it is thrown until a 6 appears, and the number $n$ of throws is counted. How great should $n$ be before we can reject the null hypothesis $$H_0: \mbox{the die is fair}$$ against the alternative hypothesis $$H_1: \mbox{the probability of having a 6 is less than 1/6}$$ at significance level $5\%$?  

Solution:

The probability of having to use at least $n$ throws given $H_0$ (i.e. the significance probability) is $$P = \left(1 - {1\over 6}\right) ^n$$ We will reject $H_0$ if $P < 0.05$. R code:

  1. n = 1
  2. while (n > 0){
  3. + p = (5/6) ^ n
  4. + if (p < 0.05) break
  5. + n = n + 1
  6. + }
  7. n
  8. # [1] 17

That is, we have to reject $H_0$ if $n$ is at least 17.

Reference

  1. Ross, S. (2010). A First Course in Probability (8th Edition). Chapter 4. Pearson. ISBN: 978-0-13-603313-4.
  2. Brink, D. (2010). Essentials of Statistics: Exercises. Chapter 5 & 10. ISBN: 978-87-7681-409-0.

基本概率分布Basic Concept of Probability Distributions 3: Geometric Distribution的更多相关文章

  1. 基本概率分布Basic Concept of Probability Distributions 8: Normal Distribution

    PDF version PDF & CDF The probability density function is $$f(x; \mu, \sigma) = {1\over\sqrt{2\p ...

  2. 基本概率分布Basic Concept of Probability Distributions 7: Uniform Distribution

    PDF version PDF & CDF The probability density function of the uniform distribution is $$f(x; \al ...

  3. 基本概率分布Basic Concept of Probability Distributions 6: Exponential Distribution

    PDF version PDF & CDF The exponential probability density function (PDF) is $$f(x; \lambda) = \b ...

  4. 基本概率分布Basic Concept of Probability Distributions 5: Hypergemometric Distribution

    PDF version PMF Suppose that a sample of size $n$ is to be chosen randomly (without replacement) fro ...

  5. 基本概率分布Basic Concept of Probability Distributions 2: Poisson Distribution

    PDF version PMF A discrete random variable $X$ is said to have a Poisson distribution with parameter ...

  6. 基本概率分布Basic Concept of Probability Distributions 1: Binomial Distribution

    PDF下载链接 PMF If the random variable $X$ follows the binomial distribution with parameters $n$ and $p$ ...

  7. 基本概率分布Basic Concept of Probability Distributions 4: Negative Binomial Distribution

    PDF version PMF Suppose there is a sequence of independent Bernoulli trials, each trial having two p ...

  8. PRML Chapter 2. Probability Distributions

    PRML Chapter 2. Probability Distributions P68 conjugate priors In Bayesian probability theory, if th ...

  9. Common Probability Distributions

    Common Probability Distributions Probability Distribution A probability distribution describes the p ...

随机推荐

  1. 前端见微知著工具篇:Grunt实现自动化

    转载说明 本篇文章为转载文章,来源为[前端福利]用grunt搭建自动化的web前端开发环境-完整教程,之所以转载,是因为本文写的太详细了,我很想自己来写,但是发现跳不出这篇文章的圈子,因为写的详尽,所 ...

  2. C语言文件的读写

    对文件的读和写是最常用的文件操作.在C语言中提供了多种文件读写的函数: 字符读写函数  :fgetc和fputc 字符串读写函数:fgets和fputs 数据块读写函数:freed和fwrite 格式 ...

  3. useradd 添加用户

    功能介绍 useradd命令用于Linux中创建的新的系统用户.useradd可用来建立用户帐号.帐号建好之后,再用passwd设定帐号的密码.而可用userdel删除帐号.使用useradd指令所建 ...

  4. Beta版本冲刺———第二天

    会议照片: 项目燃尽图: 1.项目进展: 昨天的困难:分数排行榜的设计 今天解决的进度:完成了界面优化以及建立新的排行榜选项卡界面. 明天要做的事情:分数排行榜的功能设计 2.每个人每天做的事情 郭怡 ...

  5. 从 MySQL+MMM 到 MariaDB+Galera Cluster : 一个高可用性系统改造

    很少有事情比推出高可用性(HA)系统之后便经常看到的系统崩溃更糟糕.对于我们这个Rails运行机的团队来说,这个失效的HA系统是MySQL多主复制管理器(MMM). 我们已经找寻MMM的替代品有一段时 ...

  6. Okio 1.9简单入门

    Okio 1.9简单入门 Okio库是由square公司开发的,补充了java.io和java.nio的不足,更加方便,快速的访问.存储和处理你的数据.而OkHttp的底层也使用该库作为支持. 该库极 ...

  7. 使用 screen 管理你的远程会话

    文章转载自:https://www.ibm.com/developerworks/cn/linux/l-cn-screen/ 在此只作为笔记使用,不做他用 你是不是经常需要 SSH 或者 telent ...

  8. 函数也是对象,本片介绍函数的属性、方法、Function()狗仔函数。

    1.arguments.length表示实参的个数. 2.arguments.callee.length表示形参个数. function test(a,b,c,d,e,f){ alert(argume ...

  9. 【BZOJ 4517】【SDOI 2016 Round1 Day2 T2】排列计数

    本蒟蒻第一次没看题解A的题竟然是省选$Round1$ $Day2$ $T2$ 这道组合数学题. 考试时一开始以为是莫队,后来想到自己不会组合数的一些公式,便弃疗了去做第三题,,, 做完第三题后再回来看 ...

  10. 【BZOJ 2599】【IOI 2011】Race 点分治

    裸的点分治,然而我因为循环赋值$s$时把$i <= k$写成$i <= n$了,WA了好长时间 #include<cstdio> #include<cstring> ...