Monday, June 28, 2010
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:
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).
Thursday, May 6, 2010
SHEET 9
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:
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:
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:
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
بقاعة السيمينار بالمجمع الطلابى