当前位置:网站首页>MCS: discrete random variable Bernoulli distribution

MCS: discrete random variable Bernoulli distribution

2022-06-23 05:22:00 Fight the tiger tonight

Bernoulli

x x x Is Bernoulli variable , The value is 0/1:
P ( x = 1 ) = p P(x = 1) = p P(x=1)=p
p ( x = 0 ) = 1 − p p(x = 0) = 1 - p p(x=0)=1p

Expectation and variance :

E ( x ) = p E(x) = p E(x)=p
V ( x ) = p ( 1 − p ) V(x) = p(1 - p) V(x)=p(1p)

The generation process of random Bernoulli variables is as follows :

  1. Generate a random uniform variable u ∼ U ( 0 , 1 ) u \sim U(0, 1) uU(0,1)
  2. if u < p , x = 1 ; e l s e , x = 0 u < p , x = 1; else, x = 0 u<p,x=1;else,x=0

example : Set a Bernoulli variable x x x, p ( x = 1 ) = 0.7 p(x = 1) = 0.7 p(x=1)=0.7, The random Bernoulli variables are generated as follows :

  1. Generate a random variable u = 0.5 u = 0.5 u=0.5
  2. u < p ( x = 1 ) , x = 1 u < p(x = 1), x = 1 u<p(x=1),x=1
原网站

版权声明
本文为[Fight the tiger tonight]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230317071270.html