Hexa Scholar

Bisection: trapping a root

Two navy stops on a wooden rail, with an unused gold divider on the workbench in front.
Two stops mark the ends of a search interval; a divider waits beside the rail.

The question

Choose the interval to keep, then inspect what your choice guarantees.

  1. 1 SeeChoose which half to keep.
  2. 2 TryDecide when to stop.
  3. 3 ProveProve the midpoint error bound.
  4. 4 ApplySolve five root-finding problems.
Before you start · 3 quick checks on signs, midpoints, and continuity

Two ideas before you start

2 ideas

A bracket records two signs

A line crosses the horizontal axis. Choose an interval to inspect its endpoint signs.

For a continuous function, opposite endpoint signs certify a root inside. The bracket stores a location guarantee, not an exact answer.

Exact definition

A root is an input \(r\) with \(f(r)=0\). A strict sign bracket is a closed interval \([a,b]\), with \(a\lt b\), on which \(f\) is continuous and \(f(a)\) and \(f(b)\) have opposite signs. Equivalently, their product is negative.

The intermediate value theorem guarantees at least one root inside. It does not guarantee a unique root or tell us which root a later search will retain. An endpoint with value zero is already a root and should be reported before starting a strict-bracket search.

Separate the input from the output

An input marker on the horizontal axis and its height on a parabola.

The input locates the marker along the axis. The function value is its height; its sign tells which side of the horizontal axis it occupies.

Exact definition

For an estimate \(x\), the residual is the output \(f(x)\). Its magnitude is \(|f(x)|\). The input error relative to a particular root \(r\) is \(|x-r|\). Keep their units separate: a time input might produce a temperature residual. Bisection evaluates outputs to make decisions about an interval of inputs.

Refresher: the facts used on this page

Numbers with opposite signs have a negative product. The midpoint of \([a,b]\) is \(m=(a+b)/2\). Its distance to either endpoint is half the interval length. Continuity means nearby inputs give outputs near the value at the point, with no missing value or jump there.

For a continuous function on a closed interval, every height between its endpoint values is attained. We use that result here; the linked intermediate value lesson proves it. A geometric sequence with a fixed ratio strictly between zero and one tends to zero, as in convergent sequences. Those facts apply to exact real numbers. Computed signs require separate care.

1 See

Keep a root inside

The solid segment is the current bracket. The dashed marker is its midpoint; the curve and its root are not drawn.
Accepted brackets. Row n counts completed halvings; width and midpoint bound are exact.
nabWidthBound
What is being checked?

The choice is checked from signs, without a stored decimal approximation to the root. When the midpoint is not a root, exactly one half has opposite endpoint signs. The other half might contain roots for a general continuous function, but its endpoint signs alone do not certify them.

Every accepted half becomes the next closed interval. The history records those decisions. A wrong click adds no row and consumes no halving. The activities use polynomials and dyadic inputs, evaluated with exact rational arithmetic. The picture uses decimal coordinates only for drawing.

After each round, compare the initial row with the last one. The two ordinary rounds reverse which endpoint has the negative sign. The final round tests the stopping branch: if the midpoint is an exact root, return it immediately. That event is recorded as a root discovery, not as a fictitious interval of half the old length.

2 Try

Decide when to stop

A function evaluation and a location estimate answer different questions. Make a prediction before opening the stopping-rule explorer.

3 Prove

Why the bracket is a certificate

Bisection guarantee

Assume \(a_0\lt b_0\), a real-valued function continuous on \([a_0,b_0]\), and strictly opposite endpoint signs. Use exact arithmetic and exact sign evaluations. Stop if a tested midpoint is a root; otherwise retain the half with opposite endpoint signs.

Every retained interval contains a root. After \(n\ge0\) completed halvings its width is \(W_0/2^n\), and its midpoint has error at most \(W_0/2^{n+1}\) relative to any root still inside. If no midpoint ever hits a root, the nested intervals shrink to a single point \(c\), which is a root, and their midpoints converge to \(c\).

The single limiting point belongs to this run of the algorithm. It does not imply that the original function has only one root. The proof below treats the branch with no exact midpoint hit, so every retained width is positive.

Build the argument one line at a time. The width calculation uses a whole number \(n\ge1\); the initial case follows directly from the definition of \(W_0\).

Refresher: why there is one common point

The left endpoints form a nondecreasing sequence bounded above by the original right endpoint. Completeness of the real numbers gives their supremum \(c\). Every right endpoint bounds all left endpoints above, while each left endpoint is at most \(c\). Hence \(a_n\le c\le b_n\) for every retained interval.

The lengths tend to zero. Both endpoint distances from \(c\), and the midpoint distance, are bounded by the length, so all three sequences converge to \(c\). Any other common point would have a positive distance from \(c\), exceeding some later interval length. Continuity carries both endpoint sequences to the same output \(f(c)\). Their opposite signs force that output to be zero.

4 Apply

Use a bracket with a purpose

Each problem has hints and a worked solution. A completed halving means an interval update, and the reported estimate is the midpoint of the interval left after those updates. Exact answers accept decimals or fractions. The cooling model separates numerical error from physical model error.

Key point Start with continuity and endpoint signs. State what you report, count interval updates, and express the guarantee in the input's units. A failed sign test does not, by itself, prove that a root is absent.
Level IntroPrerequisites intermediate values; signs and midpoints refreshed aboveTime ~30 min

Related: the intermediate value theorem proves existence, convergent sequences explains the limit, and floating point explains finite precision.

Further reading