Assignment 9 β€” Simulation (Monte Carlo)

Two production-and-dispatch simulations with the backlog carried forward, a bakery profit simulation with salvage and goodwill, and a single-bay car-wash queue β€” every table filled day by day.

PROBLEMS: 4 UNIT: UNIT 06 β€” SIMULATION Original: Assignment 9
β—† The method for every problem on this page
  1. Cumulate the probabilities and allocate random numbers 00–99: each outcome's range runs from the previous cumulative Γ— 100 to its own cumulative Γ— 100 βˆ’ 1 (0.10 β†’ 00–09, next 0.15 β†’ 10–24, …).
  2. Convert each random number, in the order given, to a value using the ranges.
  3. Apply the rule for each day or customer in a table β€” production vs vehicle capacity (with any shortfall carried to the next day), demand vs stock, or arrival vs server-free time.
  4. Total and average exactly the quantities the question asks for, and state them with units.

Method and the two exam versions: Unit 6 Β· Simulation.

β˜… Tricks that save time in the exam
  • Ranges in five seconds: write the cumulatives as 10, 25, 60, 80, 90, 100 β€” each range ends one below its cumulative and starts at the previous one.
  • Carry the backlog: units that miss today's vehicle are still there tomorrow, so tomorrow's available stock = waiting + production. On a day that only just fills the vehicle, yesterday's backlog is still waiting.
  • Queue simulation: service starts = MAX(arrival time, previous service end); everything else is addition.
  • Profit simulation: write the one-line profit equation first, then each day is a substitution.

Q1 β€” Solar panel assemblies and a 305-unit container

Question
Production / day301302303304305306
Probability0.100.150.350.200.100.10

The container takes exactly 305; excess assemblies wait for the next day's transport; unused container space is recorded as empty spaces. Random numbers: 42, 85, 12, 94, 38, 71, 04, 63, 29, 50, 77, 18, 89, 55, 09. Find the average number waiting per day and the average number of empty spaces per day.

Assignment 9 p. 1 β€” the handout says "fewer than 303"; any production below the container's 305 leaves empty space, so 305 is used

Solution
  1. Step 1 β€” Random-number ranges
    ProductionProbabilityCumulativeRandom-number range
    3010.10.100 – 09
    3020.150.2510 – 24
    3030.350.625 – 59
    3040.20.860 – 79
    3050.10.980 – 89
    3060.1190 – 99
  2. Step 2 β€” Simulate 15 days
    DayRNProductionWaiting from yesterdayAvailableShippedLeft waitingEmpty spaces
    142303030330302
    285305030530500
    312302030230203
    494306030630510
    538303130430401
    671304030430401
    704301030130104
    863304030430401
    929303030330302
    1050303030330302
    1177304030430401
    1218302030230203
    1389305030530500
    1455303030330302
    1509301030130104

    Day 4 makes 306: one assembly is left for day 5, where 1 + 303 = 304 fills all but one space.

  3. Step 3 β€” Averages Average assemblies waiting = 1 Γ· 15 = 0.067 per day Average empty spaces = 26 Γ· 15 = 1.733 per day

Q2 β€” Vitamin crates and a 55-crate van

Question
Crates / day515253545556575859
Probability0.060.090.110.140.220.180.080.070.05

The van holds exactly 55; crates over capacity remain for the next shipment. Random numbers: 17, 63, 05, 88, 49, 92, 31, 74, 26, 58, 81, 10, 39, 96, 44. Find the average crates waiting and the average empty spaces per day.

Assignment 9 p. 1

