Math Circles • Spring 2026
Home
Week 3 Saturday • March 7, 2026

Stern–Brocot Tree, Best Approximations, and Continued Fractions

Smallest denominator between fractions
Best approximations
Continued fractions
Header info
Mathematics Department • Xavier University of Louisiana
Math Circles — Spring 2026
Week 3 — Saturday March 7

Typed version (MathJax)

This section summarizes the Week 3 notes in order. The full original notes are displayed at the end.

Problem 2: simplest fraction between two given fractions

We continue the Stern–Brocot discussion from Week 2 and focus first on the problem:

Problem 2. How do we find the fraction with the smallest possible denominator between two given fractions?

We split the problem into two cases:

  1. One path is not a continuation of the other.
  2. One path is the continuation of the other.

Case 1: one path is not a continuation of the other

Then we use the nearest common ancestor on the Stern–Brocot tree.

\[ L^2R^2L^2=\frac{4}{11},\qquad L^2R^2=\frac{3}{7},\qquad L^2R=\frac{2}{5}. \]

So in this example the nearest common ancestor gives the fraction of smallest denominator lying between the two given fractions.

Case 2: one path is the continuation of the other

In this case we use the rule that we may attach an infinite tail without changing the number: one attaches either \(L^{\infty}\) or \(R^{\infty}\) in order to get the longest possible overlap.

First attach the appropriate infinite tail to the shorter path, then do the same to the longer path, and the overlap gives the desired fraction.

Example: \[ LR^2=\frac34,\qquad LR^3=\frac45, \] and the overlap gives \[ LR^2L=\frac79, \] so \[ \frac34 < \frac79 < \frac45. \]

Worksheet example

We now return to the Week 2 worksheet problem of finding the simplest fraction between

\[ \frac{373}{857} \qquad \text{and} \qquad \frac{37}{85}. \]

Using Stern–Brocot paths and the longest overlap, we obtain

\[ \frac{121}{278}, \]

hence

\[ \frac{373}{857} < \frac{121}{278} < \frac{37}{85}. \]

Problem 3: best rational approximations

Problem 3. How do we find the best possible fraction to approximate \(\pi\) (or any other irrational number)?

A best approximation to \(\pi\) is a fraction \(\tfrac{p}{q}\) that does a better job than any other fraction \(\tfrac{a}{b}\) with denominator \(b \le q\).

\[ \left|\frac{p}{q} - \pi\right| < \left|\frac{a}{b} - \pi\right| \qquad \text{for every other } \frac{a}{b} \text{ with } b \le q. \]

We compare decimal approximations with \(\tfrac{355}{113}\), illustrating that decimal truncation does not necessarily give the best approximation.

Irrational numbers and infinite paths

Every irrational number corresponds to an infinite path on the Stern–Brocot tree that does not end with \(L^{\infty}\) or \(R^{\infty}\).

To find the best approximations, cut the infinite path every time there is a turn.

This raises the next question: how do we find the paths for numbers such as \(\pi\) or \(\tfrac{373}{857}\)? The answer leads to continued fractions.

From decimal expansions to continued fractions

Let's step back to decimal expansion. For example,

\[ 3.1415 = 3 + \frac{1}{10} + \frac{4}{10^2} + \frac{1}{10^3} + \frac{5}{10^4}. \]

Why is base 10 is used at all? We try putting the digits into the denominators instead, producing automatically smaller and smaller pieces. This leads to a nested expression.

Continued fractions

After using parentheses, the expression becomes a continued fraction, written for short in bracket notation.

\[ 3 + \cfrac{1}{1 + \cfrac{1}{4 + \cfrac{1}{1 + \cfrac{1}{5}}}} \,=\, [3;1,4,1,5]. \]
Every fraction can be written as a continued fraction, and every irrational number can be written as an infinite continued fraction.

Continued fractions and the Stern–Brocot tree

For an irrational number, the continued fraction is the sequence of exponents in the Stern–Brocot path.

For example, the continued fraction expansion for \(\pi\) begins with

\[ [3;7,15,1,292,\ldots]. \]

For rational numbers, there are three equivalent descriptions: adding 1 to the last exponent, attaching \(L^{\infty}\) and ignoring \(R^{\infty}\), or attaching \(R^{\infty}\) and ignoring \(L^{\infty}\).

Examples

We work through examples such as

\[ \frac{3}{4} = [0;1,3], \qquad \frac{7}{18} = [0;2,1,1,3], \qquad \frac{7}{10} = [0;1,2,3]. \]

How to find the continued fraction of a number

Recall quotient and remainder. For example,

\[ \frac{49}{5} = 9 + \frac{4}{5}. \]

Then one inverts the fractional part and repeats the process. Applying this to \(\tfrac{37}{85}\), we derive

\[ \frac{37}{85} = [0;2,3,2,1,3]. \]

The same recursive idea works for irrational numbers as well.

Photo Gallery

Photos from Week 3 Math Circles session. Scroll horizontally, or click any photo to enlarge it.

Full notes (all pages)

These are the complete Week 3 notes. Put the corresponding page images in a folder named pages next to this HTML file.

Week 3 notes, page 1
Notes (Week 3) — page 1
Week 3 notes, page 2
Notes (Week 3) — page 2
Week 3 notes, page 3
Notes (Week 3) — page 3
Week 3 notes, page 4
Notes (Week 3) — page 4
Week 3 notes, page 5
Notes (Week 3) — page 5
Week 3 notes, page 6
Notes (Week 3) — page 6
Week 3 notes, page 7
Notes (Week 3) — page 7