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 ab and cd 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,dZ and assume without loss of generality

abcd(1)adbc

(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. 1 we get

ad+cdbc+cdd(a+c)c(b+d)(2)a+cb+dcd

Equivalently, if we add ab to both sides of Eq. 1 we find

ad+abbc+aba(b+d)b(a+c)(3)aba+cb+d

Using Eqs. 2 and 3 we get to our desired result

(4)aba+cb+dcd


  1. A rational number is a real number that can be expressed as the ratio of two integers. Some examples: 1=11, 227, 0.5=12, but something like π is irrational and can’t be expressed as a fraction. ↩︎