Ford Circles and Farey Fractions, Explained
After reading this you will know how to turn any reduced fraction into a circle resting on the number line, why two of those circles kiss exactly when the fractions are Farey neighbours, and how the mediant rule fills the gaps with ever smaller circles.
What it is, and one picture to hold onto
Take the fraction \tfrac{1}{2}. Draw a circle that sits on top of the number line at x = 0.5, touching it at that single point, with radius 1/8. Now take \tfrac{1}{3} and \tfrac{2}{3}: each gets its own circle, radius 1/18, sitting at 0.3333 and 0.6667. These smaller circles snuggle into the gap on either side of the big one and touch it without crossing it.
That is the whole picture. Every reduced fraction p/q in [0,1] becomes one circle. Bigger denominators give smaller circles. No two circles ever overlap. Where two circles touch, the two fractions are neighbours in a Farey sequence. The tool builds these fractions by the mediant rule and draws the circles so you can watch the gaps fill.
The surprise is that a purely geometric fact (circles not overlapping) encodes a purely arithmetic fact (two fractions being adjacent with cross-difference 1). The rest of this article shows exactly why.
The mediant and the Farey sequence
Start with the two endpoints written as fractions: \tfrac{0}{1} and \tfrac{1}{1}. The mediant of two fractions is what you get by adding numerators and adding denominators.
Here a/b and c/d are the two fractions you combine, and the result lands strictly between them. The mediant of \tfrac{0}{1} and \tfrac{1}{1} is \tfrac{1}{2}. Insert it. Now do the same in each new gap: between \tfrac{0}{1} and \tfrac{1}{2} you get \tfrac{1}{3}, and between \tfrac{1}{2} and \tfrac{1}{1} you get \tfrac{2}{3}.
The Farey sequence of order n, written F_n, is every reduced fraction in [0,1] whose denominator is at most n, listed in order. For example F_4 = \tfrac{0}{1}, \tfrac{1}{4}, \tfrac{1}{3}, \tfrac{1}{2}, \tfrac{2}{3}, \tfrac{3}{4}, \tfrac{1}{1}. Two facts make the whole subject work, and both are checkable by hand:
- If \tfrac{p}{q} and \tfrac{r}{s} are neighbours in some F_n, then |ps - rq| = 1. Check with \tfrac{1}{3} and \tfrac{1}{2}:
1·2 − 1·3 = −1, absolute value1. - The next fraction to appear between two neighbours is exactly their mediant. Between \tfrac{1}{3} and \tfrac{1}{2} the mediant is \tfrac{2}{5}, and indeed \tfrac{2}{5} is the first fraction to split that gap, entering at order 5.
The Ford circle formula
Now attach a circle to each fraction. The Ford circle for the reduced fraction p/q sits above the number line, tangent to it at x = p/q, with this radius.
The symbol q is the denominator, p the numerator. The centre sits directly above the tangent point at height equal to the radius, so the circle rests on the line. For \tfrac{1}{2} the radius is 1/(2\cdot 4) = 1/8 = 0.125. For \tfrac{1}{3} it is 1/18 \approx 0.05556. The radius shrinks like the square of the denominator, so a jump from denominator 2 to denominator 10 shrinks the circle by a factor of 25.
The q^2 is the reason the picture looks fractal. Halving a gap roughly doubles the denominators inside it, which quarters the circle radii. Zoom in and you see the same nested pattern at every scale.
Why the circles never overlap
Take two fractions p/q and r/s and ask when their circles touch. Two circles are externally tangent when the distance between their centres equals the sum of their radii, and they overlap when that distance is smaller. Compute the squared distance between centres:
Compare it to the squared sum of radii, (1/2q^2 + 1/2s^2)^2. Subtract the second from the first and the algebra collapses to a clean result:
Here r_1 = 1/2q^2 and r_2 = 1/2s^2, and ps - rq is the cross-difference. Because p, q, r, s are integers, (ps-rq)^2 is a non-negative integer. So the right side is never negative: the distance is never less than the sum of the radii, and the circles never overlap. They touch exactly when (ps-rq)^2 = 1, which is the Farey neighbour condition |ps - rq| = 1.
This is the payoff worth remembering: tangency of the circles and adjacency of the fractions are the same statement. You can read Farey neighbours straight off the picture by looking for kissing points.
Reproducing the demo up to denominator 4
Run the tool with its defaults, which build fractions up to a small maximum denominator. Here is the Farey sequence F_4 and the exact circle for each fraction.
- Start with \tfrac{0}{1} and \tfrac{1}{1}. Both have
q = 1, radius 1/2 = 0.5. These are the two big framing circles. - Insert the mediant \tfrac{1}{2}. Radius 1/8 = 0.125. Check tangency to \tfrac{0}{1}: |0\cdot 2 - 1\cdot 1| = 1, so they kiss.
- Insert \tfrac{1}{3} and \tfrac{2}{3}. Radius 1/18 \approx 0.05556 each.
- Insert \tfrac{1}{4} and \tfrac{3}{4}. Radius 1/32 = 0.03125 each. Denominator 4 is the cap, so the sequence stops here.
| Fraction | Decimal | q | Radius 1/(2q²) |
|---|---|---|---|
| 0/1 | 0.0000 | 1 | 0.5000 |
| 1/4 | 0.2500 | 4 | 0.03125 |
| 1/3 | 0.3333 | 3 | 0.05556 |
| 1/2 | 0.5000 | 2 | 0.1250 |
| 2/3 | 0.6667 | 3 | 0.05556 |
| 3/4 | 0.7500 | 4 | 0.03125 |
| 1/1 | 1.0000 | 1 | 0.5000 |
Verify one non-neighbour to see the rule bite. Take \tfrac{1}{4} and \tfrac{1}{2}: cross-difference |1\cdot 2 - 1\cdot 4| = 2. Since that is not 1, their circles do not touch, and indeed \tfrac{1}{3} sits between them.
Reading the picture
The chart below plots radius against decimal position for every fraction in F_6. The tall points are the simple fractions with small denominators; the low points are the fussy ones like \tfrac{5}{6}. Notice that the biggest circle sits at \tfrac{1}{2} and the circles get shorter as you move toward simpler-looking but higher-denominator neighbours.
Two readings matter. First, the height of a circle tells you the denominator at a glance: a circle of radius 0.02 means q = 5, since 1/(2\cdot 25) = 0.02. Second, the horizontal gaps between tangent points grow tighter near simple fractions and looser in the empty stretches, which is why raising the denominator cap fills the wide gaps first.
Common mistakes
The pitfalls here are arithmetic, not conceptual, and they are easy to catch with a number.
- Forgetting to reduce
- The formula assumes p/q is in lowest terms. If you write \tfrac{2}{4} instead of \tfrac{1}{2} you would compute radius 1/32 instead of 1/8, a wrong circle at the right place. The mediant of Farey neighbours is always already reduced, so building by mediants avoids this automatically.
- Expecting the mediant to be the average
- The mediant of \tfrac{1}{3} and \tfrac{1}{2} is \tfrac{2}{5} = 0.4, not the midpoint 0.4167. It lands between the two but leans toward the one with the smaller denominator.
- Thinking tangency means "close"
- Two circles can sit very near each other on the line yet not touch. \tfrac{1}{4} and \tfrac{1}{3} are only
0.0833apart but their cross-difference is |1\cdot 3 - 1\cdot 4| = 1, so they do touch. Distance on the line is not the test; the cross-difference is.
Related tools
Ford circles connect to several other corners of this site. The mediant construction is a cousin of the greatest-common-divisor machinery in the Euclidean algorithm visualizer, and continued fractions (which the Stern-Brocot tree encodes) feed the phyllotaxis seed spirals through the golden ratio. For the fractal side, the nested self-similar gaps here echo the log-log scaling measured in the box-counting dimension lab and the recursive gasket built by the chaos game. If you like circles that reconstruct a shape, the rotating chains in Fourier epicycles use them differently but just as tangibly.
Frequently asked questions
Why is the radius 1/(2q²) and not just 1/q²?
The factor of 2 is what makes neighbouring circles tangent rather than overlapping. If you drop it, the algebra in the non-overlap proof no longer cancels to (ps-rq)^2 - 1, and simple fractions like \tfrac{0}{1} and \tfrac{1}{1} would cut into each other. The 1/2 is the exact scale at which the arithmetic and geometry agree.
Do Ford circles cover the whole number line if I go far enough?
They touch it only at rational points, one point per fraction, so the tangent points are dense but have zero total length. The circles themselves fill an ever larger share of the strip above the line as you add fractions, but the line contact stays a set of isolated points.
What is the Stern-Brocot tree exactly?
It is the binary tree you get by recording every mediant insertion. The root is \tfrac{1}{1} (or \tfrac{1}{2} for the [0,1] version), and each node's two children are the mediants formed with its left and right ancestors. Every positive reduced fraction appears exactly once, so the tree lists the rationals without repeats or gaps.
How many fractions are in the Farey sequence of order n?
The count of fractions in F_n is 1 + \sum_{k=1}^{n}\varphi(k), where \varphi is Euler's totient. For n = 4 that is 1 + (1+1+2+2) = 7, matching the table above. For n = 6 it is 13.
Does any of this describe the physical world?
Not directly. Ford circles are a fact about integers, drawn to make that fact visible. They do appear in physics where resonances lock at rational ratios (for instance mode-locking in driven oscillators), but the picture is a map of the rationals, not a model of matter.