Section2 Simulation
Section2 Simulation
Section2 Simulation
Year :
➔ Example No 3 :
➢ A news boy buys paper for 15 P.T. each and sells them for 25 P.T. each unsold
papers have no value in analyzing past sells it is found that three demand
distribution exist, depending on news events in the papers. A good
interesting news day yield to many potential customer, typical and poor days
yield to less interest. Historically 20% of days have been “poor”, 50%
“typical”, 30% “good”, The demand distributions are summarized :
➢ Simulate 10 days period and determine main daily profit, max profit, min
profit if he decides to buy 80 papers each day. Use the following R.N :-
09 65 69 66 57 64 84 24 92 22 49 50 61 01 45 48 48 45 52
35
?? Implement c# program to simulate this problem ??
Page 1 of 4
➢
- Note : We have two digit random numbers that means that range of numbers 00 →99
- Poor take numbers from 00 → 19
- Typical take numbers from 20 → 69
- Good take numbers from 70 → 99
➔ 80 paper each day → Max buy 80 paper per day
➔ Note: we take 2 Random number first one to determine the type of new day , The
second one to determine demand “ how much he sell in that day “.
1st Day :
RN =09 → Poor
RN= 65 → demand = 60
Profit = 60*25 – 80*15 = 300 P.T
2nd Day :
RN= 69 → Typical
RN = 66 →demand = 80
Page 2 of 4
Profit = 80*25 – 80*15 = 800 P.T
3rd Day :
RN = 57 → Typical
RN = 64 → demand = 80
Profit = 80*25 – 80*15 = 800 P.T
4th Day :
RN= 84 → Good
RN =24 → demand = 100 = 80 → because max of buy is 80 paper each day
Profit = 80*25 – 80*15 = 800 P.T ; we calculate with demand 80 NOT 100.
5th Day :
RN= 92 → Good
RN = 22→ demand = 100 = 80 → because max of buy is 80 paper each day
Profit = 80*25 – 80*15 = 800 P.T ; we calculate with demand 80 NOT 100.
6th Day :
RN= 49 → Typical
RN =50 → demand = 80
Profit = 80*25 – 80*15 = 800 P.T
7th Day :
RN= 61 → Typical
RN= 01 → demand = 50
Profit = 50*25 – 80*15 = 50 P.T
8th Day :
RN = 45 → Typical
RN= 48 → demand = 80
Profit = 80*25 – 80*15 = 800 P.T
9th Day :
RN = 48 → Typical
RN= 45 → demand = 80
Profit = 80*25 – 80*15 = 800 P.T
10th Day :
RN= 52 → Typical
RN= 35 → demand = 70
Profit = 70*25 – 80*15 = 550 P.T
Page 3 of 4
• MIN profit we found it in 7th day which is 50 P.T
• MAX profit is 800 P.T
• Main daily profit
300+800+800+800+800+800+50+800+800+550/10=650 PT
Page 4 of 4
El-Shorouk Academy
Traffic lights
Page 1 of 3
Answer
It is given that :-
Random numbers that are one-digit are from 0 -------> 9 [ten integer numbers].
• Then let the random numbers that indicate to green are five numbers (50%)
,say : 0-1-2-3-4
• the random number that indicate to yellow is one number which is: 5
• , and the random numbers that indicate to red are the remaining four numbers
which are: 6-7-8-9
Y -----> 5 0.1
R -----> 6, 7, 8, 9 0.4
Then:-
Page 2 of 3
Simulated probability of Green = 2/5 = 0.4
Simulated probability of Red = 2/5 = 0.4
Simulated probability of yellow = 1/5 = 0.2
Conclusion :-
• Error of Green is 20% which means that the simulated probability of RED
decreased by 20 % because the theoretical probability = 0.5 then after compute
simulated probability it become = 0.4 then it decreased ( 0.5 → 0.4 ) , means also the
simulated probability is less than the theoretical probability.
• Error of YELLOW is 100% which means that the simulated probability of RED
increased by 100 % because the theoretical probability = 0.1 then after compute
simulated probability it become = 0.2 then it increased ( 0.1 → 0.2 ) , means also the
simulated probability is greater than the theoretical probability.
Page 3 of 3