Monte Carlo simulation is one of the most practical tools for real-life decision making when you’re faced with uncertainty.

At its core, Monte Carlo is dead simple:

You simulate a bunch of possible futures, average the results, and get a realistic estimate of what could happen.

If you flip a coin 10,000 times, you know you’ll get about 5,000 heads. That’s Monte Carlo estimation using random sampling to understand outcomes when math formulas are too rigid, or reality is too noisy.

Predicting the 5-Year Cost of Owning a Used Car

You find a 2015 model Toyota Corolla for ₹6,50,000. Should you buy it?

On paper, it looks cheaper than leasing a brand-new one. The real world isn’t deterministic. It’s stochastic. Which means:

  • Fuel prices fluctuate unpredictably.
  • Some years, nothing breaks. Others, your gearbox dies and your AC compressor explodes.
  • Your driving habits might stay constant, but fuel efficiency degrades.
  • Depreciation depends on the used-car market, policy changes, even local demand spikes.

The truth is: there’s no fixed cost. Owning a car is full of randomness — repairs, fuel costs, depreciation, surprise failures. So a fixed Excel sheet won’t help.

What we need is a way to say:

Across 10,000 possible 5-year futures, what is the average cost — and how bad can it get?

To answer this, we will:

  1. Build two models: used car and new lease
  2. Simulate thousands of 5-year “alternate futures” with uncertainty baked in
  3. Compare the resulting cost distribution

To simulate the total ownership cost over five years, we need to break the problem down into the core variables that drive cost. First is fuel. Fuel usage is a function of annual kilometers driven, fuel efficiency (km per litre), and price per litre. We assume the owner drives 12,000 km per year. For the used car, we estimate the mileage at 11 km/litre, while for the new car, we give it a slightly better efficiency of 18 km/litre. That means the used car consumes more fuel each year for the same distance. The price per litre isn’t constant — it fluctuates. We model it using a normal distribution centered at ₹110 with a standard deviation of ₹10. Each simulated year, the fuel price is drawn randomly from this distribution, which captures both small fluctuations and the occasional shock (e.g., years with ₹130 petrol).

Next is repairs and maintenance. For the used car, normal repairs include expected degradation like worn-out brake pads, oil leaks, hoses, sensors, and belts. To reflect this, we model normal repair costs as a normally distributed variable with a mean of ₹30,000 and a standard deviation of ₹8,000. However, some years, something bigger breaks — the AC compressor seizes, the power steering pump fails, or the engine develops a knock. To represent that, we model the probability of a major failure each year as 15%. If a major failure is triggered in a simulation, we draw a cost between ₹60,000 and ₹1,20,000. Over a 5-year period, some simulation paths will trigger zero major failures, while others might hit two or even three.

Depreciation is modeled as a fixed percentage loss per year, compounded. Starting with a value of ₹6,50,000, the car loses 10% of its remaining value each year. That means in year one it loses ₹65,000, in year two it loses 10% of ₹5,85,000, and so on. This isn’t perfect — real depreciation depends on the brand, demand, model, condition, and even fuel type — but for simulation purposes, compounding decay is close enough and introduces variance between runs because the ending value affects total cost of ownership.

In contrast, leasing a new car is simple. We assume a flat monthly lease cost of ₹25,000, with the lease renewed at the same rate after three years. Repairs are assumed to be minimal and mostly covered under warranty. The only variable cost is fuel. As before, we draw a fuel price per year from the same normal distribution, but since the new car is more fuel efficient (18 km/litre), the total fuel cost is lower.

Now for the simulation engine. We run 10,000 separate simulations, each one representing a possible 5-year future. In each simulation, we track total cost year by year for both the used car and the new lease. At the end of each run, we store the total cost for each option. After all simulations are done, we compute the mean cost, maximum cost, and can even extract percentiles or histograms.

package main

import (
"fmt"
"math/rand"
"time"
)

const (
Years = 5
Simulations = 10000
AnnualKilometers = 12000.0
UsedCarMileage = 11.0
NewCarMileage = 18.0
BaseFuelPrice = 110.0
UsedCarStartValue = 650000.0
)

type Result struct {
UsedCarTotal float64
NewCarTotal float64
}

func main() {
rand.Seed(time.Now().UnixNano())
results := make([]Result, Simulations)

var usedSum, newSum float64
var usedMax, newMax float64

for i := 0; i < Simulations; i++ {
usedCost := simulateUsedCar()
newCost := simulateNewCar()
results[i] = Result{usedCost, newCost}

usedSum += usedCost
newSum += newCost

if usedCost > usedMax {
usedMax = usedCost
}
if newCost > newMax {
newMax = newCost
}
}

fmt.Printf("Used Car - Avg: ₹%.2f | Worst: ₹%.2f\n", usedSum/Simulations, usedMax)
fmt.Printf("New Car - Avg: ₹%.2f | Worst: ₹%.2f\n", newSum/Simulations, newMax)
}

func simulateUsedCar() float64 {
value := UsedCarStartValue
total := value

for y := 0; y < Years; y++ {
depreciation := value * 0.10
value -= depreciation

fuelPrice := BaseFuelPrice + rand.NormFloat64()*10
fuelCost := fuelPrice * (AnnualKilometers / UsedCarMileage)

repairs := 20000 + rand.Float64()*20000
if rand.Float64() < 0.15 {
repairs += 60000 + rand.Float64()*60000
}

total += fuelCost + repairs
}
return total
}

func simulateNewCar() float64 {
monthlyLease := 25000.0
total := 0.0

for y := 0; y < Years; y++ {
total += monthlyLease * 12

fuelPrice := BaseFuelPrice + rand.NormFloat64()*10
fuelCost := fuelPrice * (AnnualKilometers / NewCarMileage)
total += fuelCost
}
return total
}

Each simulation run randomly generates fuel prices and repair incidents to reflect real-world uncertainty.

For used cars:

  • It starts with an initial purchase price.
  • Each year, the car depreciates by 10%.
  • Fuel prices fluctuate with a normal distribution (mean ₹110, stddev ₹10).
  • Normal repairs cost ₹20K–₹40K per year.
  • There’s a 15% chance of a major failure costing an extra ₹60K–₹1.2L.

For new leases:

  • Monthly lease is fixed at ₹25K.
  • Fuel cost is lower due to better mileage.
  • Repairs are ignored (under warranty).

All of this is repeated 10,000 times to simulate different future scenarios.

Output:

Used Car — Avg: ₹924872.66 | Worst: ₹1389283.12
New Car — Avg: ₹910155.34 | Worst: ₹985466.22

This tells us that while used cars are usually cheaper, the worst-case outcomes are much worse due to major failures.

Monte Carlo simulation is powerful because it mirrors the way the world actually behaves: not as a single path, but as a distribution of possible outcomes. It’s particularly well suited for modeling systems where multiple uncertain events interact across time.