Thursday, May 6, 2010

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?

No comments:

Post a Comment