HO 4 CSC 354S SYSTEMS MODELING AND DISCRETE SIMULATION SPRING 1997 UNIVERSITY OF TORONTO MIDTERM TEST DURATION - 50 minutes Test aids allowed: One 8.5 X 11" fact sheet, possibly double-sided Notes to students: A. There are a total of 50 marks and 50 minutes to obtain them. B. The test paper has 6 questions. Write your answers on the paper or booklets provided. C. In general, state your assumptions and show your intermediate work leading to an answer. 1. [6 marks] Define the following terms in the context of this course a) trace-driven simulation A simulation where the input variables are actual measured values, in sequence, from the operation of a real system b) Type I error in hypothesis testing The probability of rejecting the null hypothesis when it is in fact true 2. [5 marks] Give an example of a stream of random numbers that are uniformly distributed, have maximum period, but are not independent. If the modulus for an LCG is m, then the sequence 0 , 1 , 2 , . , m-2 , m-1 , 0 , 1 , 2 , . is uniformly distributed and has maximum period m, but it is clearly not independent, as it would fail the runs test. 3. [5 marks] How is the box plot used to assess symmetry in experimental data? The left end of the box is the lower quartile and the right end is the upper quartile. Using visual (eye-balling) techniques, the median should fall approximately in the middle of the box. The lower octile should lie to the left of the box in the same way as the upper octile to the right of the box. The minimum and the maximum should obey the same relationship. If any of these "should" statements is grossly wrong, the distribution is probably not symmetric. 4. [10 marks] IQ scores are normally distributed throughout society with a mean of 100 and a standard deviation of 15. A person with an IQ of 140 or higher is called a "genius". What proportion of society is in the genius category? Do reasonable interpolations in the absence of a calculator. P ( X 3 140 ) = 1 - F[( 140 - 100 ) / 15 ] = .00383 5. [12 marks] The time until a component is taken out of service is exponentially distributed. Two such components are put in series, where one has a mean component lifetime of 2 hours and the other 6 hours. The whole system goes down when one of the components goes down. Devise two distinct ways to generate a variate that represents system lifetime. This is Problem 9-21, which resembles 9-20, which you did for tutorial. I. Generate X ~ exp ( «) and Y ~ exp ( 1/6 ) . Set Z = min ( X , Y ) . II. F ( Z ) = P ( Z œ z ) = 1 - P ( Z > z ) = 1 - P ( X > z, Y > z ) = 1 - e-l1z e-l2z = 1 - e-(l1 + l2)z Therefore Z is exponential with parameter l1 + l2 = « + 1/6 = 2/3 . So generate Z = - 1.5 ln u , where u ~ U(0,1). 6. [12 marks] In a sequence of Bernoulli trials (with success probability p ), the number of failures before the mth success has a negative binomial distribution. Describe a method to generate variates that have a negative binomial distribution. Generate u ~ U(0,1) until m of the u's are greater than p . The result is then the number of u's less than or equal to p.