Monday, June 28, 2010

Term Grades

Code: 25rr6tc

In case of any complain, plz email Eng. Mariam
mariam.yahia@yahoo.com

Thursday, May 13, 2010

SHEET 10

Question 1:

Given the following histogram that describes the anticipated range of the GPA for a newly admitted student.

GPA

Probability

1 to 2

0.2

2 to 3

0.5

3 to 4

0.3

Generate ten random samples for the GPA, using the following uniformly distributed random numbers U[0,1]: 0.35, 0.97, 0.22, 0.15, 0.60, 0.43, 0.79, 0.52, 0.81, 0.65.

Hint: Use the following Formula for linear interpolation:

clip_image002

 

Question 2:

Given the following CDF for variable x, generate random samples for x, using the following uniformly distributed random numbers U[0,1]: 0.35, 0.97, 0.22, 0.15, 0.60, 0.43, 0.79, 0.52, 0.81, 0.65.

x

F(x)

1

0

2

0.2

3

0.7

4

1

Hint: Also use linear interpolation (similar to question 1).

Lect. Wed 12th May

Code: 33zknlo

Solution to Sheet 6

Code: 25r4dzb

Thursday, May 6, 2010

SHEET 9

Q1. Define rational numbers.

Q2. Define irrational numbers.

Q3. Give 3 examples for irrational numbers.

Q4. Compute the following:
(1+1/n)^n

when n = 10
n = 100
n = 1000
n = 10000
n = 100000

Q5. Develop a function such that the slope of the tangent at any point is equal to the value of the function at this point.
- Write the equation for this function, then draw it, and illustrate graphically the above condition.

Q6. Solve the following differential equation
dy/dx = a y
where a is a constant.

Q7. Integrate 1/x from 1 to a.
where a is a constant (bigger than 1)

Q8. Explain why the number 'e' is specifically chosen as the base for the natural logarithm.

Q9. Generate ten samples (variates) from the Weibull distribution.
(assume that all parameters of the distribution equal one).
Here are the Us:
0.95, 0.02, 0.60, 0.44, 0.93, 0.86, 0.42, 0.19, 0.35, 0.94

Q10. Solve question 4.1 in the book (pages 107 & 108).

Sheet 8

First Question:

Develop a program to simulate the process of (simultaneously) throwing 3 dices. The output of the program is the estimation of the probabilities of the following outcomes:

Sum of 3 dices is equal to 3

Sum of 3 dices is equal to 4

Sum of 3 dices is equal to 5

· …..

· …..

· …..

Sum of 3 dices is equal to 18

Second Question:

Using the Monte Carlo method, solve the following:

A. clip_image001

B. clip_image002

C. clip_image003

Hint:

In each problem, use the following sequence of 10 random for ux

0.41; 0.82; 0.10; 0.97; 0.24; 0.26; 0.30; 0.80; 0.65; 0.60

And use these numbers for uy

0.81; 0.43; 0.52; 0.18; 0.09; 0.56; 0.11; 0.73; 0.28; 0.42

Third Question:

Profit (LE) = Revenue (LE) – Cost (LE)

Revenue (LE) = Demand (units) * Price (LE/unit)

Demand

Probability

100,000

0.1

200,000

0.35

400,000

0.5

600,000

0.05

Price

Probability

1

0.1

1.1

0.25

1.2

0.4

1.3

0.25

Cost

Probability

10,000

0.6

20,000

0.2

40,000

0.1

60,000

0.1

Develop a program to draw the histogram of the profit.

n = 10,000 (the number of samples)

Note: In each iteration, generate 3 random numbers U1 U2 U3.

U1 determines demand

U2 determines price

U3 determines cost.

Hint :

Demand Random Number: U1

100,000 Less than .10

200,000 Greater than or equal to .10, and less than .45

400,000 Greater than or equal to .45, and less than .95

600,000 Greater than or equal to .95

Same logic applies to sampling price using U2; and applies to sampling cost using U3.

Fourth Question:

Using the program developed to estimate the size of a lake: Compute the value of π

(Hint: Draw another bitmap; & recall that the area of circle is equal to πr2 )

Fifth Question:

Suppose that the demand for a Mother Day card is governed by the following discrete random variable:

Demand

Probability

10,000

.10

20,000

.35

40,000

.30

60,000

.25

The greeting card sells for 4.00 LE, and the cost of producing each card is 1.50 LE. Leftover cards must be disposed of at a cost of 0.20 LE per card. How many cards should be printed?

Hint [1]:

Simulate each possible production quantity (10,000, 15,000, 20,000, …., 60,000) many times (say, 1,000 iterations).

In other words, there will be two loops structures.

Outer-loop: from production = 10,000 to production = 60,000 (step 5,000)

Inner-loop: Monte Carlo sampling loop;

Randomly select a value of Demand each time.

Then we determine which order quantity yields the maximum average profit over the 1,000 iterations

Hint [2]:

Demand Random Number: U

10,000 Less than .10

20,000 Greater than or equal to .10, and less than .45

40,000 Greater than or equal to .45, and less than .75

60,000 Greater than or equal to .75

Sixth Question:

A small supermarket is trying to determine how many copies of People magazine they should order each week. They believe their demand for People is governed by the following discrete random variable.

Demand

Probability

15

.10

20

.20

25

.30

30

.25

35

.15

The supermarket pays 1.00 LE for each copy of People and sells each copy for 1.95 LE. They can return each unsold copy of People for 0.50LE. How many copies of People should the store order?

Very Important Lect

تطوير برمجيات الهواتف المحمولة باستعمال أى فون

