Quant Memo
Core

The Bisection Method

Finding where a function crosses zero by repeatedly cutting the search interval in half — slow but bulletproof, the numerical equivalent of a guaranteed-to-work guessing game.

Prerequisites: Limits and Continuity

An options desk needs the implied volatility that makes Black-Scholes match a quoted market price. There's no algebraic formula to invert Black-Scholes for volatility directly — you have to search for it. The bisection method is the simplest, most robust way to search: given a range you're sure contains the answer, repeatedly cut it in half, keeping whichever half must still contain the crossing point. It's slower than fancier methods, but it essentially cannot fail, which is exactly why it's often the fallback of last resort inside pricing libraries.

An analogy: the number-guessing game

Think of the classic game where someone picks a number between 1 and 100 and you guess, being told only "higher" or "lower" after each try. The optimal strategy is always guess the midpoint: start at 50, and whichever half you're told to go to, guess its midpoint next. Each guess eliminates exactly half of the remaining possibilities, so you're guaranteed to nail a number between 1 and 100 in at most 7 guesses (27=128>1002^7 = 128 > 100), no matter how unlucky your guesses "feel." Bisection is this exact strategy applied to a continuous function instead of an integer.

The math, one piece at a time

Suppose f(x)f(x) is a continuous function and you know f(a)f(a) and f(b)f(b) have opposite signs — one positive, one negative — for some interval [a,b][a, b]. The Intermediate Value Theorem guarantees ff crosses zero somewhere inside [a,b][a,b], since a continuous function can't jump from positive to negative without passing through zero. Bisection exploits exactly this guarantee: compute the midpoint c=a+b2c = \frac{a+b}{2} and evaluate f(c)f(c). If f(c)f(c) has the same sign as f(a)f(a), the root must be in [c,b][c, b] (replace aa with cc); otherwise it's in [a,c][a, c] (replace bb with cc). Repeat.

[an+1,bn+1]={[cn,bn]if signf(cn)=signf(an)[an,cn]otherwise,cn=an+bn2.[a_{n+1}, b_{n+1}] = \begin{cases} [c_n, b_n] & \text{if } \operatorname{sign} f(c_n) = \operatorname{sign} f(a_n) \\ [a_n, c_n] & \text{otherwise} \end{cases}, \qquad c_n = \frac{a_n+b_n}{2} .

In words: every iteration, the interval known to contain the root is replaced by whichever half still brackets a sign change, so the interval width exactly halves each step: bnan=b0a02nb_n - a_n = \frac{b_0-a_0}{2^n}. The error after nn iterations is bounded by half the current interval width, so hitting a target precision ϵ\epsilon takes nlog2(b0a0ϵ)n \approx \log_2\left(\frac{b_0-a_0}{\epsilon}\right) iterations — a number you can compute in advance, unlike most other root-finders.

Worked example 1: implied volatility by hand

Suppose a call's Black-Scholes price, as a function of volatility σ\sigma, gives f(0.10)=2.10f(0.10) = -2.10 (model price $2.10 below market at 10% vol) and f(0.50)=+3.40f(0.50) = +3.40 (model price $3.40 above market at 50% vol) — a sign change, so the true implied vol lies in [0.10,0.50][0.10, 0.50]. Midpoint c1=0.30c_1 = 0.30: suppose f(0.30)=+0.80f(0.30) = +0.80 (still positive, same sign as f(0.50)f(0.50)), so the root is in [0.10,0.30][0.10, 0.30]. Midpoint c2=0.20c_2 = 0.20: suppose f(0.20)=0.50f(0.20) = -0.50 (negative, same sign as f(0.10)f(0.10)), so the root is in [0.20,0.30][0.20, 0.30]. Midpoint c3=0.25c_3 = 0.25: suppose f(0.25)=+0.10f(0.25) = +0.10, root in [0.20,0.25][0.20, 0.25]. After 3 iterations the interval has shrunk from width 0.40 to width 0.05 — each step halved it, exactly as guaranteed, narrowing in on an implied vol near 22-23%.

Worked example 2: counting iterations needed

Starting interval [0,5][0, 5] (a plausible bound for a rate solved via bootstrapping) and target precision ϵ=0.0001\epsilon = 0.0001. Required iterations: nlog2(50.0001)=log2(50,000)15.6n \approx \log_2\left(\frac{5}{0.0001}\right) = \log_2(50{,}000) \approx 15.6, so 16 iterations guarantee the answer within 0.0001 — regardless of how badly-behaved ff is elsewhere, as long as it's continuous and the sign change holds.

iteration n width n ≈ 16, width ≈ ε
Interval width halves every iteration, so it takes a predictable, computable number of steps — about 16 here — to shrink from the starting width down to the target precision.
x iter 0: [a,b] width 360 iter 1: width 180 iter 2: width 90 iter 3: width 45 root
Each iteration keeps only the half of the interval that still brackets the sign change, so the width shrinks by exactly half every step — a guaranteed, predictable rate of convergence.

What this means in practice

Bisection is the fallback root-finder built into most pricing libraries for implied volatility, yield-to-maturity, and any "invert this monotone pricing function" problem, precisely because it never diverges or overshoots the way Newton's method can. It's typically used either on its own when robustness matters more than speed, or as a safety net wrapped around a faster method like Newton-Raphson or Brent's method: if the fast method's step would leave the known bracketing interval, fall back to a bisection step to guarantee progress.

Bisection repeatedly halves an interval known to contain a root, using only the sign of ff at the midpoint to decide which half to keep — it converges at a fixed, guaranteed rate of one bit of precision per iteration, and cannot fail as long as the function is continuous and the starting interval truly brackets a sign change.

The classic mistake is starting bisection on an interval [a,b][a,b] where f(a)f(a) and f(b)f(b) have the same sign, either because there's no root inside (or there are two, canceling the sign change) — the method will silently run and converge to a meaningless point, or need an explicit check that fails, rather than reliably finding a genuine root. Always verify f(a)f(a) and f(b)f(b) have opposite signs before starting, and be aware that if the function crosses zero an even number of times inside [a,b][a,b], the endpoints can still have matching signs while roots exist inside.

Related concepts

Practice in interviews

Further reading

  • Burden & Faires, Numerical Analysis, ch. 2
  • Press et al., Numerical Recipes, ch. 9
ShareTwitterLinkedIn