Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STA2001: Probability and Statistics I

Computer-based Exercise 10

2020

The goal of this exercise is to verify Theorem 5.1-1 [Random Number Generator] using Example 3 in Lecture 19.

Problem.

·  Generate 100 realizations of the random variable Y ~ U (0, 1), namely y1 , y2 , . . . , y100 .

Define another random variable X = F 1 (Y) = - log(1 - Y).  Compute realizations x1 = - log(1 - y1 ), x2 = - log(1 - y2 ), . . . , x100 = - log(1 - y100 ).

Plot

N (x)


G(x) =   100  , 0 < x < 10    

where N (x) is the number of xi’s that are smaller than x. Compare it with the plot of


F (x) = 1 - e z , 0 < x < 10.

·  Generate 1000 realizations of Y ~ U (0, 1) and repeat the above process.  What do you find?