# Farey Dissection

Standard

The Farey sequence $\mathcal{F}_n$ of order $n$ is the ascending sequence of irreducible fractions between 0 and 1, whose denominators do not exceed $n$. This sequence was discovered by Charles Haros in 1806, but Augustin-Louis Cauchy named it after geologist John Farey.

Thus $\frac{h}{k}$ belongs to $\mathcal{F}_n$ if $0\leq h\leq k\leq n$ and $\text{gcd}(h,k)=1$, the numbers 0 and 1 are included in the forms $\frac{0}{1}$ and $\frac{1}{1}$. For example,
$\displaystyle{\mathcal{F}_5 = \frac{0}{1},\frac{1}{5},\frac{1}{4},\frac{1}{3},\frac{2}{5},\frac{1}{2},\frac{3}{5},\frac{2}{3},\frac{3}{4},\frac{4}{5},\frac{1}{1}}$

Following are the  characteristic properties of Farey sequence (for proofs refer §3.3, §3.4 and §3.7 of G. H. Hardy and E. M. Wright’s An Introduction to the Theory of Numbers):

1. If $\displaystyle{\frac{h}{k}}$ and $\displaystyle{\frac{h'}{k'}}$ are two successive terms of $\mathcal{F}_n$, then $kh'-hk'=1$.
2. If $\displaystyle{\frac{h}{k}}$$\displaystyle{\frac{h''}{k''}}$ and $\displaystyle{\frac{h'}{k'}}$ are three successive terms of $\mathcal{F}_n$, then $\displaystyle{\frac{h''}{k''}=\frac{h+h'}{k+k'}}$.
3. If $\displaystyle{\frac{h}{k}}$ and $\displaystyle{\frac{h'}{k'}}$ are two successive terms of $\mathcal{F}_n$, then the mediant $\displaystyle{\frac{h+h'}{k+k'}}$ of $\displaystyle{\frac{h}{k}}$ and $\displaystyle{\frac{h'}{k'}}$ falls in the interval $\displaystyle{\left(\frac{h}{k},\frac{h'}{k'}\right)}$.
4. If $n>1$, then no two successive terms of $\mathcal{F}_n$ have the same denominator.

The Stern-Brocot tree, which we saw earlier while understanding the working of clocks, is a data structure showing how the sequence is built up from 0 (=0/1) and 1 (=1/1) by taking successive mediants.

Now, consider a circle $\mathcal{C}$ of unit circumference, and an arbitrary point $O$ of the circumference as the representative of 0 (zero), and represent a real number $x$ by the point $P_x$ whose distance from $O$, measured round the circumference in the anti-clockwise direction, is $x$.

Plainly all integers are represented by the same point $O$, and numbers which differ by an integer have the same representative point.

Now we will divide the circumference of the circle $\mathcal{C}$ in the following manner:

1. We take the Farey sequence $\mathcal{F}_n$, and form all the mediants $\displaystyle{\theta = \frac{h+h'}{k+k'}}$ of the successive pairs $\displaystyle{\frac{h}{k}}$$\displaystyle{\frac{h'}{k'}}$. The first and last mediants are $\displaystyle{\frac{1}{n+1}}$ and $\displaystyle{\frac{n}{n+1}}$. The mediants naturally do not belong themselves to $\mathcal{F}_n$.
2. We now represent each mediant $\theta$ by the point $P_\theta$. The circle is thus divided up into arcs which we call Farey arcs, each bounded by two points $P_\theta$ and containing  one Farey point, the representative of a term of $\mathcal{F}_n$. Thus $\displaystyle{\left(\frac{n}{n+1},\frac{1}{n+1}\right)}$ is a Farey arc containing the one Farey point $O$.

The aggregate of Farey arcs is called Farey dissection of the circle. For example, the sequence of mediants for $n=5$, say $\mathcal{M}_5$ is
$\displaystyle{\mathcal{M}_5 = \frac{1}{6},\frac{2}{9},\frac{2}{7},\frac{3}{8},\frac{3}{7},\frac{4}{7},\frac{5}{8},\frac{5}{7},\frac{7}{9},\frac{5}{6}}$

