22/7 and the Approximation of Irrational Numbers
- James Wilkins
- May 19, 2025
- 4 min read

Irrational numbers are somewhat difficult to work with. Unfortunately, they’re also quite useful and crop up both in pure and applied mathematics, and tons of places you may not expect.
An irrational number is any real number that cannot be expressed exactly as a fraction. Think π, e, and √2.
When written in decimal form, they result in an infinite sequence of numbers with no apparent pattern. If we round or truncate this number, we lose accuracy and introduce some level of error into any calculation. This isn’t inherently a problem in most situations, so long as our approximation is sufficiently close to the actual value.
Take π for example:
π = 3.141592653589793238462643383279…
We have the common approximation of 3.14, the slightly more accurate 3.1415 — if you’re feeling fancy — or even 3.141592653589793, which is used by NASA.
But none of these are the true value of pi…
Sometimes you’ll see the fraction 22/7 used as an approximation of pi. This is
surprisingly close to the actual value.
22 / 7 = 3.14285π — 22 / 7 = -0.00126
Better still, we have:
355 / 113 = 3.1415929…
so π — (355 / 113) = −0.0000002667 — pretty close!
This problem isn’t limited to irrational numbers either; if we have a long rational number that we wish to write in a more concise form without losing accuracy, we can approximate it using a fraction.
But how do we come up with these approximations? Can they be improved? The math behind it, while strange-looking, is simpler than you might think!
Some funny looking fractions
One of the first theorems you’ll encounter when studying university-level mathematics is commonly known as the Division Algorithm.
Theorem. The Division Algorithm. Let a and b be integers with b > 0. Then there exist integers q and r such that a = qb + r, where 0 ≤ r < b.
You can find a proof of this theorem here.
It may look a little confusing, but what it really tells us is that we can rewrite the expression a/b as (q + r/b) — in other words — we can replace an improper fraction with a mixed number.
(Yes, this may seem like an obvious statement, but mathematicians like to be rigorous!)
Example 1.
Let’s start with an example using a rational number. Take the fraction 13/8.
The theorem above tells us that we can rewrite this as
13/8 =1 + 5/8
But we can also rewrite 5/8 as (1 / (8/5)) , giving us another improper fraction, 8/5, so we can apply the theorem again:
8/5 = 1 + 3/5
If we combine everything we’ve got so far, we get:

It’s a strange way to write it, but the process is mathematically simple: flip the fraction to make it an improper one, then rewrite it in a mixed number form.
We can continue this process, rewriting 3/5 as (1 / (5/3))

And then rewrite 2/3 as (1 / (3/2))

All of that is to say, we can rewrite 13/8 as

This is known as a continued fraction expansion.
We also have some specific notation to describe this form: [1; 1, 1, 1, 2]. These values refer to the terms being added in each successive fraction, as shown below:

It’s an interesting and unusual form for sure, but in this case it doesn’t help us find a rational approximation of our number because we already have one: 13/8! Fortunately, we can apply this same procedure to any real number, rational or irrational. Let’s see another example with √3 = 1.7320508075… and we’ll take a look at how we can use this continued fraction form to derive a rational approximation.
Example 2.

This time, we have the additional step of rationalising the denominator:

And so…

Then we can use the same substitution as before: √3 = 1 + ( √3 — 1 )

Rationalising the denominator, the same as before, we get:

You may notice, that we’re now back where we started, with a √3 − 1 term.
This means that if we carry on this procedure, we’ll end up with a repeating pattern: 1, 2, 1, 2, 1, 2… We can describe this with the following notation:

Now let’s find an approximation of √3…
Continued Fraction → Rational Approximation
To start finding rational approximations, we use the following recurrence relation:
Let α = [ a0; a1, a2, a3, … ]. Then the following recurrence relation generates the convergents of α. These are rational approximations that get closer and closer to the original value.

Using the initial values:

We keep the terms of Cn as fractions, since the numerator gives us the Pn term and the denominator gives us the Qn term. The sequence of rational numbers, Cn converges to our original irrational number (as described by the continued fraction form α).
This means, we have a sequence of approximations that get more accurate the further along the sequence you go!
Back to √3
As we saw, we have the continued fraction expansion of √3 as described by:

Following the formula above, we take

Then we repeat as follows:

As you can see, our approximations get closer and closer to the actual value.
That’s enough fractions for one day
Believe it or not, this is one of those things in math that’s actually kind of useful. Continued fractions don’t just give us better approximations of irrational numbers — they also open some doors in Number Theory.
Continued fraction expansions give us the tools we need to solve equations of the form
x² − Dy² = 1
(known as Pell’s Equation).
Outside of pure math, rational approximations pop up more than you’d think: data compression, digital signal processing, and anywhere we need to store or transmit numbers accurately, but with a restricted size.
So, while 22/7 is a fan favourite among mathematicians, it’s really just the tip of the iceberg. With a bit of creative thinking (and a few layers of fractions), we can get surprisingly close to perfect — and most of the time, that’s more than enough.




Comments