Countable Rational Numbers

In my Real Analysis class in college I remember seeing the proof that rational numbers are countable via a diagonalisation argument. Proving something is true and implementing a counting algorithm that will assign any given Rational a unique positive integer are two very different things.

This link is class room explanation behind all the math without dumbing anything down. Here’s the original amazing paper by virtue of simplicity and elegance. The only things needed to understand it is the most rudimentary understanding of binary trees and Euclid’s gcd algorithm.

I wrote up some scheme code to print out the “parents” of the node, which allows one to assign a unique positive integer to every/any Rational.

Leave a Reply