100% found this document useful (1 vote)
244 views28 pages

Final (BDSM) Simulation

The document simulates rolling a pair of dice 20 times to calculate the mean value. It generates random probabilities for each roll, calculates the sum of the dice, and tracks the frequency of each possible sum. After 20 rolls, it displays the results and calculates the mean sum as 36/20 = 1.8.

Uploaded by

usman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
244 views28 pages

Final (BDSM) Simulation

The document simulates rolling a pair of dice 20 times to calculate the mean value. It generates random probabilities for each roll, calculates the sum of the dice, and tracks the frequency of each possible sum. After 20 rolls, it displays the results and calculates the mean sum as 36/20 = 1.8.

Uploaded by

usman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 28

A coin is tossed 100 times, develop a simulation as to how many head or tails will be otained.

Probabilities
Event Prob. Cum. Lower Upper Event
Head 0.5 0.5 0 0.5 Head
Tail 0.5 1 0.5 1 Tail
Method 1

Toss Prob Event


1 0.728538 Tail
2 0.676309 Tail
3 0.929672 Tail
4 0.312324 Head
5 0.331727 Head
6 0.012984 Head
7 0.680499 Tail
8 0.13946 Head
9 0.630989 Tail
10 0.211484 Head
11 0.046796 Head
12 0.839297 Tail
13 0.554052 Tail
14 0.259723 Head
15 0.949492 Tail
16 0.048433 Head
17 0.462547 Head
18 0.258526 Head
19 0.284338 Head
20 0.020708 Head
21 0.462816 Head
22 0.157945 Head
23 0.325604 Head
24 0.509198 Tail
25 0.654937 Tail
26 0.722308 Tail
27 0.928433 Tail
28 0.267378 Head
29 0.384815 Head
30 0.289171 Head
31 0.982954 Tail
32 0.892246 Tail
33 0.645316 Tail
34 0.582981 Tail
35 0.067389 Head
36 0.902483 Tail
37 0.090451 Head
38 0.307531 Head
39 0.229415 Head
40 0.094442 Head
41 0.999344 Tail
42 0.191333 Head
43 0.963971 Tail
44 0.621131 Tail
45 0.257438 Head
46 0.25633 Head
47 0.102466 Head
48 0.824699 Tail
49 0.364711 Head
50 0.52497 Tail
51 0.94855 Tail
52 0.219314 Head
53 0.698392 Tail
54 0.430535 Head
55 0.096594 Head
56 0.844088 Tail
57 0.000842 Head
58 0.775805 Tail
59 0.160191 Head
60 0.476348 Head
61 0.214271 Head
62 0.636131 Tail
63 0.792784 Tail
64 0.480845 Head
65 0.721253 Tail
66 0.031936 Head
67 0.246562 Head
68 0.526055 Tail
69 0.18169 Head
70 0.733126 Tail
71 0.896741 Tail
72 0.934278 Tail
73 0.392696 Head
74 0.804442 Tail
75 0.641495 Tail
76 0.728329 Tail
77 0.05636 Head
78 0.262653 Head
79 0.367072 Head
80 0.585352 Tail
81 0.320628 Head
82 0.762852 Tail
83 0.909149 Tail
84 0.59716 Tail
85 0.045341 Head
86 0.167464 Head
87 0.73789 Tail
88 0.728315 Tail
89 0.951682 Tail
90 0.255134 Head
91 0.02659 Head
92 0.638379 Tail
93 0.114135 Head
94 0.036071 Head
95 0.379639 Head
96 0.209281 Head
97 0.30793 Head
98 0.947104 Tail
99 0.18496 Head
100 0.238946 Head
Method 2

Number ofFrequency Toss Event Number of frequency


Head 55 1 Head Head 48
Tail 44 2 Tail Tail 52
3 Tail
4 Head
5 Tail
6 Head
7 Head
8 Head
9 Head
10 Head
11 Tail
12 Head
13 Tail
14 Tail
15 Head
16 Tail
17 Tail
18 Head
19 Tail
20 Head
21 Tail
22 Head
23 Tail
24 Head
25 Head
26 Head
27 Head
28 Head
29 Tail
30 Head
31 Tail
32 Head
33 Head
34 Tail
35 Head
36 Tail
37 Head
38 Head
39 Tail
40 Tail
41 Head
42 Head
43 Tail
44 Tail
45 Head
46 Head
47 Tail
48 Head
49 Tail
50 Head
51 Tail
52 Tail
53 Tail
54 Tail
55 Tail
56 Tail
57 Head
58 Tail
59 Tail
60 Tail
61 Head
62 Tail
63 Head
64 Head
65 Tail
66 Tail
67 Tail
68 Tail
69 Head
70 Tail
71 Head
72 Tail
73 Head
74 Tail
75 Head
76 Tail
77 Head
78 Tail
79 Head
80 Tail
81 Head
82 Tail
83 Head
84 Tail
85 Tail
86 Tail
87 Head
88 Head
89 Tail
90 Tail
91 Head
92 Head
93 Tail
94 Tail
95 Tail
96 Tail
97 Head
98 Head
99 Head
100 Tail
Simulate the rolling of a pair of dice 20 times and compute the mean value on the basis of
simulated values.

