Skip to content
LeetQuant

Hard · Numerical Methods & Monte Carlo · Coding · ~20 min · #45

Monte Carlo European Call

Price a European call by Monte Carlo under risk-neutral geometric Brownian motion:

ST=S0exp⁡ ⁣((r−12σ2)T+σT Z),Z∼N(0,1),S_T = S_0 \exp\!\Big(\big(r - \tfrac12\sigma^2\big)T + \sigma\sqrt{T}\,Z\Big), \qquad Z \sim N(0, 1), C=e−rT E[max⁡(ST−K,0)].C = e^{-rT}\,\mathbb{E}\big[\max(S_T - K, 0)\big].

Implement mc_european_call(S0, K, T, r, sigma, n_paths, seed) -> float. Use random.Random(seed) so results are reproducible. Your estimate will be compared against the Black–Scholes price with a tolerance of 0.25 (about five standard errors at 100,000 paths).

Constraints

  • •

    Use only the Python standard library.

  • •

    n_paths = 100,000 in the tests; keep the loop simple.

Hints · 0 of 2 shown

Worked solution

Give the problem an honest attempt first, then reveal the full explanation.

Related questions

Concepts

Risk-neutral pricingMonte Carlo estimationConvexity correction

Relevant for

Quant DeveloperQuant ResearcherDesk Quant