And hence the Farey disscetion looks like:

Let $n>1$. If $P_{h/k}$ is a Farey point, and$\frac{h_1}{k_1}$, $\frac{h_2}{k_2}$ are the terms of $\mathcal{F}_n$ which precede and follow $\frac{h}{k}$, then the Farey arc around $P_{h/k}$ is composed of two parts, whose lengths are
$\displaystyle{\frac{h}{k}-\frac{h+h_1}{k+k_1}=\frac{1}{k+k_1}, \qquad \frac{h+h_2}{k+k_2}-\frac{h}{k}=\frac{1}{k(k+k_2)}}$
respectively. Now $k+k_1<2n$, since $k_1$ and $k_2$ are unequal (using the point (4.) stated above)and neither exceeds $n$; and $k+k_1>n$ (using the point (3.) stated above). We thus obtain:

Theorem: In the Farey dissection of order $n$, there $n>1$, each part of the arc which contains the representative $\displaystyle{\frac{h}{k}}$ has a length between $\displaystyle{\frac{1}{k(2n-1)}}$ and $\displaystyle{\frac{1}{k(n+1)}}$.

For example, for $\mathcal{F}_5$ we have:

Using the above result, one can prove the following result about rational approximations (for more discussion, see §6.2 of  Niven-Zuckerman-Montgomery’s An Introduction to the Theory of Numbers):

Theorem: If $x$ is a real number, and $n$ a positive integer, then there is an irriducible fraction $\displaystyle{\frac{h}{k}}$ such that $0 and $\displaystyle{\left| x-\frac{h}{k}\right| \leq \frac{1}{k(n+1)}}$

One can construct a geometric proof of Kronceker’s theorem in one dimension using this concept of Farey dissection. See §23.2 of G. H. Hardy and E. M. Wright’s An Introduction to the Theory of Numbers  for details.

# Clocks

Standard

Clocks are amazing. They tell us time. In this post I want to talk about working of analog clocks. In case you haven’t seen an analog clock, this is how it looks like:

A wall clock, it’s working part in the back and inside of the working part.

But, what clocks have to do with mathematics? As I have mentioned several times, one major part of mathematics is about counting and clocks “count”! Clocks are amazing counting device, they perform mod 12 and mod 60 calculations (that’s why modular arithmetic is also called clock arithmetic).

Unfortunately, the ideal cases exist only in our abstract world of mathematics. In real world, whatever we build has some error percentage and our motive to minimize this error. A mathematical construction, called Stern-Brocot tree, was created to help build timepieces and understand number theory.

By Aaron Rotenberg (Own work) [GFDL or CC-BY-SA-3.0], via Wikimedia Commons

This “tree” gives an exceptionally elegant way to enumerate the positive rational numbers and is a surprisingly useful tool for constructing clocks.  For more information about this construction read this feature column article by David Austin.

Just like continued fractions, this tree gives us good rational approximations of a given real number. Clocks typically have a source of energy–such as a spring, a suspended weight, or a battery–that using gears turns a shaft at a fixed rate. We can increase the precision by using more number of gears of different teeth count in appropriate combination.

I will end this post with an example from Austin’s article:

Suppose we place a pinion on a shaft that rotates once every hour and ask to drive a wheel that rotates once in a mean tropical year, which is 365 days, 5 hours, 49 minutes. Converting both periods to minutes, we see that we need the ratio 720 / 525,949. The problem here is that the denominator 525,949 is prime so we cannot factor it. To obtain this ratio exactly, we cannot use gears with a smaller number of teeth. It is likewise impossible to find a multi-stage gear train to obtain this ratio. But, as we slide down the “tree” toward 720 / 525,949, the rationals we meet along the way will give good approximations with relatively small numerators and denominators. As we descend the Stern-Brocot tree towards 720 / 525,949, we find the fraction 196 / 143,175, which may be factored into four rational factors, 2/3, 2/25, 7/23 and 7/83. We can therefore construct a four-stage gear train and can get a pretty accurate clock.

I hope I have been able to convince you that clocks are much more interesting than they would appear and you should read the article by David Austin for further references.