CS 1538: Introduction to Simulation Homework 1 1. A fair six-sided die is rolled three times. Let X be a random variable that represents the number of unique outcomes in the three tosses. For example, if the outcomes were 1, 4, and 1, then X would be 2 (since we saw two unique outcomes:1 and 4). What is E[X]? For three rolls of a six-sided die, there are 6 3 = 216 possible outcomes. Let our random variable X represent the number of unique outcomes from those three tosses: 1, 2, or 3. X = 1: This occurs if all three rolls have the same side showing. There are only six ways this can occur (1-1-1, 2-2-2,, 6-6-6). X = 3: This occurs if all three rolls produce different results; there are 6 5 4 = 120 ways for this to happen. (For the first toss, there are 6 choices, then 5 for the second, then 4 for the third). Note that here, the order matters. An outcome of 1-2-3 is counted separately from an outcome of 2-1-3 in the 216 possible cases. X = 2: Any remaining outcomes are in this category: 216 6 120 = 90. This can also be calculated directly: o There are three configuration where exactly two die tosses come out the same: Z-Z-Y, Y-Z-Z, Z-Y-Z. Each of these configurations has 6 5 = 30 possible outcomes. Since there are three configurations, that gives 3 30 = 90 possible ways for X = 2. From the above, we know: Pr(X = 1) = 6/216 Pr(X = 2) = 90/216 Pr(X = 3) = 120/216 So, E[X] = 1 6/216 + 2 90/216 + 3 120/216 2.53 2. In the production of widgets, imperfections render them unfit for sale. It has been observed that, on average, 3 in every 250 widgets has one or more of these defects. What is the probability that a random sample of 3500 will yield fewer than 5 widgets with defects? We are examining items which are either defective or not, which suggests one of the Bernoulli-based distributions. Since we are given a set sample size greater than 1, this suggests that it s most likely the Binomial distribution. Binomial Distribution Parameters: n = 3500 p = 3/250 = 0.012
Pr ( X <5 )= Pr ( X 4)= 4 ( 3500 i ) 0.012i (1 0.012 ) 3500 i You could use the Poisson approximation for this solution since the n is large and the p is small. 3. An old production machine has a 8% chance of producing a defective item. Once it makes five defective items, it is stopped, adjusted, and restarted. a. What is the chance that it will produce at least nine items before being adjusted? We are again examining items which are either defective or not, so it s again a Bernoulli-based distribution. This time, trials continue to run until we reach at least one success, suggesting Geometric or Negative Binomial. Since we wait until five defective items, this is the Negative Binomial Distribution. In this case, a success is defined as a defective item. Negative Binomial Parameters: p = 0.08 k = 5 Pr ( X 9 )=1 Pr ( X <9 )=1 8 ( i 5 1) (1 0.08 )i 5 0.08 5 b. On average, how many items would it produce before being adjusted? This is asking for the expected number of items produced before being adjusted, so we just need the expected value formula for the Negative Binomial distribution: E [ X ]= k p = 5 =62.5 62 0.08 4. The drive-thru window of a fast food restaurant has arrivals that follow a Poisson distibution with a rate of 1.2 per minute. a. What is the probability of zero arrivals in the next minute? We re told that the arrival of events occurs according to a Poisson distribution, so we re considering the family of Poisson-based distributions. We re being asked to calculate the probability of a number of arrivals, so we use the Poisson distribution. Poisson Parameters: α = 1.2 t = 1
λ = α / t = 1.2 Pr ( N =0 )= e α α x x! = e 1.2 1.2 0 0! 0.30 b. What is the probability of zero arrivals in the next two minutes? This still follows a Poisson distribution: Pr (N (t=2)=0)= e α α x x! = e λt ( λt ) x = e 1.2 2 (1.2 2) 0 0.091 x! 0! 5. A web server crashes in accordance with a Poisson process, with a mean rate of one crash every 1,500 days. Determine the probability that the next crash will occur between 3 and 5 months after the last crash. We are again dealing with a Poisson process, but this time we re being asked about the time between events, suggesting the Exponential or Erlang. Since we re waiting for just one event to occur, we will use the Exponential distribution. Exponential Parameters: λ = 1/1500 crashes/day Pr (3weeks T 5weeks )=Pr (21 T 35)=Pr (T 35 ) Pr (T 21) Pr (T 35 ) Pr (T 21)=[1 e 35 λ ] [1 e 21 λ ]= e 35 1 ( 21 1500) ( 1 +e 1500) 0.0092 6. A weather buoy has a service life (in years) that follows this pdf: f ( x )={ 0.35e 0.35 x, x 0 0, otherwise a. What is the probability that this buoy is still working after 4 years? Since we are given the pdf and any parameters, we don t need to identify them. 4 Pr ( X >4 )=1 Pr ( X 4 )=1 0 f ( x ) dx=1 ( e 0.35 x ) 4 0 0.247 b. What is the probability that the buoy dies between 3 and 6 years from the time it is deployed in the sea? Pr (3 X 6 )=Pr ( X 6 ) Pr ( X 3)=( e 0.35 6 ) ( e 0.35 3 ) 0.227
7. The rail shuttle cars at the Atlanta airport have a dual electrical braking system. A rail car switches to the standby system automatically if the first system fails. If both systems fail, there will be a crash. Assume that the life of a single electrical braking system is exponentially distributed, with a mean of 4000 operating hours. If the systems are inspected every 5000 operating hours, what is the probability that a rail car will not crash before that time? We re told that the time between events (failures) is exponentially distributed, which means that we re dealing with a Poisson process. We re being asked to calculate the time for two events to happen. Since we re being asked about time, that tells us it s either an Exponential distribution or Erlang distribution problem. Since we re waiting for more than one event to occur, it is the Erlang distribution. Erlang Parameters: k = 2 λ = 1/4000 θ = λ / k = (1/4000) / 2 = 1 / 8000 [ k Pr (T 5000 )=1 Pr (T 5000 )=1 1 1 e kθt ( kθt ) i ] k = 1 e λ t ( λ t ) i 1 = e 5000/4000 (5000 /4000 ) i 8. Port Authority reports that a 64 bus will arrive at a paricular stop at a time that is uniformly distributed between 8:40 A.M. and 8:50 A.M. If a rider were to arrive at 8:40 A.M., what is the probability that the rider will wait between 5 and 10 minutes? Uniform distribution (because the problem tells us that). Uniform Parameters: a = 0 (if we take 8:40 A.M. to be at time 0) b = 10 (if we measure time in minutes) Pr (5 X 10 )=Pr ( X 10 ) Pr ( X 5 )= 10 0 10 0 5 0 10 0 = 5 10 =0.5 9. Suppose the outcome of an exam is normally distributed with mean=70 and standard deviation=12. There were 200 students in the class. The professor wants to have an individual meeting with all the students who scored lower than X points. Suppose each meeting will be 20 minutes long, and the professor only has two hours for these meetings. At what score should he set X to be? Normal distribution (because the problem tells us that). Normal Parameters:
µ = 70 σ 2 = 12 2 = 144 Total number of meetings possible = 2 hours / (20 minutes/meeting) = 6 meetings With only 6 meetings, the professor can only meet with 6 / 200 = 3% of the class. What value of x satisfies Pr ( X x ) 0.03? Since there s no Normal distribution table for N(70, 144), we first transform it to the Standard Normal: Pr ( Z x 70 144 ). What value of z satisfies Pr (Z z ) 0.03? Looking it up in a table shows the value lies between -1.88 and -1.89. Since Pr (Z 1.89 )<0.03 and Pr (Z 1.88 )>0.03, we take z = -1.89. Transforming back to the N(70, 144) distribution: z= x 70 144 12 z+70=x x=12 1.89+70=47.32 10. Suppose that a battery has an exponential time-to-failure distribution with a mean of 60 months. At 72 months, the battery is still operating. What is the probability that this battery is going to die in the next 12 months? We re told that the time between events is exponential and we re asked to find the time until the first event, so this follows the Exponential distribution. Exponential parameters: λ = 1/60 We can exploit the memoryless nature of the Exponential distribution to arrive at: 1 60 Pr ( X 12 )=1 e 12 0.221 11. A fisher expects to catch a fish every 25 minutes. a. What is the probability that she will need to wait 2 hours to catch 4 fish? We re asked to calculate a probability involving the time before 4 events. Since we re waiting for events, it s a Poisson process. Since we re being asked about time, it s either Exponential or Erlang. Since we re waiting for more than 1 event, it s Erlang. Erlang parameters:
k = 4 λ = 0.417 hours k Pr (T 2 )=1 Pr (T 2 )=1 [ 1 1 e λt ( λt ) i ] 3 = e 0.417 2 (0.417 2) i b. What is the probability that she will need to wait between 3 and 5 hours to catch 8 fish? It s still Erlang with the same parameters. )=[ Pr (3 T 5 )=Pr (T 5 ) Pr (T 3 1 k 1 e λ 3 ( λ 3) i i! k 1 e λ 5 ( λ 5 ) i k 1 e λ 5 ( λ 5 ) i ] [ k 1 1 e λ 3 ( λ 3) i ] 8 1 e 0.417 3 ( 0.417 3 ) i e 0.417 5 (0.417 5) i =