当前位置:网站首页>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
边栏推荐
- Raspberry pie network remote access
- Strong push, quick start to software testing
- Hcip switch experiment
- The tiobe programming language ranking is an indicator of the popular trend of programming languages
- 【微服务|Nacos】Nacos实现多环境和多租户的数据隔离
- 基金业绩评价
- HCIP第五次作业
- 李宏毅《机器学习》丨5. Tips for neural network design(神经网络设计技巧)
- 1010 Radix
- pkav简单爆破
猜你喜欢

Three tier architecture experiment

Hcip switch experiment

搭建一套 gocd 的环境

三层架构实验

Hcip reissue experiment

VMware network connection error unit network service not found

618如何冲出重围?海尔智家:做好用户的数字化

(IntelliJ)插件一 Background Image Plus

飞桨框架v2.3发布高可复用算子库PHI!重构开发范式,降本增效

insert into... Where not exists insert to avoid repeated use
随机推荐
Hard core, become a high-quality tester: learn to communicate with products
Architecture à trois niveaux MVC
基金业绩评价
Missing essential plugin
618 how to break through the siege? Haier Zhijia: do a good job in digitalization of users
HCIP 重发布实验
导出带水印的PDF
The technological advance of new employees? Journey
BGP summary of hcip operation
Mysql入门学习(二)之子查询+关联
渗透测试基础 | 附带测试点、测试场景
OSPF分流实验
Zygote进程
UI automation positioning edge -xpath actual combat
Error related to synchronizing domestic AOSP code
软件项目管理 8.4.软件项目质量计划
MVC three-tier architecture
3 天完成小学期项目,手把手教你完成天气播报系统!
大環境不好難找工作?三面阿裏,幸好做足了准備,已拿offer
MVC三層架構