当前位置:网站首页>MCS: discrete random variable - uniform distribution
MCS: discrete random variable - uniform distribution
2022-06-23 05:22:00 【Fight the tiger tonight】
Discrete Uniform
Variable x x x Obey uniform discrete distribution , There are two parameters a , b a,b a,b, x x x Accept a ∼ b a \sim b a∼b All integers in the range , P ( x ) P(x) P(x):
P ( x ) = 1 b − a + 1 , x ∼ a → b P(x) = \frac{1}{b - a + 1},x \sim a \to b P(x)=b−a+11,x∼a→b
CDF:
F ( x ) = x − a + 1 b − a + 1 , x ∼ a → b F(x) = \frac{x - a + 1}{b - a + 1}, x \sim a \to b F(x)=b−a+1x−a+1,x∼a→b
Expectation and variance :
E ( x ) = ( a + b ) / 2 E(x) = (a + b) / 2 E(x)=(a+b)/2
V ( x ) = ( b − a + 1 ) 2 − 1 12 V(x) = \frac{(b - a + 1)^2 - 1}{12} V(x)=12(b−a+1)2−1
Generate random discrete uniform variables
- Generate a random continuous uniform u ∼ U ( 0 , 1 ) u \sim U(0, 1) u∼U(0,1)
- x = c e i l i n g [ ( a − 1 ) + u ( b − a + 1 ) ] x = ceiling[(a - 1) + u(b - a + 1)] x=ceiling[(a−1)+u(b−a+1)]
- Return x x x
example : Suppose a random variable x x x, Obey uniform discrete distribution , The value is 10 ∼ 20 10 \sim 20 10∼20 All integers between , The random variable is generated by simulation :
- Generate a uniform continuous random variable : u = 0.71 u = 0.71 u=0.71
- Calculation 10 ∼ 20 10 \sim 20 10∼20 Between discrete random variables : x = c e i l i n g [ ( 10 − 1 ) + 0.71 × ( 20 − 10 + 1 ) ] = c e i l i n g [ 16.81 ] = 17 x = ceiling[(10 - 1) + 0.71 \times (20 - 10 + 1)] = ceiling[16.81] = 17 x=ceiling[(10−1)+0.71×(20−10+1)]=ceiling[16.81]=17
- x = 17 x = 17 x=17
边栏推荐
猜你喜欢

UnityShader入门精要——Unity中的渲染优化技术(四)

大環境不好難找工作?三面阿裏,幸好做足了准備,已拿offer

985 test engineer is hanged. Who is more important in terms of education and experience?

Zygote进程

Web 应用程序安全测试指南

Complete the primary school project in 3 days, and teach you to complete the weather broadcast system hand in hand!
![[microservices | Nacos] list of issues related to the Nacos version](/img/13/d25cbe38d1712f7166f7b5eb27942c.png)
[microservices | Nacos] list of issues related to the Nacos version

Introduction and use of precise ephemeris

【opencv450】 图像相减、二值化、阈值分割

IDEA 代码开发完毕后,提交代码,提交后发现分支不对,怎么撤回
随机推荐
如何进行探索性数据分析
1010 Radix
Onnxoptimizer, onnxsim usage records
OSPF shunt test
HCIP 交换机实验
Economic development is driven by new technology
Visual display of TEQC quality analysis results using teqcplot
计算欧式距离和余弦相似度
HCIP第五次作业
A compiler related bug in rtklib2.4.3 B34
应用挂了~
JVM原理之内存模型
开源生态|超实用开源License基础知识扫盲帖(下)
【微服务|Nacos】Nacos版本相关问题一览
Drag and drop frame
Event log keyword: eventlogtags logtags
Memory model of JVM principle
Strong push, quick start to software testing
Calculate Euclidean distance and cosine similarity
Arduino temperature and humidity sensor DHT11 (including code)