当前位置:网站首页>MCS:离散随机变量——Pascal分布
MCS:离散随机变量——Pascal分布
2022-06-29 14:39:00 【今晚打佬虎】
Pascal
帕斯卡分布,负二项分布的正整数形式。当变量 x x x表示某项实验获得 k k k次成功时,实验重复的次数,变量 x x x服从帕斯卡分布,实验成功概率为: p p p。
P ( x ) = C k − 1 x − 1 p k ( 1 − p ) x − k , x = k , k + 1 , . . . P(x) = C_{k-1}^{x - 1} p^k(1 - p)^{x - k},x = k, k+1, ... P(x)=Ck−1x−1pk(1−p)x−k,x=k,k+1,...
F ( x ) = ∑ y = k x P ( y ) , x = k , k + 1 , . . . F(x) = \sum_{y=k}^x P(y),x = k, k+1, ... F(x)=y=k∑xP(y),x=k,k+1,...
期望和方差:
E ( x ) = k p E(x) = \frac{k}{p} E(x)=pk
V ( x ) = k ( 1 − p ) p 2 V(x) = \frac{k(1 - p)}{p^2} V(x)=p2k(1−p)
当变量 x ′ x' x′定义为获得 k k k次成功时,失败的次数, x ′ = x − k x' = x - k x′=x−k:
- E ( x ′ ) = E ( x ) − k = k ( 1 − p ) / p E(x') = E(x) - k = k(1 - p)/p E(x′)=E(x)−k=k(1−p)/p
- V ( x ′ ) = V ( x ) = k ( 1 − p ) / p 2 V(x') = V(x) = k(1 - p)/p^2 V(x′)=V(x)=k(1−p)/p2
生成Pascal变量: x x x
- x = 0 x = 0 x=0
- For i = 1 → k i = 1 \to k i=1→k:
- 生成随机几何变量 y = G ( p ) y = G(p) y=G(p):第一次成功时实验的次数
- x = x + y x = x + y x=x+y
- i = i + 1 i = i + 1 i=i+1
- Return x x x
例:变量 x x x为帕斯卡变量, p = 0.5 , k = 5 p = 0.5,k = 5 p=0.5,k=5, x x x表示为获得第5次成功时,实验重复的次数,生成变量 x x x。
- x = 0 x = 0 x=0
- i = 1 , y = G ( 0.5 ) = 3 , x = 3 i = 1,y = G(0.5) = 3,x = 3 i=1,y=G(0.5)=3,x=3
- i = 2 , y = G ( 0.5 ) = 1 , x = 4 i = 2,y = G(0.5) = 1,x = 4 i=2,y=G(0.5)=1,x=4
- i = 3 , y = G ( 0.5 ) = 2 , x = 6 i = 3,y = G(0.5) = 2,x = 6 i=3,y=G(0.5)=2,x=6
- i = 4 , y = G ( 0.5 ) = 4 , x = 10 i = 4,y = G(0.5) = 4,x = 10 i=4,y=G(0.5)=4,x=10
- i = 5 , y = G ( 0.5 ) = 2 , x = 12 i = 5,y = G(0.5) = 2,x = 12 i=5,y=G(0.5)=2,x=12
- x = 12 x = 12 x=12
模拟生成Pascal变量
import numpy as np
import matplotlib.pyplot as plt
def generate_pascal(k=5, p=0.1):
x = np.sum(np.random.geometric(p=p, size=(k)))
return x

边栏推荐
- kubernetes Unable to connect to the server: x509: certificate has expired or is not yet valid
- . Net program configuration file operation (INI, CFG, config)
- [QT tutorial] QPushButton key and double click effect
- 两个字的名字如何变成有空格的3个字符的名字
- [Jenkins] pipeline controls the sequential execution of multiple jobs for timed continuous integration
- How bad can a programmer be?
- Differences between @resource and @autowired annotations automatically injected:
- 自动注入@Resource和@Autowired注解的区别:
- Chapter 10 of canvas path
- .NET程序配置文件操作(ini,cfg,config)
猜你喜欢

三角函数对应在平面坐标上画圆

June 27 talk SofiE

第五届中国软件开源创新大赛 | openGauss赛道直播培训

Practical application cases of drives

Methods of accessing external services in istio grid

Class template case - array class encapsulation

他山之石 | 丁香园 医疗领域图谱的构建与应用

The 5th China software open source innovation competition | opengauss track live training

校园跑腿微信小程序跑腿同学带直播新版源码

EXCEL的查询功能Vlookup
随机推荐
phpcms打开后台首页时向官网发送升级请求觉得卡怎么办?
Indice d'évaluation du logiciel hautement simultané (site Web, interface côté serveur)
Class template case - array class encapsulation
word如何自动生成目录
Build your own website (19)
openGauss社区成立SIG KnowledgeGraph
symfony框架安全组件(security)防火墙配置
Mysql database - general syntax DDL DML DQL DCL
. Net program configuration file operation (INI, CFG, config)
Trigonometric function corresponding to drawing circle on plane coordinate
[top] blog instructions, bulletin board, message board, about bloggers
捷氢科技冲刺科创板:拟募资10.6亿 上汽集团是大股东
模电 2个NPN管组成的恒流源电路分析
高並發軟件(網站,服務器端接口)的評價指標
Is 100W data table faster than 1000W data table query in MySQL?
wieshark抓包mysql协议简单分析
如果我在佛山,到哪里开户比较好?究竟网上开户是否安全么?
China arsenic trioxide industry research and future forecast report (2022 Edition)
Chapter 7 deformation operation of canvas
Deploy redis sentry in k8s