1 2 3 4 5 6 Sum Freq Prob Cum


1 2 3 4 5 6 7 2 1 0.027778 0.027778
2 3 4 5 6 7 8 3 2 0.055556 0.083333
3 4 5 6 7 8 9 4 3 0.083333 0.166667
4 5 6 7 8 9 10 5 4 0.111111 0.277778
5 6 7 8 9 10 11 6 5 0.138889 0.416667
6 7 8 9 10 11 12 7 6 0.166667 0.583333
8 5 0.138889 0.722222
9 4 0.111111 0.833333
10 3 0.083333 0.916667
11 2 0.055556 0.972222
12 1 0.027778 1
36
Simulation
Cum Prob Rolling of Dice Prob Sum Sum
Lower Upper Sum 1 0.6731557718 8 2
0 0.027778 2 2 0.9528981668 11 3
0.027778 0.083333 3 3 0.1754177736 5 4
0.083333 0.166667 4 4 0.7598009566 9 5
0.166667 0.277778 5 5 0.9029241103 10 6
0.277778 0.416667 6 6 0.3022770247 6 7
0.416667 0.583333 7 7 0.594314799 8 8
0.583333 0.722222 8 8 0.7883923441 9 9
0.722222 0.833333 9 9 0.76450199 9 10
0.833333 0.916667 10 10 0.1899921282 5 11
0.916667 0.972222 11 11 0.228635054 5 12
0.972222 1 12 12 0.066774231 3 Mean
13 0.5305473479 7
14 0.6691889458 8
15 0.805098514 9
16 0.9286122612 11
17 0.1361264419 4
18 0.1380346687 4
19 0.7550302918 9
20 0.6830058948 8
Freq
0
1
2 mean
3 7.0
1
1
4
5
1
2
0
7
Chart Given below contains the number of units sold of a product and its related frequency,
you are required to develop a simulation for next 10 days period. Find the revenue if the
constant price of Rs. 25 is charged per unit.
Xm is the average of minimum
and maximum of quantity

X Prob
Min Max Prob Cum Lower Upper Xm
0 5 0.1 0.1 0 0.1 3
6 10 0.2 0.3 0.1 0.3 8
11 15 0.18 0.48 0.3 0.48 13
16 20 0.2 0.68 0.48 0.68 18
21 25 0.12 0.8 0.68 0.8 23
26 30 0.1 0.9 0.8 0.9 28
31 35 0.1 1 0.9 1 33

Lower and Upper probabilities have been computed with the help of Cumulative
Probability. It starts from the lower up to the maximum cumulative for each group.
Random Number is generated and then trough
Vlookup that random number is looked for in lower
and upper probabilites and then the corresponding
age of minimum quantity is returned.
of quantity =VLOOKUP(RAND(),$G$5:$I$11,3,TRUE)

Day Quantity Revenue


1 18 450
2 28 700
3 13 325
4 13 325
5 33 825
6 18 450
7 3 75
8 8 200
9 3 75
10 8 200
Mean 14.5 362.5
SD 9.50 237.50
Performance of the employees is rated on 10 points Scale 10. 1 means lowest performance and 10 means the
highest performance. The probabilities of specific perfromance for 10 different employees are in the table given
below. You are required to run 30 days simulation to see whether someone is below the lower accepted
performance of 5.

Limits Performance of the Employees


Lower Upper 1 2 3 4 5 6 7 8 9 10 Prob
0 0.2 4 2 5 4 3 4 3 5 4 2 0.2
0.2 0.4 6 4 7 5 4 5 4 6 5 3 0.2
0.4 0.7 8 5 8 6 5 6 4.5 7 6 4 0.3
0.7 0.9 9 4 9 7 6 7 6 8 7 5 0.2
0.9 1 10 7 10 8 7 8 7 0 8 6 0.1

Pefromanc Should be more than 5 on average

