当前位置:网站首页>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
边栏推荐
- UI automation positioning edge -xpath actual combat
- insert into... where not exists插入避免重复的使用
- Snippet Manager snippetslab
- Investment risk management
- UI automation positioning edge -xpath actual combat
- Beyond chips and AI, why is hard technology capital becoming more and more "hard core"?
- One or more lines of text overflow, ellipsis instead
- Missing essential plugin
- Zygote进程
- Hcip fifth operation
猜你喜欢

MVC three-tier architecture

JDBC入门学习(二)之封装工具类

【微服务|Nacos】Nacos版本相关问题一览

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

【opencv450】帧间差分法
![Direct insertion sort - [common sort method (1/8)]](/img/c3/f08d789c9ff32dda4f20c58e7c114d.png)
Direct insertion sort - [common sort method (1/8)]

组合式API-composition-api

STP总结

618 how to break through the siege? Haier Zhijia: do a good job in digitalization of users

Beyond chips and AI, why is hard technology capital becoming more and more "hard core"?
随机推荐
UnityShader入门精要——Unity中的渲染优化技术(四)
MMDeploy快速安装及使用说明
戏问花门酒家翁
Implementation of slider view
JDBC入门学习(四)之Druid连接池的使用
[MAC] there is no source option in security and privacy
The tiobe programming language ranking is an indicator of the popular trend of programming languages
【微服务|Nacos】Nacos实现多环境和多租户的数据隔离
Mmdeploy quick installation and instructions
左侧固定,右侧自适应 三种实现办法(Flex,float + BFC ,float-margin-left)
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
物联网开源开发平台 Shifu 开放内测!第一版技术文档发布
AMS:startActivity桌面启动应用
关于重放攻击和防御
Drag and drop frame
stm32时钟树错误配置导致 开机进入硬中断
LeetCode-1757. 可回收且低脂的产品_SQL
百度飞桨“万有引力”2022首站落地苏州,全面启动中小企业赋能计划
HCIP第五次作业
应用挂了~