Wednesday, April 28, 2010
SHEET 7
Using Monte Carlo Technique to Sample from Discrete Distributions
For each question: develop the corresponding code (by any computer language or
Excel) . Then solve it using paper, pencil and calculator.
1. Given the following 10 random numbers:
0.95, 0.02, 0.60, 0.44, 0.93, 0.86, 0.42, 0.19, 0.35, 0.94
Use theses random numbers to generate random observations for throwing a dice.
Plot the histogram and the associated discrete probability function.
Compare the two plots.
What should you do to enhance the resemblance of the two plots?
2. Use the same 10 random numbers (as in problem 1) to generate random samples
of “inter-arrival time” based on the following table:
Time (min) 1 2 3
Prob. 0.25 0.5 0.25
Plot the histogram and the associated discrete probability function.
Compare the two plots.
What should you do to enhance the resemblance of the two plots?
3. Given the following 10 random numbers:
0.26, 0.83, 0.01, 0.93, 0.27, 0.15, 0.60, 0.83, 0.20, 0.34
Use these random numbers to generate random samples of “service time” based on
the following table:
Time (min) 1 2 3
Prob. 0.5 0.25 0.25
Plot the histogram and the associated discrete probability function.
Compare the two plots.
What should you do to enhance the resemblance of the two plots?
4. By utilizing the “inter-arrival time” samples associated with the second question,
and the “service time” samples associated with the third question, solve the
corresponding simple one server queuing system
Find the percentage utilization of the server.
Find the average waiting time in the queue.
5. Use the same 10 random numbers (as in problem 1) to generate random
observations of the colors of a traffic light found by a randomly arriving car, when
green is 60% of the time, yellow is 10% and red is 30%.
Plot the histogram and the associated discrete probability function.
Compare the two plots.
What should you do to enhance the resemblance of the two plots?
6. Use the Monte Carlo Method to estimate the reliability of the following system
(i.e. the probability of the success of the system):
An industrial plant is protected by a system that consists of a sensor, an actuator,
and a shutdown valve arranged in series. The probabilities of failure for the units
are 10%, 5% & 2% respectively. All three units must perform satisfactory if the
system is to operate correctly.
Use the following random numbers for the sensor:
0.95, 0.02, 0.60, 0.44, 0.93, 0.86, 0.42, 0.19, 0.35, 0.94
And use the following random numbers for the actuator:
0.26, 0.83, 0.01, 0.93, 0.27, 0.15, 0.60, 0.83, 0.20, 0.34
And use the following random numbers for the valve:
0.13, 0.76, 0.07, 0.70, 0.49, 0.07, 0.27, 0.95, 0.82, 0.78
7. The weather can be considered a stochastic process because it evolves in a
probabilistic manner from one day to the next. Suppose that for a certain city the
weather forecast can be described as follows:
• The probability of rain tomorrow is 0.6 if it is raining today.
• The probability of being clear tomorrow is 0.8 if it is clear today.
Forecast the weather for the next 10 days; assuming that today is a clear day.
Hint: Use the same random numbers as in problem 1.
Wednesday, April 14, 2010
Lect. Wed 14 April
Code: y5xxfj7
This lecture is based on the book:
Elements of Stochastic Process Simulation
pages 46-66
Sunday, April 11, 2010
Sheet 6
Draw a flowchart to estimate the probability that out of 5 persons, 3 or more are born in the same month.
Hint:
There will be 3 functions:
First function:
Similar to the main function illustrated in fig. 3.3. (p.53).
Second function:
This function starts by calling the third function 5 times to generate: m1, m2, m3, m4, m5.
where: mj is the birth month of person j.
Then the function compares these 5 numbers and returns a boolean value.
value. '1' Indicates success; i.e. in this trial, we found three (or more numbers) that are equal.
value '0' indicates failure.
Third function:
Randomly generate the month of birth for a single person.
You can use this formula: 1+int(12*Rand)
N.B. Read this site to know how to draw flowcharts in word.
Or use SmartDraw SW or Visio SW.
Wednesday, April 7, 2010
Project 1
Each group (min. 4 persons & max. 7 persons) should develop a program (using any programming language) to solve the ATM waiting line problem given the following assumptions:
1- The number of ATMs is a variable given by the user.
2- The service time of all ATMs is constant and equals to 10 min.
3. The inter-arrival time is represented by a uniform probability distribution ranging from 0.5 to 1.5 min.
4. The first customer always arrive at time zero.
5. Simulate the model for 10,000 customers.
Compute all the relevant output measures (as indicated in the book).
N.B. Ignore the start-up period.
Deadline: 12 May
Sunday, April 4, 2010
Sheet 5
Manually simulate the TWO ATMs waiting line problem (given in book p.614) for 10 customers using the following modifications.
The first customer arrives at time zero.
The inter-arrival time for the rest of customers are as follows:
0.3, 0.9, 1.1, 0.2, 0.6, 1.7, 1.1, 0.1, 1.8
The service time of the first ATM is constant and equals to 3.4
The service time of the second ATM is constant and equals to 3.6
Beside the modifications listed above, use all the assumptions indicated in the book.
Required:
a- Number of customers who had to wait
b- Probability of waiting
c- Average waiting time
d- Maximum waiting time
e- Minimum waiting time.
--
Each student must submit the answer of sheet 5.
The deadline is Friday 16th of April 2010.
You send your answer as an attached pdf file to the following email:
sheet_5@ymail.com
Recall to put your name and ID no. in the first page of the pdf file.
N.B. To convert any document into a pdf file you can use the following free SW:
http://www.cutepdf.com/download/CuteWriter.exe
Lect 4 April
Code: yglnrfx
This lect. is based on the book:
An Introduction to Management Science Quantitative Approaches to Decision Making 12th Edition International Edition 2008
Chapter 13 (pp. 614-618)
Thursday, April 1, 2010
Subscribe to:
Posts (Atom)