Question: Binary random number generation . Given a sequence of U (0, 1) random numbers, obtain and describe an algorithm that generate binary random numbers with
Binary random number generation. Given a sequence of U (0, 1) random numbers, obtain and describe an algorithm that generate binary random numbers with the following point masses:
P{X =0}=0.3, P{X =1}=0.7
(a) Find the(theoretical) mean and variance of X.
(b) Use MATLAB U(0,1)random number generator "rand" to generate 10,000 random
numbers with the above distribution.
(c) Compute the average value of the 10,000 random numbers generated. Compare it with
the theoretical mean.
(d) Give the percentages of the numbers generated that are equal to 1, 0, and 1, respec-
tively. Compare them with the point masses and make a comment.
(e) Generate 10,000 random numbers with the above distribution using the companion software PARSE by taking advantage of the relationship between the binomial and
binary distributions and repeat (c)-(d) for these numbers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
