1 Generating Random Numbers

advertisement
1
Generating Random Numbers
The following ten numbers are realizations from a standard uniform distribution:
0.8300 0.7064 0.3631 0.2305 0.0425 0.1910 0.9743 0.8571 0.6642 0.1908
(a) Explain how you can use the numbers above to generate 10 iid Bernoulli random variables, Y1 , . . . , Y10 ,
with a success probability of p = .2. What ten values of the Bernoulli random variables do you obtain?
(b) Describe how you can use these numbers to find realizations of a Geo0.2 distribution. Then give the
first two Geo0.2 random numbers X1 , X2 based on the numbers above.
(c) How can you use the numbers above to generate a X ∼Binomial(n =10,p =.2)? What value of X do
you obtain?
(d) Assume, variable X has distribution function FX given as


0
FX (x) = ln(x + 1)


1
if x < 0,
if 0 ≤ x ≤ e − 1,
otherwise.
Describe how you can use a random number from a standard uniform distribution to find a realization
of FX . (Hint: Use the inverse method for continuous random variables.) Then give the first two
random numbers X1 , X2 based on the first two numbers above.
(e) How can you use the numbers above to generate X ∼Erlang(K = 10,λ = 3)? You do not need to
compute the actual value; just describe the procedure.
Download