Skip to content

Operations Management and Strategic Management · Simulation and Line Balancing

Simulation Problems: Inventory and Queuing Explained

Updated 10 October 2026 · Fact-checked

Simulation of inventory and queuing problems uses random numbers to imitate demand, lead time, arrivals and service. Assign each outcome a range of two-digit random numbers equal to its probability, read off the outcome for each period or customer, then tabulate stock, costs or waiting times and take averages.

Understand Simulation Problems: Inventory and Queuing

Monte Carlo simulation copies a real system on paper. When demand, lead time, arrival gaps or service times are uncertain, you cannot work out one exact answer. So you run the system for a number of days or customers, using random numbers to pick each uncertain value.

The link between a random number and an outcome is the probability distribution. Suppose demand is 1 unit with probability 0.20, 2 units with 0.30, 3 units with 0.30 and 4 units with 0.20. You build cumulative probabilities (0.20, 0.50, 0.80, 1.00). Then you give each outcome a block of two-digit random numbers (00-99) whose size matches its probability. A random number falls in exactly one block, so it picks exactly one outcome, and outcomes come up in the right proportion over many trials.

In an inventory problem, you simulate daily demand, and sometimes lead time. You track opening stock, demand, closing stock, shortages and orders received day by day. From the table you get average stock, number of stock-outs, and total holding, ordering and shortage cost.

In a queuing problem, you simulate the gap between arrivals and the service time for each customer. You then work out each customer's arrival time, service start, service end and waiting time. From this you get average waiting time, server idle time and how many customers had to wait.

The result is only an estimate. A short run of 5 or 10 trials, as in exam questions, will not match the theoretical average. The exam tests whether you follow the method, not whether the answer equals the expected value.

Key rules to remember