Simulated Performance of the Employees


Day Emp1 Emp2 Emp3 Emp4 Emp5 Emp6 Emp7 Emp8 Emp9 Emp10
1 4 4 9 8 4 5 4 5 5 2
2 6 2 8 7 3 7 7 0 5 6
3 6 4 9 5 6 5 7 7 5 4
4 4 5 8 5 7 4 3 5 5 5
5 4 5 8 5 7 4 4 7 6 2
6 4 5 8 6 4 6 4 0 4 5
7 8 7 9 8 7 7 4 7 5 3
8 6 5 9 7 5 5 3 0 7 5
9 4 2 10 6 5 6 4.5 0 6 2
10 8 4 8 8 4 6 4.5 6 5 4
11 8 5 9 7 5 7 4 7 5 2
12 8 4 8 4 5 4 3 8 7 4
13 4 7 9 5 5 6 3 7 8 5
14 6 4 8 6 3 6 4 6 4 2
15 10 2 7 4 7 7 4.5 6 5 5
16 6 2 9 4 3 6 4 8 5 4
17 9 4 5 6 5 6 4.5 7 5 4
18 4 4 9 6 3 7 3 7 5 2
19 9 4 7 7 4 6 4 7 4 2
20 8 2 5 8 3 8 6 5 5 4
21 10 5 8 5 5 4 3 8 8 5
22 8 5 8 6 3 4 3 0 4 2
23 6 2 9 4 3 6 6 7 7 2
24 8 5 7 7 3 8 3 8 5 5
25 4 5 10 5 3 7 4.5 7 6 5
26 6 2 8 6 5 6 7 7 7 5
27 10 2 8 5 3 5 4 5 6 2
28 6 4 9 4 5 6 4.5 8 5 3
29 8 7 9 8 5 6 3 5 7 3
30 6 5 8 5 3 6 4 7 7 3
Avg 6.6 4.1 8.2 5.9 4.4 5.9 4.2 5.6 5.6 3.6
Warn No Yes No No Yes No Yes No No Yes
wornin worning wornin worning
Given below are the three tables containing price, cost and quantity Sold. You have to run simulation to calculate profit.
The fixed cost per period is 120,000.
Simulating Marketing conditions for a new product

Product Selling Price Variable Cost


Limits Limits
Lower Upper Price P Lower Upper Cost
0 0.3 22 0.3 0 0.4 18
0.3 0.7 24 0.4 0.4 0.8 20
0.7 1 27 0.3 0.8 1 22

Capital
Investment 120000
Trial Price Cost Volume Profit
1 22 20 45000 -30000
2 27 20 45000 315000
3 24 22 40000 80000
4 24 22 45000 90000
5 24 20 50000 200000
6 24 20 45000 180000
7 27 20 45000 315000
8 22 20 40000 80000
9 22 18 45000 180000
10 24 20 45000 180000
11 24 22 45000 90000
12 24 18 45000 270000
13 27 22 45000 225000
14 24 20 40000 160000
15 27 20 50000 350000
16 27 18 40000 360000
17 24 22 40000 80000
18 27 18 40000 360000
19 24 20 45000 180000
20 24 20 45000 180000
Avg. Profit 192250
to calculate profit.

Product Sales
Limits
P Lower Upper Sales P
0.4 0 0.25 40000 0.25
0.4 0.25 0.75 45000 0.5
0.2 0.75 1 50000 0.25
Simulation Production Demand Difference
Demand Labours Availability
Limits Limits
Lower Upper Units Prob Lower Upper
0 0.15 2400 0.15 0 0.2
0.15 0.35 2600 0.2 0.2 0.5
0.35 0.65 3000 0.3 0.5 0.8
0.65 0.85 3400 0.2 0.8 1
0.85 1 3800 0.15
Total Labors 100
Labor Hours 8
Units /Hour 5

Labor Units Unit


Day Demand Available Produced Difference Report
1 3800 70 2800 -1000 Less
2 3400 70 2800 -600 Less
3 2600 80 3200 600 More
4 2600 80 3200 600 More
5 2600 75 3000 400 More
6 2600 80 3200 600 More
7 2400 75 3000 600 More
8 2400 75 3000 600 More
9 3800 85 3400 -400 Less
10 3000 70 2800 -200 Less
11 3400 80 3200 -200 Less
12 3800 75 3000 -800 Less
bility

Labor Absent Prob


