Binomial Tree Option Pricer

Options Pricing · Medium · Free problem
Implement a recombining binomial tree to price options under the Cox-Ross-Rubinstein (CRR) model with $N$ time steps. Your implementation must: 1. Price a **European call** option. 2. Price an **American put** option with early exercise. 3. Run in $O(N^2)$ time and $O(N)$ memory. 4. Clearly state the risk-neutral up/down factors $u$, $d$ and the risk-neutral probability $q$. 5. Explain how you would verify convergence to the Black-Scholes price as $N \to \infty$. **Inputs:** Stock price $S_0$, strike $K$, risk-free rate $r$, volatility $\sigma$, time to expiry $T$, number of steps $N$. **Constraints:** -
\leq N \leq 10{,}000$ - $S_0, K, r, \sigma, T > 0$ **Example:** - Input: $S_0 = 100$, $K = 100$, $r = 0.05$, $\sigma = 0.20$, $T = 1.0$, $N = 200$ - Output: European call price $\approx 10.45$, American put price $\approx 6.08$

Open the full interactive solver, hints, and worked solution →