Professional Documents
Culture Documents
Simulation
“Simulation is the process of designing a model of a
real system and conducting experiments with this
model for the purpose of either understanding the
behavior of the system and/or evaluating various
strategies for the operation of the system.”
rn = p.rn-1 (modulo m)
Where p and m are positive integers, P<m, rn-1 is
the k-digit number and modulo m means that rn is
the reminder when p.rn-1 is devised by m. this
means, rn and p.rn-1 differ by an integer multiple of
m.
RN Generation…Cont’d
• To start the process of generating random numbers, the first
number r0 is specified by the user.
• For illustration, let p= 35, m= 100 and arbitrary start with r0=
57.
• Since m-1 = 99 is the 2=digit number, therefore, it will
generate 2-digit random numbers:
r1 = pr0 (modulo m)= 35 x 57 (modulo 100)
1,995/100 = 95, reminder
r2 = pr1 (modulo m)= 35 x 95 (modulo 100)
3,325/100 = 25, reminder
r3 = pr2 (modulo m)= 35 x 25 (modulo 100)
875/100 = 75, reminder
RN Generation…Cont’d
Remark
I. We can pick up random numbers from
random table, or
II. Use built-in Excel formula to generate
random numbers
RN Generation…Cont’d
12.5 min
Average waiting time= 1.25 min percustome r
10customers
8customers
Average queue length= .80customer
10customers
Average time
in the system= 24.5 min
2.45 min percustomer
10customers
Example 3: Simulation of a machine breakdown and
Maintenance System
• A continuous probability distribution of the time between
machine breakdowns is given by;
x
f ( x) ,0 x 4weeks
8
Where X = Weeks between machine breakdowns
2 .55
3 .30
x
f ( x) ,0 x 6weeks
18
Where x= Weeks between machine breakdowns
Machine breakdown…Cont’d
Using the sequence (first three random number for the first trial, etc) simulate the
average profit for the above project of the basis of ten trials.
Solution
Random numbers 0-99 are allocated in proportion to the probabilities associated with
each of the three variables as given under:
Selling price Probability Cum RN assigned
(Br) probability
3 0.2 0.2 00-19
4 0.5 0.7 20-69
5 0.3 1.0 70-99
10 3 40 2 02 2000
5 39 4 68 2 08 2000
6 59 4 66 2 90 5000
7 12 3 64 2 79 5000
8 31 4 86 2 68 5000
9 82 5 89 2 25 2000
10 11 3 98 3 16 2000
Profit = sales (Br) – total cost(Br)
= selling price * sales volume – (variable cost*sales volume + fixed cost)
SN Selling Variable Sales Profit
price (Br) cost (Br) Volume
1 5 2 5000 11000
2 3 2 3000 -1000
3 4 1 2000 2000
4 3 2 2000 -2000
5 4 2 2000 0
6 4 2 5000 6000
7 3 2 5000 1000
8 4 2 5000 6000
9 5 2 2000 2000
10 3 3 2000 -4000
Total profit = 21,000 Birr
Thus, Average profit per trial = 21000/10 = 2100 Br
Role of Computers in Simulation