← All lessons

Simulation

Step 1 of 23
The idea

How many cakes should you bake?

You bake in the morning. Customers arrive all day. Whatever is left at closing goes for a fraction of its price.

  • Bake too few and you turn people away. Lost profit.
  • Bake too many and you sell the rest off cheap. Lost money.

You do not know tomorrow's demand. But you have three years of it, and you know its shape: an average of about 86 cakes a day, wobbling by about 20 either side.

So do the next best thing to knowing: invent a thousand tomorrows, work out the profit in each, and look at what happened.

Monte Carlo simulationRun a model many times with random inputs, then read the answer off the pile of results.