Strategic Cost Management · Simulation
Simulation Problems: Inventory, Demand and Queuing
Updated 11 October 2026 · Fact-checked
A simulation problem asks you to imitate a business process, such as daily demand, stock levels or a queue, using given random numbers. Convert each probability into a cumulative range, map each random number to an outcome, run the process period by period in a table, then total the results and answer the question.
Understand Simulation Problems: Inventory, Demand and Queuing
Simulation is a way to study a process that has uncertainty in it. You cannot solve it with one formula because demand, lead time, arrival gaps or service times change every period. So you imitate the process on paper for a number of periods and see what happens.
The tool is the random number. Each uncertain variable has a probability distribution given in the question. You turn it into a cumulative probability table and assign a random number range to each outcome. With two-digit random numbers (00 to 99), a probability of 0.30 gets 30 numbers.
You then read each random number from the list, find its range and note the outcome. That is one trial. Repeating it day by day builds a table of demand, opening stock, closing stock, shortage, orders placed and so on.
In inventory problems, you track stock, reorder rules, lead time and shortages. In queuing problems, you track arrival time, service start, service end, customer waiting time and server idle time. The method is the same. Only the columns change.
A short simulation gives only a rough estimate. Exam questions use 5 to 10 periods because the aim is to test your method, not to get a reliable long-run answer.
Key rules to remember
- Probability from frequency
- Probability = Frequency of outcome ÷ Total frequency
- Use this when the question gives counts instead of probabilities.
- Cumulative probability
- Cumulative probability = Sum of probabilities up to and including that outcome
- The last value must be 1.00. If not, recheck.
- Random number range (two-digit)
- Range runs from (previous cumulative × 100) to (current cumulative × 100 − 1)
- Example: cumulative 0.20 gives 00-19; cumulative 0.50 gives 20-49. Use 0-9 for one-digit and 000-999 for three-digit numbers.
- Closing stock
- Closing stock = Opening stock + Receipts − Demand (not below zero)
- If demand is more than stock available, the excess is shortage. State whether it is lost or backordered, as the question directs.
- Queue timings
- Arrival time = Previous arrival + Inter-arrival time; Service start = Higher of arrival time and previous service end; Service end = Start + Service time
- Use these three lines for every customer.
- Waiting and idle time
- Customer waiting time = Service start − Arrival time; Server idle time = Service start − Previous service end (when positive)
- Time in system = Service end − Arrival time.
- Expected value (check)
- Expected value = Σ (outcome × probability)
- Use it to compare your short simulation with the theoretical average.
How to solve Simulation Problems: Inventory, Demand and Queuing questions
Use this order for any simulation question on demand, inventory, lead time or queues.
- 1Read the rules first: opening stock, reorder level, order quantity, when orders arrive, treatment of shortage, number of periods and which random numbers to use for which variable.
- 2Build a cumulative probability table for each variable (demand, lead time, inter-arrival time, service time).
- 3Assign random number ranges to each outcome. Check that the ranges cover every number from 00 to 99 with no gaps or overlaps.
- 4Draw the simulation table with one row per period (or per customer). Add columns for the random number, the outcome and each running figure.
- 5Fill row by row. Use the random numbers in the order given and do not skip any. Use a separate list for each variable if the question gives separate lists.
- 6Apply the rules carefully: reorder trigger, lead time arrival, shortage, queue start time.
- 7Total the columns and compute what is asked: average stock, total shortage, average waiting time, idle time, cost or profit.
- 8Write the answer with units and a short comment, and mention any assumption you made.
Quickest way: Table-first method for exam speed
When to use it: Use it in every simulation question. It saves time because the range table and the working table are the only two things you draw.
- Write the range table first, in the margin, for every variable. Tick each range as you use it.
- Convert all random numbers to outcomes in one pass, before you start the stock or queue logic.
- Then fill the main table using only the outcomes, so you do not stop to look up ranges.
- After each row, check: Opening + Receipts − Sales = Closing (or Start + Service = End).
- Finish with column totals and compute the final answer once.
Common mistakes in Simulation Problems: Inventory, Demand and Queuing
Wrong random number ranges, such as 00-20 and 20-49 overlapping.
Students use the cumulative probability as the upper limit and forget it is not included in the lower range.
Fix: Upper limit = cumulative × 100 − 1. Check that the last range ends at 99.
Using the same random number for two variables or skipping numbers.
Students rush and lose their place in the list.
Fix: Tick each random number as you use it. If the question gives separate lists for demand and lead time, use each list only for its own variable.
Counting shortage as negative closing stock.
The formula Opening − Demand is applied without a floor.
Fix: Stock cannot go below zero. Record the unmet demand separately as shortage, and follow the lost-sales or backorder rule given.
Getting the lead time arrival day wrong.
The question's convention for when an order arrives is not read carefully.
Fix: State your convention at the top, such as 'an order with lead time 2 days placed at end of day 1 arrives at start of day 3', and apply it consistently.
Placing a new order while one is already outstanding.
Students apply the reorder level to every day.
Fix: Check whether the question allows only one order at a time. If silent, state your assumption.
In queues, starting service at the arrival time even when the server is busy.
Students forget the previous customer's service end.
Fix: Service start = higher of arrival time and previous service end. Waiting time is the gap.
Worked examples
Example 1
A shop's daily demand is 10 units (probability 0.20), 20 units (0.30), 30 units (0.30) or 40 units (0.20). Lead time for replenishment is 1 day (probability 0.50) or 2 days (0.50). Opening stock on day 1 is 40 units. At the end of any day when closing stock is 20 units or less and no order is outstanding, an order for 50 units is placed. An order with lead time L placed at the end of day n arrives at the start of day n + L. Unmet demand is lost. Simulate 6 days using demand random numbers 62, 15, 47, 83, 31, 90 and lead time random numbers 71, 28 (used in the order in which orders are placed). Find the total units of shortage, the number of orders placed and the average closing stock.
Show the solution
- Demand ranges: 10 units = 00-19; 20 units = 20-49; 30 units = 50-79; 40 units = 80-99. Lead time ranges: 1 day = 00-49; 2 days = 50-99.
- Day 1: RN 62 gives demand 30. Opening 40, closing 10. Closing is 20 or less, so order 50. Lead time RN 71 gives 2 days, so the order arrives at the start of day 3.
- Day 2: RN 15 gives demand 10. Opening 10, closing 0. An order is outstanding, so no new order.
- Day 3: Receive 50. Opening 50. RN 47 gives demand 20. Closing 30. No order is needed.
- Day 4: RN 83 gives demand 40. Opening 30, so sales 30, shortage 10, closing 0. Place an order. Lead time RN 28 gives 1 day, so it arrives at the start of day 5.
- Day 5: Receive 50. Opening 50. RN 31 gives demand 20. Closing 30.
- Day 6: RN 90 gives demand 40. Opening 30, so sales 30, shortage 10, closing 0. An order is placed at the end of day 6 (it arrives after the simulation period, so no lead time is needed).
- Total shortage = 10 + 10 = 20 units. Orders placed = 3 (end of days 1, 4 and 6).
- Closing stocks: 10, 0, 30, 0, 30, 0 = 70 units in total. Average = 70 ÷ 6 = 11.67 units.
Answer: Total shortage is 20 units, 3 orders are placed, and average closing stock is about 11.67 units per day.
Example 2
A single-counter service point has inter-arrival times of 2 minutes (probability 0.30), 4 minutes (0.40) or 6 minutes (0.30). Service time is 3 minutes (0.50) or 5 minutes (0.50). The first customer arrives at time 0 and service starts at once. Simulate 5 customers using random numbers 45, 82, 12, 60 for inter-arrival times of customers 2 to 5, and 38, 71, 14, 55, 90 for service times of customers 1 to 5. Find the average waiting time per customer, the total server idle time and the average time in the system.
Show the solution
- Inter-arrival ranges: 2 min = 00-29; 4 min = 30-69; 6 min = 70-99. Service ranges: 3 min = 00-49; 5 min = 50-99.
- Inter-arrival times: 45 gives 4, 82 gives 6, 12 gives 2, 60 gives 4. Arrival times: C1 at 0, C2 at 4, C3 at 10, C4 at 12, C5 at 16.
- Service times: 38 gives 3, 71 gives 5, 14 gives 3, 55 gives 5, 90 gives 5.
- C1: start 0, end 3, wait 0.
- C2: arrives 4, start 4, end 9, wait 0, server idle 1 minute (3 to 4).
- C3: arrives 10, start 10, end 13, wait 0, server idle 1 minute (9 to 10).
- C4: arrives 12, server busy until 13, so start 13, end 18, wait 1.
- C5: arrives 16, server busy until 18, so start 18, end 23, wait 2.
- Total waiting = 0 + 0 + 0 + 1 + 2 = 3 minutes. Average = 3 ÷ 5 = 0.6 minute.
- Total idle time = 1 + 1 = 2 minutes. Check: busy time 21 minutes, total 23 minutes, idle 2 minutes.
- Time in system = service end − arrival: 3, 5, 3, 6, 7 = 24 minutes. Average = 24 ÷ 5 = 4.8 minutes.
Answer: Average waiting time is 0.6 minute per customer, total server idle time is 2 minutes, and average time in the system is 4.8 minutes.
Exam tips
- Show the cumulative probability and random number range table clearly. Marks are often given for it even if later arithmetic goes wrong.
- State your assumptions, such as arrival convention for orders, lost sales or backorders, and whether idle time includes the end period. Examiners reward stated assumptions.
- In the MCQ section, one slip in a range changes the answer, so recheck the range boundaries for any random number that falls close to a limit, such as 49 or 50.
- Answer the exact question asked: total shortage, average stock, waiting time or profit. Add a cost or profit calculation if unit costs are given, and end with a one-line recommendation if the question asks for a decision.
- Do not extend the simulation beyond the number of periods given, and do not use extra random numbers unless the question instructs you to.
Practice questions from Simulation
- A Monte Carlo simulation uses two-digit random numbers 00-99. Daily demand of a dairy booth has probabilities: 100 litres 0.20, 200 litres 0…
- A Monte Carlo simulation of daily demand for a Pune bakery uses the cumulative probability ranges: 0 units = 00-09, 1 unit = 10-39, 2 units …
- A linear congruential generator uses X(n+1) = (5 × X(n) + 3) mod 16, with seed X(0) = 7. What is the third generated number, X(3)?
- A Chennai firm simulates weekly sales: 00-19 gives 100 units, 20-59 gives 200 units, 60-99 gives 300 units. Selling price is Rs 40 and varia…
- A Hyderabad service desk simulates arrivals and service times. Inter-arrival time (minutes): 2 (0.4), 4 (0.6). Service time: 3 (0.5), 5 (0.5…
Simulation Problems: Inventory, Demand and Queuing in other exams
The same ground in other exams, if you are preparing for more than one or want another angle on it.
Simulation Problems: Inventory, Demand and Queuing: frequently asked questions
How do I assign random number ranges in a simulation problem?
Work out the cumulative probability for each outcome. With two-digit random numbers, the first range starts at 00 and each range ends at cumulative × 100 − 1. For example, probabilities 0.20, 0.30, 0.30 and 0.20 give 00-19, 20-49, 50-79 and 80-99.
What if the random number list is not enough for all periods?
Use only the numbers given and simulate for the period the question asks. If the question gives separate lists, use each list for its own variable in the order shown. If you must assume anything, state it clearly.
Is the simulation answer exact?
No. A short run with a few random numbers gives only an estimate. The result may differ from the expected value calculated from the probabilities. You can mention this in your comment if the question asks you to compare.
How is a queuing simulation different from an inventory simulation?
Both use random numbers to pick outcomes. Inventory problems track stock, orders and shortages across days. Queuing problems track arrival time, service start, service end, waiting time and idle time for each customer.