Here’s a fun observation.

How quickly can you find a number between \(27/97\) and \(27/98\)?

Without using a calculator?


For any two rational numbers1 you can always find another rational number that lies between them by dividing the sum of their numerators by the sum of their denominators.

Huh? For numbers \(\frac{a}{b}\) and \(\frac{c}{d}\) then \((a + c) / (b + d)\) always lies between them.

In our case: \((27 + 27) / (97 + 98) = 54 / 195\)

(format nil "27 /  97 = ~a~&54 / 195 = ~a  <--~&27 /  98 = ~a~&"
        (/ 27.0 97)
        (/ 54.0 195)
        (/ 27.0 98))

Why do I care?

I was talking to my team at one point and we were making a list of priorities.

We came up with the first couple: 1, 2, 3, … Then came the questions.

What about X? Well, that sits between 1 and 2. Let’s call it 1.5.

What about Y? That sits between 1 and 1.5, so let’s call it 4/3 (1/1 + 3/2 = 4/3) 🤨

What about Z? That sits between 4/3 and 1.5 so let’s call it 7/5 (4/3 + 3/2 = 7/5) 🤨🤨

It then became a bit of a game, testing out my mental arithmetic. They won, I made a mistake, but the underlying algorithm kept working.

Proof(-ish)

Define \(a, b, c, d \in \mathbb{Z}\) and assume without loss of generality

\begin{align} \frac{a}{b} &\leq \frac{c}{d} \nonumber\\ \nonumber\\ \label{eq:order} ad &\leq bc \end{align}

(I’ll leave it to you to verify the following still holds when \(b\) and/or \(d\) are negative.)

If we add \(cd\) to both sides of Eq. \ref{eq:order} we get

\begin{align} ad + cd &\leq bc + cd \nonumber\\ d(a + c) &\leq c(b + d) \nonumber\\ \nonumber\\ \label{eq:cd} \frac{a + c}{b + d} &\leq \frac{c}{d} \end{align}

Equivalently, if we add \(ab\) to both sides of Eq. \ref{eq:order} we find

\begin{align} ad + ab &\leq bc + ab \nonumber\\ a(b + d) &\leq b(a + c) \nonumber\\ \nonumber\\ \label{eq:ab} \frac{a}{b} &\leq \frac{a + c}{b + d} \end{align}

Using Eqs. \ref{eq:cd} and \ref{eq:ab} we get to our desired result

\begin{equation} \frac{a}{b} \leq \frac{a + c}{b + d} \leq \frac{c}{d} \end{equation}


  1. A rational number is a real number that can be expressed as the ratio of two integers. Some examples: \(1 = \frac{1}{1}\), \(\frac{22}{7}\), \(0.5 = \frac{1}{2}\), but something like \(\pi\) is irrational and can’t be expressed as a fraction. ↩︎