Cumulative probability
Cumulative probability = sum of probabilities up to and including that outcome
Build this column first. The last value must be 1.00.
Random number range (two-digit)
Range for an outcome = previous cumulative × 100 up to (current cumulative × 100) − 1
Example: cumulative 0.20 to 0.50 gives 20-49. The first range starts at 00, the last ends at 99.
Closing stock
Closing stock = Opening stock + Receipts − Demand (cannot go below zero)
If demand is more than stock available, the extra is a shortage (lost sale or backorder, as the question states).
Average stock
Average stock = Σ closing stock of all days ÷ number of days
Use the basis the question gives (closing, or average of opening and closing).
Arrival time
Arrival time of a customer = arrival time of previous customer + inter-arrival time
The first customer usually arrives at time 0 unless told otherwise.
Service start and waiting time
Start = higher of (arrival time, previous customer's service end); Waiting time = Start − Arrival time
Service end = Start + Service time.
Average waiting time
Average waiting time = Σ waiting times ÷ number of customers
Divide by all customers, including those who did not wait.
Server idle time
Idle time = Start of service − previous service end (when positive)
Add idle gaps across all customers.

How to solve Simulation Problems: Inventory and Queuing questions

Use the same layout for every inventory or queuing simulation. A clear table earns step marks even if one value goes wrong.

  1. 1List each uncertain variable (demand, lead time, inter-arrival time, service time) and its probability distribution.
  2. 2For each variable, write the cumulative probability and assign two-digit random number ranges. Check the ranges cover 00-99 with no gap or overlap.
  3. 3Read the question for starting conditions: opening stock, reorder rule, order quantity, first arrival time, number of days or customers, and the random numbers given. Use the random numbers in the order given.
  4. 4Convert each random number to its outcome by finding the range it falls in. Write the outcome beside the random number.
  5. 5Build the table row by row. For inventory: opening stock, demand, closing stock, shortage, order received. For queuing: arrival, service start, service time, service end, wait, idle.
  6. 6Total the columns you need (closing stock, waiting time, idle time, shortage units).
  7. 7Compute the asked results: average stock, costs (units × rate), average wait, idle time. Show the working.
  8. 8State the answer in words with units, and note that it is an estimate from a short simulation.

Quickest way: Range table first, then one running table

When to use it: Use when the exam gives random numbers and asks for averages or costs over a few days or customers, and time is short.

  1. Write the range table for each variable in one line, such as 00-19 → 1, 20-49 → 2.
  2. Convert every random number to its outcome in one pass, before building the main table.
  3. For queuing, fill arrival times first, then do start, end and wait row by row using the rule Start = higher of arrival and previous end.
  4. For inventory, carry closing stock down into the next row's opening stock; do not recompute.
  5. Add the columns once, multiply by the cost rate, and divide by the number of days or customers only when an average is asked.

Common mistakes in Simulation Problems: Inventory and Queuing

  • Wrong random number ranges, such as 00-20, 20-50 with overlap

    Students copy the cumulative probability as the upper limit without subtracting 1 for the next start.

    Fix: Start each range at the previous cumulative × 100 and end at current cumulative × 100 − 1. The last range always ends at 99.

  • Using random numbers out of order or for the wrong variable

    Students mix the arrival and service random number series, or skip a number.

    Fix: Use the numbers exactly as listed, one per trial. Label the arrival series and the service series separately.

  • Letting closing stock go negative

    Demand is subtracted blindly even when it exceeds stock.

    Fix: Closing stock stops at zero. Record the unmet demand as shortage and apply the shortage cost or lost-sale rule from the question.

  • Ignoring the previous customer's service end when finding the start time

    Students start service at the arrival time every time.

    Fix: Start = higher of the customer's arrival time and the previous service end. Waiting time is the difference only when the server is busy.

  • Dividing average waiting time by only those who waited

    Customers with zero wait look irrelevant.

    Fix: Divide total wait by all customers unless the question asks for the average among those who waited.

  • Treating the first customer as arriving after a random gap

    Students generate an inter-arrival time for every customer.

    Fix: Unless told otherwise, customer 1 arrives at time 0. The first inter-arrival random number is used for customer 2.

Worked examples

Example 1

Daily demand for an item is 1 unit (probability 0.20), 2 units (0.30), 3 units (0.30) or 4 units (0.20). Opening stock on day 1 is 15 units, and no replenishment arrives in the 5 days. Random numbers for the 5 days: 47, 83, 12, 65, 91. Holding cost is ₹5 per unit per day on closing stock. Find the average closing stock and the total holding cost.

Show the solution
  1. Cumulative probabilities: 0.20, 0.50, 0.80, 1.00. Ranges: 00-19 = 1 unit; 20-49 = 2 units; 50-79 = 3 units; 80-99 = 4 units.
  2. Convert random numbers: 47 → 2; 83 → 4; 12 → 1; 65 → 3; 91 → 4.
  3. Day 1: opening 15, demand 2, closing 13.
  4. Day 2: opening 13, demand 4, closing 9.
  5. Day 3: opening 9, demand 1, closing 8.
  6. Day 4: opening 8, demand 3, closing 5.
  7. Day 5: opening 5, demand 4, closing 1. No shortage occurs.
  8. Total closing stock = 13 + 9 + 8 + 5 + 1 = 36 unit-days. Average closing stock = 36 ÷ 5 = 7.2 units.
  9. Holding cost = 36 × ₹5 = ₹180.

Answer: Average closing stock is 7.2 units and the total holding cost for the 5 days is ₹180.

Example 2

A single-server counter at a Pune service centre has inter-arrival times of 2 minutes (probability 0.30), 4 minutes (0.50) or 6 minutes (0.20), and service times of 3 minutes (0.40) or 5 minutes (0.60). Customer 1 arrives at time 0. Random numbers for inter-arrival times of customers 2 to 5: 15, 62, 88, 41. Random numbers for service times of customers 1 to 5: 72, 25, 55, 10, 81. Find the average waiting time and the server's idle time.

Show the solution
  1. Inter-arrival ranges: 00-29 = 2 min; 30-79 = 4 min; 80-99 = 6 min. Service ranges: 00-39 = 3 min; 40-99 = 5 min.
  2. Inter-arrival times: 15 → 2; 62 → 4; 88 → 6; 41 → 4. Arrival times: C1 = 0, C2 = 2, C3 = 6, C4 = 12, C5 = 16.
  3. Service times: 72 → 5; 25 → 3; 55 → 5; 10 → 3; 81 → 5.
  4. C1: arrives 0, starts 0, wait 0, ends 5.
  5. C2: arrives 2, server busy until 5, starts 5, wait 3, ends 8.
  6. C3: arrives 6, starts 8, wait 2, ends 13.
  7. C4: arrives 12, starts 13, wait 1, ends 16.
  8. C5: arrives 16, starts 16, wait 0, ends 21.
  9. Total waiting = 0 + 3 + 2 + 1 + 0 = 6 minutes. Average wait = 6 ÷ 5 = 1.2 minutes.
  10. Idle time: the server is never idle, because each customer arrives at or before the previous service end (C5 arrives at 16, exactly when C4 ends), so idle time = 0 minutes.

Answer: Average waiting time is 1.2 minutes per customer (3 of the 5 customers wait), and the server has no idle time over the 21 minutes.

Exam tips

  • Write the random number range table first. Examiners give step marks for correct ranges even if later arithmetic slips.
  • Use the random numbers exactly as given and in sequence. Tick each one off as you use it.
  • Draw the table with every column the question could need (stock, shortage, wait, idle). It is faster than rebuilding it later.
  • Read for the basis of cost: closing stock, average stock, or shortage per unit. Then multiply the right total by the right rate.
  • Finish with one line of interpretation, such as high waiting suggests adding a second server, and note that results come from a small sample.

Practice questions from Simulation and Line Balancing

Simulation Problems: Inventory 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 and Queuing: frequently asked questions

How do I assign random numbers in a simulation problem?

Build the cumulative probability for each outcome. Give each outcome a block of two-digit numbers whose size equals its probability × 100, starting at 00 and ending at 99. For example, 0.20 then 0.30 gives 00-19 and 20-49.

Why does my simulated average differ from the expected value?

A simulation with only a few trials is a sample, so it varies from the theoretical average. The exam checks your method. You may add a remark that a longer run would be closer to the expected value.

What if the random number is exactly on a boundary like 50?

Use your ranges. If 0.20-0.50 is assigned 20-49, then 50 belongs to the next outcome. This is why each range ends one below the next start.

How do I handle lead time in an inventory simulation?

Treat lead time as another distribution with its own random number ranges. When an order is placed, use the next random number to find the lead time, then show the stock arriving that many days later in the receipts column.