PDF下载链接

PMF

If the random variable $X$ follows the binomial distribution with parameters $n$ and $p$, we write $X \sim B(n, p)$. The probability of getting exactly $x$ successes in $n$ trials is given by the probability mass function: $$f(x; n, p) = \Pr(X=x) = {n\choose x}p^{x}(1-p)^{n-x}$$ for $x=0, 1, 2, \cdots$ and ${n\choose x} = {n!\over(n-x)!x!}$.

Proof:

$$ \begin{align*} \sum_{x=0}^{\infty}f(x; n, p) &= \sum_{x=0}^{\infty}{n\choose x}p^{x}(1-p)^{n-x}\\ &= [p + (1-p)]^{n}\;\;\quad\quad \mbox{(binomial theorem)}\\ &= 1 \end{align*} $$

Mean

The expected value is $$\mu = E[X] = np$$

Proof:

$$ \begin{align*} E\left[X^k\right] &= \sum_{x=0}^{\infty}x^{k}{n\choose x}p^{x}(1-p)^{n-x}\\ &= \sum_{x=1}^{\infty}x^{k}{n\choose x}p^{x}(1-p)^{n-x}\\ &= np\sum_{x=1}^{\infty}x^{k-1}{n-1\choose x-1}p^{x-1}(1-p)^{n-x}\quad\quad\quad (\mbox{identity}\ x{n\choose x} = n{n-1\choose x-1})\\ &= np\sum_{y=0}^{\infty}(y+1)^{k-1}{n-1\choose y}p^{y}(1-p)^{n-1-y}\quad(\mbox{substituting}\ y=x-1)\\ &= npE\left[(Y + 1)^{k-1}\right] \quad\quad\quad \quad\quad\quad \quad\quad\quad\quad\quad (Y\sim B(n-1, p)) \\ \end{align*} $$ Using the identity $$ \begin{align*} x{n\choose x} &= {x\cdot n!\over(n-x)!x!}\\ & = {n!\over(n-x)!(x-1)!}\\ &= n{(n-1)!\over[(n-1)-(x-1)]!(x-1)!}\\ &= n{n-1\choose x-1} \end{align*} $$ Hence setting $k=1$ we have $$E[X] = np$$

Variance

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

Proof:

$$ \begin{align*} \mbox{Var}(X) &= E\left[X^2\right] - E[X]^2\\ &= npE[Y+1] - n^2p^2\\ & = np\left(E[Y] + 1\right) - n^2p^2\\ & = np[(n-1)p + 1] - n^2p^2\quad\quad (Y\sim B(n-1, p))\\ &= np(1-p) \end{align*} $$

Examples

1. Let $X$ be binomially distributed with parameters $n=10$ and $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 binomial mass function is $$f(x) ={n\choose x} p^x \cdot q^{n-x},\ x=0, 1, 2, \cdots$$ where $q=1-p$. The expected value and the standard deviation are $$E[X] = np=5,\ \sigma = \sqrt{npq} = 1.581139$$ The probability that $X$ takes a value more than two standard deviations from $\mu$ is $$ \begin{align*} P\left(|X-\mu| \geq 2\sigma\right) &= P\left(|X-5| \geq 3.2\right)\\ &= P(X\leq 1) + P(X \geq9)\\ &= \sum_{x=0}^{1}{10\choose x}p^{x}(1-p)^{10-x} + \sum_{x=9}^{\infty}{10\choose x}p^{x}(1-p)^{10-x}\\ & = 0.02148437 \end{align*} $$ R code:

sum(dbinom(c(0, 1), 10, 0.5)) + 1 - sum(dbinom(c(0:8), 10, 0.5))
# [1] 0.02148437
pbinom(1, 10, 0.5) + 1 - pbinom(8, 10, 0.5)
# [1] 0.02148438

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

2. What is the probability $P_1$ of having at least six heads when tossing a coin ten times?

Solution:

$$ \begin{align*} P(X \geq 6) &= \sum_{x=6}^{10}{10\choose x}0.5^{x}0.5^{10-x}\\ &= 0.3769531 \end{align*} $$ R code:

1 - pbinom(5, 10, 0.5)
# [1] 0.3769531
sum(dbinom(c(6:10), 10, 0.5))
# [1] 0.3769531

3. What is the probability $P_2$ of having at least 60 heads when tossing a coin 100 times?

Solution:

$$ \begin{align*} P(X \geq 60) &= \sum_{x=60}^{100}{100\choose x}0.5^{x}0.5^{100-x}\\ &= 0.02844397 \end{align*} $$ R code:

1 - pbinom(59, 100, 0.5)
# [1] 0.02844397
sum(dbinom(c(60:100), 100, 0.5))
# [1] 0.02844397

