Learn from a vibrant community of students and enthusiasts,
including olympiad champions, researchers, and professionals.

Stars over Babylon

While planning a post about splitting fields and field extensions I ran into the problem of representing what they do visually. Typically, the field of rational numbers \(\mathbb{Q}\) is the system of choice for introducing field extensions and I didn't want to stray from that too much. Thus, I started thinking of an easier problem - ways to visualize \(\mathbb{Q}\).

Here's the rundown: \(\mathbb{Q}\) consists of all rational numbers - numbers of the form \(p/q\) where \(p\) and \(q\) are coprime to each other. \(1, \: 9/3, \: 1/2996\) are all elements of \(\mathbb{Q}\), while \(\sqrt{5}, e, \pi\) are not. Taken as a set, it is countably infinite, which means that it has the "same" number of elements as it does the set of integers, \(\mathbb{Z}\), as opposed to the set of real numbers \(\mathbb{R}\), which is uncountably infinite. (You can read here for more info.)

Now, \(\mathbb{Q}\), has an interesting topology to it: As a subspace of \(\mathbb{R}\) it has points which can come arbitrarily close to a point in \(\mathbb{R}\), but can never reach that point. It is a totally disconnected space - there are no "continuous" subsets of \(\mathbb{Q}\), but it is also non-discrete in the sense that any open set in \(\mathbb{R}\) will contain at least one element of \(\mathbb{Q}\).

Take a point in \(\mathbb{Q}\), for simplicity it can just be \(\frac{1}{2}\), or \(0.5\). How close to other elements of \(\mathbb{Q}\) come to it? Let's write an array and see:

The first few values are off by quite a bit while the last value comes close, but required some relatively large numbers in the numerator and denominator. The same holds for all elements \(p/q \in \mathbb{Q}\) - the next pair \(s/t\) which comes comparatively close to the value of \(p/q\) will have both \(s\) and \(t\) be far larger than \(p\) and \(q\). Anyways - to the visualization part.

We can use Thomae's function as a way to visualize \(\mathbb{Q}\). It is defined by:

This function relates both the value of \(p/q\) and the "size" of \(p/q\). It is graphed at the top of this page. There are some pretty nice fractal properties to it: for instance, there is a "valley" under every rational point. You can see that the information of the table is captured by the graph - once the value of \(1/2\) is hit then rational numbers may get arbitrarily close to it but still never reach it, and this is where these valleys come from.

This function goes by many names: the Popcorn Function, the Countable Cloud Function, and my favorite, Stars Over Babylon (hence the title).

As a parting gift, here's the reciprocal Thomae function as well as a y-axis zoom in on it. (they're too small to see in the previews, so you'll have to click on them)

Hello their, once again!! Whoah!!!! The Inverse Thomae function???? Well, the popcorn function itself is an amazing thing...... But, I never thought of defining it's inverse...........but, doesn't defining the inverse of the function, make a problem.....?? Because, supposing g(x) is the inverse of the popcorn function.............Now, g(0.5) can take ANY rational value!!! Consider this, g(1/2) = 3/2 or 5/2 or 7/2 or 11/2 or 13/2..........I mean, it isn't a function anymore right?? And also, I have never heard of the inverse popcorn function till now.........If I am wrong, could you please guide me to a link...?? Thanks :)