Professional Documents
Culture Documents
Introduction To Simulation: Dr. Samah Mohammed
Introduction To Simulation: Dr. Samah Mohammed
Introduction To Simulation: Dr. Samah Mohammed
Simulation
Lecture 8
2
How much the Beggar Earns
There is one beggar passed around the houses asking for
money and from her experience she know if the people
speak with her behind the doors 80 % of them are women
and 20% are men.
The 70 % of the women give her money but 40 % of the
men only give her the money.
The amount of money given by the women between (18 ,
22).
The amount of money given by the men between (7,10)
3
Simulation of the Beggar Earns
Example (7)
The beggar cover around 10 to 15 houses per day .
Do the simulation for 5 days.
Result:
Decide the average of the earns money per day.
4
Simulation of the Beggar Earns
Example (7) Cont...
The distributed probability table of the visited houses by the beggar
Cumulative
Probability
6
Simulation of the Beggar Earns Cont...
The distributed probability table for female pay:
Cumulative Probability
Cumulative Probability
7
Simulation of the Beggar Earns Cont...
The distributed probability table for female donation:
Cumulative Probability
8
Simulation of the Beggar Earns Cont...
The distributed probability table for Male donation:
Cumulative
Probability
9
Simulation of the Beggar Earns Cont...
Part of simulation
10
Simulation of the Beggar Earns Cont...
11
Simulation of the Beggar Earns Cont...
By the end of the 5 days .The beggar earns 715 Pounds.
Avg. Earns = Total earns
Number of day
12
RANDOM NUMBER GENERATION
Random number is very important for the
simulation modelling algorithm as we see
in the previous lectures so we want to
know how we will generated and what is
their attributes of the random number.
13
RANDOM NUMBER GENERATION
(CONT.)
ì1 , 0 £ x £ 1
f(x) = í
î0 , otherwise
14
RANDOM NUMBER GENERATION
(CONT.)
15
RANDOM NUMBER GENERATION
(CONT.)
Expected number of Ri
1
E (R ) [x / 2 ] 10 1 / 2
2
x dx
0
1
V (R ) [ E ( R )]
2 2
x dx
0
[x 3 / 3] 1
0 (1 / 2 ) 2
1 / 3 1 / 4
1 / 12
16
RANDOM NUMBER GENERATION
(CONT.)
17
PSEUDO-RANDOM NUMBER
GENERATION