16.7 Practice Problems
Problem 16.7.1. Generate the sequence of the linear congruential generator \(x_{k + 1} = (5x_k + 3) \bmod 16\) from \(x_0 = 7\) and find its period.
Show solution
Solution. \(7, 6, 1, 8, 11, 10, 5, 12, 15, 14, 9, 0, 3, 2, 13, 4\), and then \(7\) again: period \(16\), the full modulus. This agrees with the Hull–Dobell theorem: \(c = 3\) is coprime to \(16\), and \(a - 1 = 4\) is divisible by \(2\), the only prime factor of \(16\), and by \(4\), since \(16\) is a multiple of \(4\).
Problem 16.7.2. Give the inverse-transform formula for the triangular distribution on \([0, 2]\) with mode \(1\).
Show solution
Solution. \(F(x) = x^2/2\) for \(0 \leq x \leq 1\) and \(1 - (2 - x)^2/2\) for \(1 \leq x \leq 2\). Solving \(F(x) = u\): \(x = \sqrt {2u}\) for \(u \leq \frac 12\) and \(x = 2 - \sqrt {2(1 - u)}\) for \(u > \frac 12\).
Problem 16.7.3. A pilot simulation gives a standard deviation of \(2\) minutes for the mean wait per replication. How many replications are needed for a \(95\%\) confidence interval of half-width \(0.05\) minutes?
Show solution
Solution. \(1.96 \times 2/\sqrt R \leq 0.05\) requires \(R \geq (1.96 \times 2/0.05)^2 = 6147\) replications; halving the half-width would need four times as many.
Problem 16.7.4. Compute the variance reduction of antithetic variates for \(\mathbb E[e^U]\) exactly.
Show solution
Solution. \(\operatorname {Var}e^U = \frac {e^2 - 1}2 - (e - 1)^2 = 0.2420\) and \(\operatorname {Cov}(e^U, e^{1 - U}) = e - (e - 1)^2 = -0.2342\). Two independent draws have mean with variance \(0.1210\); an antithetic pair has \(\frac 12(0.2420 - 0.2342) = 0.0039\). The ratio is \(31\), matching the \(30\) of Software 16.5.3.
Problem 16.7.5. How would you verify a simulation model of a hospital emergency department, for which no formula is available?
Show solution
Solution. Check that each part behaves correctly by tracing events by hand on a short run; run special cases with known answers (one doctor, exponential times: an M/M/1 queue); check identities that hold whatever the details, such as Little’s law between the simulated mean number present, arrival rate and mean time in the department; and compare the simulated waits with the department’s records for the present staffing before using the model to predict the effect of changes. The first steps are verification (is the program right?), the last is validation (is the model right?).
Problem 16.7.6. For each situation name the model of this course you would use first: (a) choosing a weekly production mix under machine and labour limits; (b) siting two depots among five towns; (c) deciding how many checkout lanes to open; (d) ordering a seasonal product once; (e) deciding when to overhaul a fleet of buses.
Show solution
Solution. (a) Linear programming, with sensitivity analysis for the limits. (b) Integer programming (a facility-location model with binary site variables). (c) Queueing, an M/M/\(c\) model with a cost or service-level criterion, or simulation if arrivals vary through the day. (d) The newsvendor model. (e) A replacement model, or a Markov decision process if the buses’ condition is observed and deteriorates at random.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.