Cell 1 — Shared utilities: BS analytic, Thomas algorithm, θ-scheme solver
Foundation cell: Black-Scholes closed form for benchmarking, the Thomas algorithm tridiagonal solver (O(M) per call), and the general θ-scheme PDE solver on the log-price grid. The same solver handles explicit (θ=0), fully implicit (θ=1), and Crank-Nicolson (θ=0.5) by switching the
theta parameter.
Run cell to see output.