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

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