Mobile Programming Using iPhone

المهندس مصطفى عامر

من الجامعة المصرية للتعلم الإليكترونى


الاثنين 10 مايو الساعة 2:20

بقاعة السيمينار بالمجمع الطلابى


Lect. Wed 5th May

Code: 349atg9

Monday, May 3, 2010

Lect. Sunday 2nd May

Code: 27wy2um

Wednesday, April 28, 2010

Size of Lake Program

Code: 24lcxn2

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.

Mid Term April 2010

Code: 2g2sykr

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

Lect 31 March

Code: y8phjje

Wednesday, March 24, 2010

Sheet 4

Manually simulate the waiting line problem (given in book p.607) for 10 customers using the following modifications.

The first customer arrives at time zero.
The inter-arrival time and service time for the 10 customers are as follows:


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.
f- Utilization of server
g- Number of customers who had to wait more than 1 min.
h- Probability of waiting more than 1 min.
--
Each student must submit the answer of sheet 4.
The deadline is Friday 2nd of April 2010.
You send your answer as an attached pdf file to the following email:
sheet4@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:

Lect 24 March

Code: yaew4xu

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. 607-614)


Saturday, March 20, 2010

Sheet 3

Manually solve the inventory simulation problem (given in book) using the following modifications.

- Demand is represented by a uniform probability distribution ranging from 50 till 150 (units).

- Run the simulation 3 times, in order to try the following 3 values for Q:
50
100
150

The length of each simulation run is 5 months.
In each run, use the following 5 random numbers to generate random samples for Demand.
0.88 0.11 0.55 0.77 0.33

Beside the modifications listed above, use all the assumptions indicated in the book.

Required:
For each value of Q, compute the two output measures.
--
Each student must submit the answer of sheet 3.
The deadline is Friday 26th of March 2010.
You send your answer as an attached pdf file to the following email:
sheet_no3@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:






Wednesday, March 17, 2010

Research Skills for Finding Information in Digital Databases and the Internet

Code: yjqkyeq

Lect Wed 17 March + Associated Excel file

Code: y9z6nf3


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. 601-606)

Sunday, March 14, 2010

Lect Sun 14 March

Code: yghqcbx

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. 601-603)

Thursday, March 11, 2010

Sheet 2

Manually solve the following simulation problem

Profit = Revenue - Cost

Cost is a parameter (constant) .
Cost = 1,000,000 LE

Revenue = Price * Demand

Price is a probabilistic input that follows a continuous uniform distribution ranging from 8.5 LE to 9.5 LE.

Demand is also a probabilistic input that follows the discrete probability distribution given below

Demand Prob.
120,000 0.3
110,000 0.4
100,000 0.3

N.B. run 20 trials

To generate random samples of Price use the following random numbers
0.6557 0.0357 0.8491 0.9340 0.6787 0.7577 0.7431
0.3922 0.6555 0.1712 0.7060 0.0318 0.2769 0.0462
0.0971 0.8235 0.6948 0.3171 0.9502 0.0344

To generate random samples of Demand use the following random numbers
0.4387 0.3816 0.7655 0.7952 0.1869 0.4898 0.4456
0.6463 0.7094 0.7547 0.2760 0.6797 0.6551 0.1626
0.1190 0.4984 0.9597 0.3404 0.5853 0.2238

Required:
a- Compute the minimum value of Profit
b- Compute the maximum value of Profit
c- Compute the average value of Profit
d- Compute the standard deviation of Profit.
e- Compute the median of Profit.
f- Compute the 25th, 50th, 75th percentiles of Profit.
g- Determine the probability of loss.
h- Divide the range (based on your answers in a & b) into 10 equal intervals; then compute the frequency in each interval. Show your answer both as a table & a histogram.

--
Each student must submit the answer of sheet 2.
The deadline is Friday 19th of March 2010.
You send your answer as an attached pdf file to the following email:
sheet2@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:

Sunday, March 7, 2010

Lect Sun 7 March + Associated Excel file

Code: yksvusp

N.B. the numbers in the profit sheet are demo numbers (not computed by the model).
All other numbers in the rest of the sheets are actual numbers computed by the model (or actual input data).

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. 590-600)



Thursday, March 4, 2010

My Office Hours

Sun 4:00 -> 5:30
Wed 4:00 -> 5:30

Lect. Wed 3 March 2010

Code: yldh9xx

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. 590-593)

Sunday, February 28, 2010

Deadline of Sheet 1

Each student must submit the answer of sheet 1.
The deadline is Friday 5th of March 2010.
You send your answer as an attached pdf file to the following email:
sheet1@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:

Lect. Sunday 28 Feb 2010

Code: yk32pj7

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. 587-590)

Thursday, February 25, 2010

Sheet 1

Q1. Define a system

Q2. Define a model

Q3. Define simulation

Q4. You were asked to build a simulation model for a factory
a-Assume an objective for this study.
* Based on your answer in part a, identify the following:
b- controllable inputs for the model
c- Probabilistic inputs
d- Output measures.


Q5. You were asked to build a simulation model for a super-market
a-Assume an objective for this study.
* Based on your answer in part a, identify the following:
b- controllable inputs for the model
c- Probabilistic inputs
d- Output measures.

Q6. You were asked to build a simulation model for a clinic
a-Assume an objective for this study.
* Based on your answer in part a, identify the following:
b- controllable inputs for the model
c- Probabilistic inputs
d- Output measures.

Lect. Wed 24 Feb 2010

Code: yjsfcx2

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. 585-587)