15 0.2
20 0.3
25 0.3
30 0.2
The following table shows the probability of the arrival of the customers at shop in a rush hour. Run a simulation of 100 rush
hours to see on average how many custoemrs come in rush hour. Another table shows the amount purcahsed by each
customer. Runs simulation twice once for the average number of purchases and the second time for the amount purchased
by the customers arrived. There shouls be total 10 simulations.
Cumulative
Purchase
Customers Prob Min Max Customers amount
5 0.2 0 0.2 5 500
6 0.25 0.2 0.45 6 600
7 0.2 0.45 0.65 7 700
8 0.15 0.65 0.8 8 800
9 0.12 0.8 0.92 9 900
10 0.08 0.92 1 10 1000
Amount Purschsed by Each Custom
Simulation Number of Custo 1 2 3 4
1 6 500 700 700 800
2 6 700 500 700 500
3 6 900 500 700 900
4 8 700 900 500 700
5 5 700 500 900 900
6 6 700 500 700 500
7 9 500 700 1000 700
8 6 700 700 600 600
9 6 700 500 500 600
10 5 500 600 700 1000
ur. Run a simulation of 100 rush
mount purcahsed by each
time for the amount purchased

Cumulative
Purchase
Prob Min Max amount
0.25 0 0.25 500
0.2 0.25 0.45 600
0.25 0.45 0.7 700
0.15 0.7 0.85 800
0.1 0.85 0.95 900
0.05 0.95 1 1000
Amount Purschsed by Each Customer
5 6 7 8 9 10 Average
500 800 666.6667
1000 700 683.3333
500 500 666.6667
800 600 600 700 687.5
700 740
900 700 666.6667
500 700 1000 900 600 733.3333
800 900 716.6667
500 800 600
900 740
A cycle trader is selling Bicyles, Mopeds and Child Seats. The unit profit for Bicyles, Mopeds and
Child Seats are 100, 300 and 50. The capital required for Bicyles, Mopeds and Child Seats per
unit are 300, 1200 and 120. the Total capital avilable with the trader is 93000. The another
constraint is the area occupied. Bicyles, Mopeds and Child seats occupy 0.5 m2, 1 m2 and 0.5
m2. the total speace available is 101 m2. Find how many units of each product must be bought
to maximize the profit.

b m c used
capital 300 1200 120 93000 <=
Area 0.5 1 0.5 101 <=

quantity 94 54 0
unit profit 100 300 50
Bicyles, Mopeds and
and Child Seats per
3000. The another
.5 m2, 1 m2 and 0.5
duct must be bought

Avaliabe
93000
101

total profit
25600
Product
Machine A B
Min/Unit M/C Daily Hours Req Min Avail Min A Avail Min b
K 20 10 7 8 500 <= 3360
L 15 20 7 8 625 <= 3360
M 0 25 4 8 500 <= 1920

X 200 300 9000 <= 50000


Y 200 150 6000 <= 40000
Total Profit
Unit Profit 15 20 35
Qunatity 1 1
Avail Min b
The quarries are to be used for production with two constraints. One constraint is the warehouse requirement and
production capacity. The objective is to minimize the cost. The cost of transportion is given in table 1. The producti
available from query 1, 2, and 3 are 200, 100 and 150 tonnes repectively. The required amount at different wareho
90, 100, 70 and 60 for warehouse 1, 2, 3, 4 and 5 respectively.
Transport cost per tonne
Quarry 1 2 3 4 5
1 5 1 6 3 1
2 2 3 4 5 4
3 4 2 3 2 3
QUANTITY
Quarry 1 2 3 4 5
1 0 90 0 20 60
2 80 0 0 0 0
3 0 0 100 50 0

SUPPLIED 80 90 100 70 60
= = = = =
DEMAND 80 90 100 70 60
the warehouse requirement and the other is
n is given in table 1. The production capacity
ired amount at different warehouses are 80,
espectively.

PRODUCED CPACITY
170 <= 200
80 <= 100
150 <= 150

TOTAL COST
770
Three persons are being assigned to perform three tasks. the Cost attached with the tasks are given belo
assigned only one task and each task is to be completed in a way to minimize the cost of pro

Cost Task1 Task2 Task3


Person1 40 47 80
Person2 72 36 58
Person3 24 61 71

ASSIGNMENT Task1 Task2 Task3 TASK ASSIGNED


Person1 0 1 0 1 <=
Person2 0 0 1 1 <=
Person3 1 0 0 1 <=

supply 1 1 1 total cost


= = = 129
demand 1 1 1

24 47 58 129
d with the tasks are given below. One person will be
way to minimize the cost of production.

1
1
1

You might also like