You plan to refit a small café. You have a low, a likely and a high cost for each item, and two risks that may or may not happen. A spreadsheet asks for one number per cell, and so it quietly turns every estimate into a certainty. A Monte Carlo simulation keeps the uncertainty: it samples every item many times, adds up each version of the project, and counts how often the total goes over the budget.
The items
Counter and shelves, 9000, 12000, 18000 Coffee machine, 8000, 9000, 11000 Electrical work, 4000, 6000, 12000 Plumbing, 3000, 5000, 9000 Furniture, 5000, 7000, 10000 Painting and signs, 2000, 3000, 5000 Risk: permit delay, 3000, 5000, 9000, 0.3 Risk: old wiring must go, 4000, 6000, 10000, 0.2
Each line is a name with a low, likely and high cost. A risk has a fifth value, its chance. In VectorFall, open Simulate, choose the template Project budget risk, paste the lines, set the budget and press Run Monte Carlo. From the command line:
vf run sim.budget --budget 50000 --sims 1000000 --seed 1 --items @refit.txt
The answer
On a Quadro K1200 the run took 530 ms, 182 ms of it on the GPU, for one million projects:
There is a 27% chance the total goes over 50,000. To be 80% sure, budget 51,508; for 90%, 54,483. The plain sum of likely values is enough only 38% of the time. Most of the uncertainty comes from Risk: old wiring must go, Risk: permit delay, Counter and shelves.
Add up the likely values and you get 44,700, a tidy number that most people would put in a plan. That is the baseline, and the simulation says it is enough only 38 percent of the time.
Why the plain sum is too low
Look at electrical work. It is likely to cost 6,000, but it could fall to 4,000 or rise to 12,000. There is twice as much room above the likely value as below it, and every item shares that lopsided shape, because things can go wrong in many more ways than they can go unexpectedly right. The model samples each item from a PERT distribution between its low and high values.
Then there are the risks. The plain sum counts each one as a fraction of its likely cost, weighted by its chance, but a real risk never
arrives as a fraction: it stays away or comes in full. The --correlation option (0.3 by default) makes overruns move
together, as they do in real projects. Together the items push the total upward far more often than downward.
Search for the budget you want
In the Console, the same tool is one Python call, and a loop turns it into a search. Which budget gives 95 percent confidence?
for budget in range(46_000, 60_001, 2_000):
r = vf.solve.budget(items, budget, sims=500_000, seed=1)
print("budget %6d: chance to go over %s" % (budget, r["headline"]))
The chance to go over falls from 52% at 46,000 to 27% at 50,000, 11% at 54,000, 7% at 56,000 and 4% at 58,000. It passes 5 percent between 56,000 and 58,000, so a budget of about 57,000 gives 95 percent confidence. Each line ran half a million projects. The same seed gives every budget the same random projects, so the steps between the lines come from the budget and not from luck. The whole search took 3.5 seconds.
The same idea for a queue
A queue is the same problem in a shop, a call centre or a help desk. With 120 calls an hour and 4 minutes per call, the work is eight agents’ worth, so eight agents fall further behind all day. With nine the average wait is 2.3 minutes; with ten it is 0.8. Simple arithmetic gives the lower limit, and only the simulation tells you what one more agent buys. Look at the tail as well: with nine agents one caller in a hundred waits nearly 14 minutes.
Use your own items, your own budget and your own risks. The method carries over to any plan that a spreadsheet reduces to one number per cell.
