Question: To generate a Bernoulli random variable X such that P(X = 1) = p = 1 P(X = 0) generate a random number U,

To generate a Bernoulli random variable X such that P(X = 1) = p = 1 − P(X = 0)

generate a random number U, and set

1, x = { 1); 0, if Up if U> p.

1, x = { 1); 0, if Up if U> p.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Statistics For Engineers And Scientists Questions!