Strategic Cost Management · Simulation
Random Numbers and Monte Carlo Simulation Explained
Updated 11 October 2026 · Fact-checked
Monte Carlo simulation imitates a random process using random numbers. You convert each probability into a cumulative probability, assign each value a block of random numbers equal to its probability, then read a random number to pick the matching value. Repeat for every trial and compute the result required.
Understand Random Numbers and Monte Carlo Simulation
Some business variables cannot be predicted exactly, such as daily demand, lead time or machine breakdowns. You may know only how often each value has occurred in the past. That history gives you a probability distribution.
Monte Carlo simulation uses that distribution to create artificial but realistic values. Instead of waiting for real events, you draw values using random numbers and see how the system behaves over many trials.
The link between probability and random numbers is simple. If a value has a probability of 0.30, it should be picked about 30% of the time. So you give it 30 out of 100 two-digit random numbers (00 to 99). A value with probability 0.05 gets 5 numbers.
To do this cleanly, you first build the cumulative probability. The cumulative column tells you where each block of random numbers ends. Each value's range starts just after the previous cumulative figure and ends at its own cumulative figure.
Then each random number you are given falls in exactly one range, and that range tells you the simulated value. Exam questions usually supply the random numbers. Your job is to allocate ranges correctly, map the numbers, and compute the answer such as total demand, stock-outs or profit.
Key rules to remember
- Probability from frequency
- Probability = Frequency of the value ÷ Total frequency
- Use this when the question gives counts or days instead of probabilities. All probabilities must add up to 1.
- Cumulative probability
- Cumulative probability of a value = Sum of probabilities up to and including that value
- The last cumulative probability must be 1.00. If not, recheck your addition.
- Number of random numbers per value
- Count of random numbers = Probability × 100 (for 2-digit numbers)
- Use × 1,000 if probabilities have three decimals and 3-digit random numbers are given.
- Random number range (2-digit)
- Start = previous cumulative × 100 (first range starts at 00); End = own cumulative × 100 − 1
- Example: cumulative 0.35 to 0.60 gives range 35 to 59. Last range ends at 99.
- Expected value check
- Expected value = Σ (value × probability)
- Use it to check whether the simulated average is reasonable. With few trials, it will not match exactly.
How to solve Random Numbers and Monte Carlo Simulation questions
Follow the same sequence for demand, lead time, profit and similar simulation questions.
- 1Read what is to be simulated and how many trials (days, orders, periods) are needed. Note which random numbers are to be used and in what order.
- 2List each variable's values with probabilities. If frequencies are given, convert them to probabilities first.
- 3Build the cumulative probability column and confirm it ends at 1.00.
- 4Assign random number ranges from the cumulative column, using two digits unless the question gives other digit lengths. Check that the ranges cover 00 to 99 with no gap or overlap.
- 5Take the random numbers one by one in the given order. For each trial, find the range it falls in and write down the simulated value.
- 6Use the simulated values to compute what the question asks, such as sales, cost, stock or profit for each trial. Show a clear table.
- 7Total or average the results as required, and state the conclusion or recommendation in a line or two.
Quickest way: Range table shortcut
When to use it: Use this when the question gives the probabilities and the random numbers, and you must simulate several trials quickly.
- Write probabilities as whole numbers out of 100, for example 0.15 becomes 15.
- Add them running down the column to get cumulative figures such as 15, 40, 75, 100.
- Write each range as the previous cumulative figure to own cumulative minus 1, so 00-14, 15-39, 40-74, 75-99.
- Mark each random number against a range directly in your trial table without re-deriving anything.
- If the question has two variables, such as demand and lead time, make two range tables and use random numbers in the order stated.
Common mistakes in Random Numbers and Monte Carlo Simulation
Starting a range at the cumulative probability figure of the same row, or ending it one too high, so ranges overlap.
Students forget that 00 is also a number, so 100 numbers run from 00 to 99.
Fix: Start at the previous cumulative figure and end at own cumulative minus 1. First range starts at 00; last ends at 99.
Using the probabilities directly as random number ranges without cumulating.
Students skip the cumulative column to save time.
Fix: Always build the cumulative column first. Ranges come only from cumulative values.
Using random numbers in the wrong order or reusing them.
Students pick numbers that give convenient results or lose track when two variables are involved.
Fix: Use numbers strictly in the sequence given. Follow the question's instruction on which series is for which variable.
Forgetting to convert frequencies into probabilities.
Data is given as days or units, and students allocate ranges directly on the counts.
Fix: Divide each frequency by the total frequency first. If the total is 100, the frequency itself equals the range width.
Ignoring carry-over stock or pending orders when simulating inventory.
Students treat each day as independent.
Fix: Keep an opening and closing stock column. Carry the closing balance to the next period and apply the stated reorder or lead time rules.
Treating the simulated average as the exact answer and comparing it with the expected value without comment.
Students expect simulation to match theory.
Fix: Remember that few trials give only an approximation. Quote both if asked, and note that more trials move the result closer to expected value.
Worked examples
Example 1
The daily demand for a product of Sundaram Foods Ltd has the following distribution: 10 units, probability 0.20; 20 units, 0.30; 30 units, 0.35; 40 units, 0.15. (a) Assign random number ranges. (b) Using the random numbers 14, 83, 52, 97, 36 for five days, simulate demand and find total and average demand.
Show the solution
- Cumulative probabilities: 10 units 0.20; 20 units 0.50; 30 units 0.85; 40 units 1.00. The last is 1.00, so the data is consistent.
- Ranges: 10 units 00-19; 20 units 20-49; 30 units 50-84; 40 units 85-99.
- Day 1: 14 falls in 00-19, so demand is 10.
- Day 2: 83 falls in 50-84, so demand is 30.
- Day 3: 52 falls in 50-84, so demand is 30.
- Day 4: 97 falls in 85-99, so demand is 40.
- Day 5: 36 falls in 20-49, so demand is 20.
- Total demand = 10 + 30 + 30 + 40 + 20 = 130 units. Average = 130 ÷ 5 = 26 units.
- Check with expected value: (10 × 0.20) + (20 × 0.30) + (30 × 0.35) + (40 × 0.15) = 2 + 6 + 10.5 + 6 = 24.5 units. The simulated average of 26 is close, as expected for five trials.
Answer: Ranges: 10 units 00-19, 20 units 20-49, 30 units 50-84, 40 units 85-99. Simulated demand over five days is 10, 30, 30, 40 and 20 units: total 130 units, average 26 units per day (expected value is 24.5 units).
Example 2
Kaveri Components Ltd sells a part at ₹50 per unit with a variable cost of ₹30 per unit. Fixed cost is ₹300 per day. Daily sales follow this distribution: 20 units, frequency 10 days; 30 units, 40 days; 40 units, 30 days; 50 units, 20 days. Using the random numbers 07, 62, 45, 91 for four days, simulate sales and find the total profit for the four days.
Show the solution
- Total frequency = 10 + 40 + 30 + 20 = 100 days. Probabilities: 0.10, 0.40, 0.30, 0.20.
- Cumulative: 0.10, 0.50, 0.80, 1.00.
- Ranges: 20 units 00-09; 30 units 10-49; 40 units 50-79; 50 units 80-99.
- Day 1: 07 gives 20 units. Day 2: 62 gives 40 units. Day 3: 45 gives 30 units. Day 4: 91 gives 50 units.
- Contribution per unit = 50 − 30 = ₹20.
- Day 1 profit = 20 × 20 − 300 = 400 − 300 = ₹100.
- Day 2 profit = 40 × 20 − 300 = 800 − 300 = ₹500.
- Day 3 profit = 30 × 20 − 300 = 600 − 300 = ₹300.
- Day 4 profit = 50 × 20 − 300 = 1,000 − 300 = ₹700.
- Total profit = 100 + 500 + 300 + 700 = ₹1,600.
Answer: Simulated sales are 20, 40, 30 and 50 units on the four days. Daily profits are ₹100, ₹500, ₹300 and ₹700, so total profit for the four days is ₹1,600.
Exam tips
- Write the range table first and box it. Examiners award marks for correct allocation even if later arithmetic slips.
- Check that your ranges run from 00 to 99 with no gaps. This takes five seconds and catches most errors.
- If the question says 'use the following random numbers', use them exactly in the order given, and say which number is used for which trial.
- In MCQs, you often only need one range. Compute the cumulative figure and check which range the given number falls in.
- End a numerical answer with one line of interpretation, such as average demand or the effect of a stock-out, because decision-oriented answers score better.
Practice questions from Simulation
- 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…
- A Nashik vendor buys 200 perishable units daily at ₹25 each and sells at ₹40. Unsold units are disposed of at ₹10 each. Demand is 100 units …
- A Kolkata firm simulates inventory. Daily demand: 1 unit (0.4), 2 units (0.6), allocated as 00-39 and 40-99. Opening stock is 3 units. Each …
- 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)?
Random Numbers and Monte Carlo Simulation in other exams
The same ground in other exams, if you are preparing for more than one or want another angle on it.
Random Numbers and Monte Carlo Simulation: frequently asked questions
How do I assign random numbers in Monte Carlo simulation?
Convert probabilities to cumulative probabilities. Then give each value a range starting after the previous cumulative figure and ending at its own cumulative figure minus 1 (on a 00 to 99 scale). The range width should equal the probability × 100.
Why do we use cumulative probability?
The cumulative column shows where each block of random numbers ends. It stops ranges from overlapping and ensures every random number maps to exactly one value.
What if the random numbers have three digits?
Use probabilities × 1,000 and ranges from 000 to 999. The method is the same. Match the number of digits of the range to the random numbers given.
Does Monte Carlo simulation give the exact answer?
No. It gives an approximate result based on the trials you run. With more trials, the simulated average tends to move closer to the expected value.