当前位置:网站首页>MCS:离散随机变量——Uniform分布
MCS:离散随机变量——Uniform分布
2022-06-23 03:56:00 【今晚打佬虎】
Discrete Uniform
变量 x x x服从均匀的离散分布,具有两个参数 a , b a,b a,b, x x x接受 a ∼ b a \sim b a∼b范围内的所有整数, 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
期望和方差:
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 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
例:假设一个随机变量 x x x,服从均匀离散分布,取值为 10 ∼ 20 10 \sim 20 10∼20之间的全部整数,模拟生成该随机变量:
- 生成一个均匀连续随机变量: u = 0.71 u = 0.71 u=0.71
- 计算 10 ∼ 20 10 \sim 20 10∼20之间离散随机变量: 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
边栏推荐
- How to conduct exploratory data analysis
- Investment risk management
- MMDeploy快速安装及使用说明
- I have been engaged in software testing for 5 years and have changed jobs for 3 times. I have understood the field of software testing
- The technological advance of new employees? Journey
- 组合式API-composition-api
- Missing essential plugin
- 大環境不好難找工作?三面阿裏,幸好做足了准備,已拿offer
- 树莓派网络远程访问
- Hcip switch experiment
猜你喜欢
随机推荐
关于信息泄露和防御
JDBC call stored procedure, MySQL trigger
The propeller framework v2.3 releases the highly reusable operator library Phi! Restructure development paradigm to reduce cost and increase efficiency
直接插入排序——【常见排序法(1/8)】
Open source ecology 𞓜 super practical open source license basic knowledge literacy post (Part 2)
OSPF shunt test
掌握 Shell,一篇就够了!
Image noise reduction denoise AI
大環境不好難找工作?三面阿裏,幸好做足了准備,已拿offer
How to conduct exploratory data analysis
代码片段管理器SnippetsLab
Difficult to find a job in a bad environment? Ali on three sides. Fortunately, he has made full preparations and has offered
Introduction and use of precise ephemeris
MySQL stored procedure
Rtklib new version 2.4.3 B34 test comparison
【微服务|Nacos】Nacos版本相关问题一览
Calculate Euclidean distance and cosine similarity
Complete the primary school project in 3 days, and teach you to complete the weather broadcast system hand in hand!
组合式API-composition-api
Investment risk management







