Simulation
A First Course in Probability ยท 21 exercises
Q. 10.1
The following algorithm will generate a random permutation of the elements 1, 2, ... , n. It is somewhat faster than the one presented in Example 1a but is such that no position is fixed until the algorithm ends. In this algorithm, P(i) can be interpreted as the element in position i. Step 1. Set k = 1. Step 2. Set P(1) = 1. Step 3. If k = n, stop. Otherwise, let k = k + 1. Step 4. Generate a random number U and let P(k) = P([kU] + 1) P([kU] + 1) = k Go to step 3. (a) Explain in words what the algorithm is doing. (b) Show that at iteration k—that is, when the value of P(k) is initially set—P(1),P(2), ... ,P(k) is a random permutation of 1, 2, ... , k.
4 step solution
Q. 10.2
Develop a technique for simulating a random variable having density function
2 step solution
Q. 10.3
Give a technique for simulating a random variable having the probability density function
2 step solution
Q. 10.4
Present a method for simulating a random variable having distribution function
2 step solution
Q. 10.5
Use the inverse transformation method to present an approach for generating a random variable from the Weibull distribution
2 step solution
Q. 10.6
Give a method for simulating a random variable having failure rate function (a) λ(t) = c;
(b) λ(t) = ct;
(c) λ(t) = ct2;
(d) λ(t) = ct3.
8 step solution
Q. 10.7
Let F be the distribution function
F(x) = xn 0 < x < 1
(a) Give a method for simulating a random variable having distribution F that uses only a single random number.
(b) Let U1, ... , Un be independent random numbers. Show that
P{max(U1, ... , Un) … x} = xn
(c) Use part (b) to give a second method of simulating a random variable having distribution F.
6 step solution
Q. 10.8
Suppose it is relatively easy to simulate from Fi for each i = 1, ... , n. How can we simulate from
(a)
(b)
4 step solution
Q. 10.9
Suppose we have a method for simulating random variables from the distributions F1 and F2. Explain how to simulate from the distribution
F(x) = pF1(x) + (1 − p)F2(x) 0 < p < 1
Give a method for simulating from
2 step solution
Q. 10.10
In Example 2c we simulated the absolute value of a unit normal by using the rejection procedure on exponential random variables with rate 1. This raises the question of whether we could obtain a more efficient algorithm by using a different exponential density—that is, we could use the density g(x) = λe−λx. Show that the mean number of iterations needed in the rejection scheme is minimized when λ = 1.
2 step solution
Q. 10.11
Use the rejection method with g(x) = 1, 0 < x < 1, to determine an algorithm for simulating a random variable having density function
2 step solution
Q. 10.12
Explain how you could use random numbers to approximate , where k(x) is an arbitrary function.
2 step solution
Q. 10.13
Let (X, Y) be uniformly distributed in the circle of radius 1 centered at the origin. Its joint density is thus
Let R = (X2 + Y2)1/2 and = tan−1(Y/X) denote
the polar coordinates of (X, Y). Show that R and are
independent, with R2 being uniform on (0, 1) and being
uniform on (0, 2π).
3 step solution
Q. 10.14
In Example 4a, we showed that
E[(1 − V2) 1/2] = E[(1 − U2) 1/2] = π/4
when V is uniform (−1, 1) and U is uniform (0, 1). Now show that
Var[(1 − V2) 1/2] = Var[(1 − U2) 1/2]
and find their common value.
2 step solution
Q. 10.15
(a) Verify that the minimum of (4.1) occurs when a is as given by (4.2).
(b) Verify that the minimum of (4.1) is given by (4.3).
4 step solution
Q. 10.16
Let X be a random variable on (0, 1) whose density is f(x). Show that we can estimate # 1 0 g(x) dx by simulating X and then taking g(X)/f(X) as our estimate. This method, called importance sampling, tries to choose f similar in shape to g, so that g(X)/f(X) has a small variance.
2 step solution
Q. 10.1
The random variable X has probability density function
f(x) = Cex 0 < x < 1
(a) Find the value of the constant C.
(b) Give a method for simulating such a random variable.
4 step solution
Q. 10.2
Give an approach for simulating a random variable having probability density function
f(x) = 30(x2 − 2x3 + x4) 0 < x < 1
2 step solution
Q. 10.3
Give an efficient algorithm to simulate the value of a random variable with probability mass function
p1 = .15 p2 = .2 p3 = .35 p4 = .30
2 step solution
Q. 10.4
If X is a normal random variable with mean μ and variance σ2, define a random variable Y that has the same distribution as X and is negatively correlated with it.
2 step solution
Q. 10.5
Let X and Y be independent exponential random variables with mean 1.
(a) Explain how we could use simulation to estimate E[eXY].
(b) Show how to improve the estimation approach in part (a) by using a control variate.
4 step solution