当前位置:网站首页>MCS: discrete random variables - geometric distribution
MCS: discrete random variables - geometric distribution
2022-06-29 15:13:00 【Fight the tiger tonight】
Geometric
Geometric distribution (Geometric distribution) It's a discrete probability distribution . One of them is defined as : stay n n n In the thibernoulli experiment , test k k k The probability of first success . In detail , yes : front k − 1 k-1 k−1 I failed every time , The first k k k Probability of secondary success , Probability of success in each experiment p p p remain unchanged . The geometric distribution is Pascal distribution r = 1 r=1 r=1 The special case of time .
P ( k ) = p ( 1 − p ) k − 1 , k = 1 , 2 , . . . P(k) = p(1 - p)^{k - 1} , k = 1, 2,... P(k)=p(1−p)k−1,k=1,2,...
F ( k ) = 1 − ( 1 − p ) k , k = 1 , 2 , . . . F(k) = 1 - (1 - p)^k,k = 1, 2, ... F(k)=1−(1−p)k,k=1,2,...
E ( k ) = 1 p E(k) = \frac{1}{p} E(k)=p1
V ( k ) = 1 − p p 2 V(k) = \frac{1 - p}{p^2} V(k)=p21−p
When variables x ′ x' x′ It is defined as the number of failures when the experiment succeeds for the first time , x ′ = k − 1 x' = k - 1 x′=k−1:
P ( x ′ ) = p ( 1 − p ) x ′ P(x') = p(1 - p)^{x'} P(x′)=p(1−p)x′
F ( x ′ ) = 1 − ( 1 − p ) x ′ + 1 F(x') = 1 - (1 - p)^{x'+1} F(x′)=1−(1−p)x′+1
E ( x ′ ) = E ( x ) − 1 = ( 1 − p ) / p E(x') = E(x) - 1 = (1 - p)/p E(x′)=E(x)−1=(1−p)/p
V ( x ′ ) = V ( x ) = ( 1 − p ) / p 2 V(x') = V(x) = (1 - p)/p^2 V(x′)=V(x)=(1−p)/p2
Generate random variables of geometric distribution k k k:
- Generate random continuous uniform variables : u ∼ U ( 0 , 1 ) u \sim U(0,1) u∼U(0,1)
- x = i n t [ l n ( 1 − u ) l n ( 1 − p ) ] + 1 x = int[\frac{ln(1 - u)}{ln(1 - p)}] + 1 x=int[ln(1−p)ln(1−u)]+1
example : Suppose the probability of a successful experiment is p = 0.2 p = 0.2 p=0.2, Random geometric variable x x x The first success for this experiment is the number of attempts , Generate a random geometric variable :
- Generate random uniform variables : u ∼ U ( 0 , 1 ) , u = 0.27 u \sim U(0, 1),u = 0.27 u∼U(0,1),u=0.27
- x = i n t ( l n ( 1 − 0.27 ) / l n ( 1 − 0.2 ) ) + 1 = 2 x = int(ln(1 - 0.27)/ln(1 - 0.2)) + 1 = 2 x=int(ln(1−0.27)/ln(1−0.2))+1=2
Simulation generates random geometric variables
import numpy as np
import matplotlib.pyplot as plt
def generate_geometric(p=0.1):
u = np.random.uniform(0, 1)
x = int(np.log(1 - u)/ np.log(1 - p)) + 1
return x

边栏推荐
- The first lesson on cloud - how easy is it to build a small broken station? The old driver of cloud computing will take you one hour to finish it
- 使用自定义注解实现Redis分布式锁
- Differential equations of satellite motion
- 信息学奥赛一本通1003:对齐输出
- phpcms打开后台首页时向官网发送升级请求觉得卡怎么办?
- Construction and application of medical field Atlas of dingxiangyuan
- Unity C# 基础复习26——初识委托(P447)
- synchronized 与多线程的哪些关系
- Huali biology rushes to the scientific innovation board: the annual revenue is RMB 226million and it is planned to raise RMB 800million
- Lumiprobe reactive dye carboxylic acid: sulfo cyanine7.5 carboxylic acid
猜你喜欢

Lumiprobe reactive dye cycloalkyne dye: af488 dbco, 5 isomer

Lumiprobe reactive dye carboxylic acid: sulfo cyanine7.5 carboxylic acid

MCS:离散随机变量——Hyper Geometric分布

第九章 APP项目测试(此章完结)

const用法精讲

墨滴排版

西北工业大学遭境外电邮攻击

威高血液净化冲刺香港:年营收29亿 净利降12.7%

Chapter IX app project test (4) test tools

Weigao blood purification sprint to Hong Kong: annual revenue of RMB 2.9 billion, net profit decreased by 12.7%
随机推荐
Lumiprobe reactive dye carboxylic acid: sulfo cyanine7.5 carboxylic acid
模电 2个NPN管组成的恒流源电路分析
SOFARegistry 源码|数据同步模块解析
Sofaregistry source code | data synchronization module analysis
阿尔兹海默病智能诊断
MCS:离散随机变量——Hyper Geometric分布
卫龙更新招股书:年营收48亿 创始人刘卫平家族色彩浓厚
Real software testers = "half product + Half development"?
Render follows, encapsulating a form and adding data to the table
[Verilog quick start of Niuke online question series] ~ shift operation and multiplication
Unity C# 基础复习26——初识委托(P447)
Query function of Excel vlookup
Lumiprobe 点击化学丨非荧光炔烃:己酸STP酯
第九章 APP项目测试(4) 测试工具
Alibaba cloud experience Award: use polardb-x and Flink to build a large real-time data screen
Basic use of text preprocessing library Spacy (quick start)
Jet hydrogen technology rushes to the scientific innovation board: SAIC Group is the major shareholder to raise 1.06 billion yuan
konva系列教程4:图形属性
curl: (56) Recv failure: Connection reset by peer
The first lesson on cloud - how easy is it to build a small broken station? The old driver of cloud computing will take you one hour to finish it