Alternatively, we can use normal approximation (generally when $np > 5$ and $n(1-p) > 5$). $\mu = np=50$ and $\sigma = \sqrt{np(1-p)} = \sqrt{25}$. $$ \begin{align*} P(X \geq 60) &= 1 - P(X \leq 59)\\ &= 1- \Phi\left({59.5-50\over \sqrt{25}}\right)\\ &= 1-\Phi(1.9)\\ &= 0.02871656 \end{align*} $$ R code:

1 - pnorm(1.9)
# [1] 0.02871656

4. What is the probability $P_3$ of having at least 600 heads when tossing a coin 1000 times?

Solution: $$ \begin{align*} P(X \geq 600) &= \sum_{x=600}^{1000}{1000\choose x} 0.5^{x} 0.5^{1000-x}\\ &= 1.364232\times10^{-10} \end{align*} $$ R code:

sum(dbinom(c(600:100), 1000, 0.5))
# [1] 1
sum(dbinom(c(600:1000), 1000, 0.5))
# [1] 1.364232e-10

Alternatively, we can use normal approximation. $\mu = np=500$ and $\sigma = \sqrt{np(1-p)} = \sqrt{250}$. $$ \begin{align*} P(X \geq 600) &= 1 - P(X \leq 599)\\ &= 1- \Phi\left({599.5-500\over \sqrt{250}}\right)\\ &= 1.557618 \times 10^{-10} \end{align*} $$ R code:

1 - pnorm(99.5/sqrt(250))
# [1] 1.557618e-10

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 & 8. ISBN: 978-87-7681-409-0.

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

  1. 基本概率分布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 ...

  2. 基本概率分布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 ...

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

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

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

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

  5. 基本概率分布Basic Concept of Probability Distributions 3: Geometric Distribution

    PDF version PMF Suppose that independent trials, each having a probability $p$, $0 < p < 1$, o ...

  6. 基本概率分布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 ...

  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. 浅谈设计模式--装饰者模式(Decorator Pattern)

    挖了设计模式这个坑,得继续填上.继续设计模式之路.这次讨论的模式,是 装饰者模式(Decorator Pattern) 装饰者模式,有时也叫包装者(Wrapper),主要用于静态或动态地为一个特定的对 ...

  2. es6+移动轮播插件

    前言:之前赶项目,都是直接用框架,对于touch事件是模拟两可,趁着有心情,用es6写一个原生移动轮播插件. 用了es6的新特性,确实挺爽的,说到es6,就不得不说到babel,博主已经码好了,直接用 ...

  3. Data URI 应用场景小结

    Data URI scheme 在前端开发中是个常用的技术,通常会在 CSS 设置背景图中用到.比如在 Google 的首页就有用到: Data URI scheme 简称 Data URI,经常会被 ...

  4. 如何用 fiddler 捕获 https 请求

    安装完 Fiddler 后,我们每次打开浏览器输入 url,Fiddler 便会捕获到我们的 http 请求(Fiddler 是以代理 web 服务器的形式工作的,它使用代理地址:127.0.0.1, ...

  5. SQLServer(MSSQL)、MySQL、SQLite、Access相互迁移转换工具 DB2DB v1.3

    最近公司有一个项目,需要把原来的系统从 MSSQL 升迁到阿里云RDS(MySQL)上面.为便于测试,所以需要把原来系统的所有数据表以及测试数据转换到 MySQL 上面.在百度上找了很多方法,有通过微 ...

  6. node 学习笔记 - Modules 模块加载系统 (1)

    本文同步自我的个人博客:http://www.52cik.com/2015/12/11/learn-node-modules-path.html 用了这么久的 require,但却没有系统的学习过 n ...

  7. 深入浅出ASP.NET MVC5系列之一

    前言 为避免看官乏味,本系列博客限定在较新的.Net framework 4.5.1,Asp.net MVC5,IIS 7.X集成模式. 对于微软应用层的技术.我向来不舍得花太多时间学习.但又由于公司 ...

  8. go println与printf区别

    Println 与Printf 都是fmt 包中的公共方法 Println :可以打印出字符串,和变量: Printf : 只可以打印出格式化的字符串,可以输出字符串类型的变量,不可以输出整形变量和整 ...

  9. iOS -- autoResizingMask使用(转)

    autoResizingMask 是UIView的一个属性,在一些简单的布局中,使用autoResizingMask,可以实现子控件相对于父控件的自动布局. autoResizingMask 是UIV ...

  10. Beta版本冲刺Day3

    会议讨论: 628:已经将原本写在jsp中的所有界面修饰代码转移到了css文件中,同时当页面跳转的时候也不会出现崩溃的现象,并且已经解决了上次无法连接数据库的问题.但是又遇到了一些新的小问题,希望明天 ...