Solution
  1. Step 1 β€” Random-number ranges
    CratesProbabilityCumulativeRandom-number range
    510.060.0600 – 05
    520.090.1506 – 14
    530.110.2615 – 25
    540.140.426 – 39
    550.220.6240 – 61
    560.180.862 – 79
    570.080.8880 – 87
    580.070.9588 – 94
    590.05195 – 99
  2. Step 2 β€” Simulate 15 days
    DayRNProductionWaiting from yesterdayAvailableShippedLeft waitingEmpty spaces
    117530535302
    263560565510
    305511525203
    488580585530
    549553585530
    692583615560
    731546605550
    874565615560
    926546605550
    1058555605550
    1181575625570
    1210527595540
    1339544585530
    1496593625570
    1544557625570

    Here average production (about 54.96) is almost exactly the van's capacity, so once a backlog builds on days 4 and 6 it never fully clears β€” the waiting column stays above zero from day 4 on.

  3. Step 3 β€” Averages Average crates waiting = 62 Γ· 15 = 4.133 per day Average empty spaces = 5 Γ· 15 = 0.333 per day

    Business reading: a 55-crate van is too small for this line on busy days β€” a backlog of 3–7 crates is normal. (Treating each day separately, as some textbooks do, would give 0.933 waiting and 0.8 empty; the carry-forward figures are the realistic ones and match the assignment's wording.)


Q3 β€” Gourmet doughnuts β€” bake 30 boxes a day

Question
Demand (boxes)1020304050
Probability0.100.250.350.200.10

Price $15, cost $8 per box; unsold boxes go to a shelter for $3; each box of unmet demand costs $2 of goodwill. The bakery bakes 30 boxes every morning. Random numbers: 24, 78, 05, 62, 39, 91, 53, 17, 84, 46. Find the average daily profit and the total revenue lost to shortages over 10 days.

Assignment 9 p. 1

Solution
  1. Step 1 β€” Ranges
    DemandProbabilityCumulativeRandom-number range
    100.10.100 – 09
    200.250.3510 – 34
    300.350.735 – 69
    400.20.970 – 89
    500.1190 – 99
  2. Step 2 β€” Profit equation Profit = 15 Γ— sold + 3 Γ— unsold βˆ’ 8 Γ— 30 βˆ’ 2 Γ— shortage Cost of baking 30 boxes = $240 every day
  3. Step 3 β€” Simulate 10 days
    DayRNDemandSoldUnsoldShortSales $Salvage $Goodwill $Profit $
    124202010030030090
    2784030010450020190
    3051010200150600-30
    46230300045000210
    53930300045000210
    6915030020450040170
    75330300045000210
    817202010030030090
    9844030010450020190
    104630300045000210
  4. Step 4 β€” Answers Total profit = $1540; average daily profit = $154 Boxes short over 10 days = 40 ⟹ revenue lost = 40 Γ— $15 = $600

    The goodwill charge ($80) is already inside the profit figures. If the question means profit forgone rather than sales revenue, it is 40 Γ— ($15 βˆ’ $8) = $280. Day 3 (demand 10) is the only loss-making day: 20 boxes are sold off at $3.


Q4 β€” Express car wash β€” simulate 6 customers

Question
Inter-arrival (min)2468
Probability0.20.40.30.1
Service (min)357
Probability0.30.50.2

Opens 08:00 (time 0); customer 1 arrives at 08:02 (inter-arrival 2); FCFS. Arrival RNs: 15, 68, 42, 89, 05, 93. Service RNs: 45, 82, 12, 70, 31, 64. Find the average wait in the queue, the total idle time of the facility, and the average time in the system.

Assignment 9 p. 2

Solution
  1. Step 1 β€” Ranges
    Inter-arrivalProbabilityCumulativeRandom-number range
    20.20.200 – 19
    40.40.620 – 59
    60.30.960 – 89
    80.1190 – 99
    ServiceProbabilityCumulativeRandom-number range
    30.30.300 – 29
    50.50.830 – 79
    70.2180 – 99
  2. Step 2 β€” Simulation table (minutes after 08:00)
    CustRN (arrival)Inter-arrivalArrival timeRN (service)Service timeService startsWaitingService endsTime in systemServer idle
    1152245520752
    26868827801571
    3424121231531860
    4896187051802350
    5052203152332880
    6938286452803350

    RN 15 β†’ inter-arrival 2 for customer 1, which agrees with the stated 08:02 first arrival.

  3. Step 3 β€” Answers Average waiting time = 6 Γ· 6 = 1 minute Total idle time = 3 minutes (08:00–08:02 before the first car, and 1 minute between cars 1 and 2) Average time in the system = 36 Γ· 6 = 6 minutes