monte carlo options pricing

prices european options two ways: the exact black-scholes formula and monte carlo simulation via thousands of random stock paths. adjust parameters and watch the two methods converge.

ready
parameters
option type:
$10$300
$10$300
1 month3 years
1%100%
0%15%
50050,000
results
black-scholes
monte carlo
std error
paths run
terminal price distribution
convergence — mc price vs. paths
simulated GBM price paths (20 paths shown)

a sample of individual stock price paths generated by geometric brownian motion. these paths' terminal prices are then discounted and averaged to give us the monte carlo estimate above.

550

what is an option?

a stock option is a contract that gives you the right (but not the obligation) to buy or sell a stock at a specific price, called the strike price (K), on or before an expiry date.

a call option profits when the stock goes up. if the stock finishes above K at expiry, you can buy the stock for K and then immediately sell at the higher market price. your payoff is max(ST − K, 0).

a put option profits when the stock goes down. you can sell the stock at K even though the market is lower. payoff: max(K − ST, 0).

in both cases, you just don't exercise (buy/sell at K) if it would cost you money. this unlimited upside with no downside (besides the premium you pay for the contract) is what makes options worth paying for up front.

call payoff at expiry (K = $100)
put payoff at expiry (K = $100)

the black-scholes formula

black-scholes (1973) gives an exact closed-form price for a european option (one you can only exercise at expiry and not before). it assumes stock prices follow a random walk with constant volatility and no dividends.

d₁ = [ ln(S/K) + (r + σ²/2)·T ] / (σ·√T) d₂ = d₁ − σ·√T Call: C = S·N(d₁) − K·e^(−rT)·N(d₂) Put: P = K·e^(−rT)·N(−d₂) − S·N(−d₁) N(·) = normal CDF

inputs: S = current stock price, K = strike price, T = years to expiry, σ = annualized volatility (standard deviation of log-returns), r = risk-free interest rate.

σ: a log-return over a period is ln(S_end / S_start), i.e. the natural log of the price ratio. under Geometric Brownian Motion, these are normally distributed; σ is their standard deviation.

how to read the call formula: it has two terms. S·N(d₁) is the expected value of the stock you receive if the option is exercised — the current stock price weighted by the "delta" of the option. K·e−rT·N(d₂) is the present value of the strike price you pay, weighted by the probability the option ends up in the money. the call price is the difference: expected receipt minus expected cost.

key assumptions: log-normal stock prices, constant volatility, no dividends, continuous trading, european exercise only. real markets violate all of these, but black-scholes is still a reasonable benchmark.

geometric brownian motion

black-scholes assumes stock prices follow geometric brownian motion (GBM) — a continuous random walk where returns are normally distributed and prices can never go negative.

continuous form: dS = μ·S·dt + σ·S·dW discrete version: S_T = S · exp( (r − σ²/2)·T + σ·√T·Z ) └── drift ──┘ └─ random shock where Z ~ N(0, 1)

drift: The drift μ corresponds to the expected return demanded by investors. In this formula, this drift term combines the risk-free rate r with a correction of −σ²/2. this comes from itô's lemma: when you take the log of a log-normal variable, the mean of log(S_T) is (r − σ²/2)T, not rT. the correction ensures the average path grows at rate r, not at rate r + σ²/2.

random shock: The σ·√T in the random shock term represents how variance accumulates over time. To generate a standard normal sample Z from uniform random numbers, we use the Box-Muller Transform:

Z = √(−2·ln U₁) · cos(2π·U₂), U₁, U₂ ~ Uniform(0, 1)

This is the same transform used in this demo's simulation code.

monte carlo pricing

Monte Carlo pricing relies on the Law of Large Numbers: with enough simulated random paths, the average discounted payoff converges to the true expected payoff, which we get from Black-Scholes.

1

draw Z ~ N(0, 1)

Generate a standard normal random number using the Box-Muller transform.

2

simulate ST

Apply the GBM formula S·exp((r−σ²/2)T + σ√T·Z) to create one path.

3

compute payoff

For a call option, the payoff is max(ST − K, 0).

4

average & discount

Repeat N times. Price = e−rT · mean(payoffs). (The e−rT discounts the future payoff back to today's dollars.)

convergence and the standard error

The Monte Carlo estimate slowly improves with more paths. The standard error of the estimate (the average we get from Monte Carlo) is σ_payoffs / √N. (Recall that standard error is the standard deviation of the sampling distribution.)

Because of the square root, reducing error gets very costly down the line. At N = 10,000 paths, the standard error is typically a few cents for a $100 option. At N = 1,000,000, it would be about 10 times smaller but take 100 times as long to compute.

Black-Scholes sidesteps this entirely by solving the pricing equation analytically. Monte Carlo is more flexible (it handles exotic options, path-dependent payoffs, and complex dynamics that have no closed form) but always carries this statistical noise.