Midterm CS433 Key Answers
Midterm CS433 Key Answers
1. (2 points)
a. True or False? The process of validation checks to see if your computer code is correct.
c. True or False? The heart of any simulation language is the future events list.
d. Using your own words, clearly explain the difference between modeling and simulation.
2. What is an D/M/1 and M/M/1 queue? Is a Web server probably better modeled with a D/M/1 or
M/M/1 queue? Explain your answer. (1 points)
3.The first eight customers at Menahi’s single-server ice cream shop have the following inter-
arrival times and priorities:
Further, if an arriving customer sees two or more people in the line, he will become disgusted and
leave the shop without ever entering the line. Each customer requires exactly 4 time units to be
served.
4. A random variable X can take on discrete values (negative integers and 0) as well as
continuous values (positive real numbers). It can be modeled by a probability density function f(x)
for the continuous values and a probability distribution function p(x) for the discrete values.
a. Write down the expression stating that the probability of X taking on any value is 1. (1 point)
- Compute the mean E(X) and variance V(X) for the above random variable (2 points).
6.
a. If X ~ Exp(λ ) represents the lifetime of a lightbulb, find the probability that the lightbulb will
survive at least 1/λ time units. (1 points)
e-1.
b. If X ~ Exp(λ ) represents the lifetime of a lightbulb, find the probability that the lightbulb will
survive at least 2/λ time units given that it has already survived at least 1/λ time units. (1 point)
7. A bus arrives every 20 minutes at a specified stop beginning at 6:40 a.m. and continuing until
8:40 a.m. A certain passenger does not know the schedule, but arrives randomly (Uniformly
distributed) between 7:00 a.m. and 7:30 a.m. every morning.
- What is the probability that the passenger waits more than 5 minutes for a bus? (3 points)
The passenger has to wait more than 5 minutes only if the arrival time is between 7:00 and 7:15
or between 7:20 and 7:30. If X is a RV that denotes the # of minues past 7:00 that the passenger
arrives,
the desired probability is P(0 < X < 15) + P(20 < X < 30). X is a uniform RV on (0,30).
Therefore the desired probability is given by
8. Customers arrive at a store according to a Poisson process. The mean inter-arrival time is 2
minutes.
a. What is the probability that at least 2 customers arrive during a time interval of 4
minutes? (2 points)
b. The 1rst customer arrived after 1 minute. What is the probability that the second
customer arrives less than 1 minute later? (2 points)
d. After the store has been open for 8 hours, the number of customers n are counted. What
is the probability distribution for n? Give a formula. (2 points)
9. Suppose we are going to compute the area of a circle whose equation is (x+4)2 + (y-3)2 = 25,
using Monte Carlo simulation method.