# Farey Linked List

In my last post I talked about using Farey numbers as coordinates for linked list elements. Here’s what that looks like. Click a link to insert a new element into the list.

### Rationalizing the Irrational

We can use the Farey Linked List to find rational approximations of irrational numbers between zero and one. If we want to approximate a number greater than one, first we approximate the reciprocal of that number, then we take the reciprocal of that approximation. Let’s do \(\displaystyle\pi.\) \(\displaystyle\pi\) is greater than one, so first we take its reciprocal which is ~\(0.318\). The empty Farey Linked List has one edge that spans \(\displaystyle0-1.\) \(0.318\) is in that range, so we’ll insert a node there. Now we have two edges. The first edge spans \(0-\frac{1}{2}\), and the second edge spans \(\frac{1}{2}-1.\) \(0.318\) is in the first range, so we insert there. We can continue inserting until our approximation is good enough. Not every insertion we do will give us a better approximation immediately, but it will take us in the correct direction. The process looks like this (click the approximate button below).

That might take awhile, let’s do something else in the meantime. Here’s \(\displaystyle\phi.\)

Watch both closely. \(\displaystyle\pi\) takes long runs in the same direction, while \(\displaystyle\phi\) alternates directions every step. Alternating the direction the way \(\displaystyle\phi\) does turns out to be the fastest way to make the numerator and denominator of the Farey Numbers grow. This is one manifestation of \(\displaystyle\phi's\) reputation as “The Most Irrational Number”.