Hold onto your logic hats! In this article we're going to explore one of the most amazing formulas in maths: Tupper's self-referential formula.
Meet the monster
The protagonist of our story is the following inequality
Looks frightening, but we can unravel it. The symbols and together denote the floor function: for a real number , the floor of is the largest integer that's no bigger than . For example, The function computes the remainder you get when you divide by , for example Given two integers and you can work out the right hand side of expression (1) and then see if the inequality is satisfied. (See here for an example.)
The Dr. Frankenstein behind this creature is computer scientist Jeff Tupper. In a 2001 paper Tupper introduced this expression merely as an example; it was just one function that could be plotted with graphing software. To create a plot from the formula imagine portioning the (x,y)-plane into squares of side length 1 as shown below:
Here, the bottom left square has coordinates , the one to its right has coordinates , the one above it has coordinates and so on. To plot Tupper’s inequality we let run from 0 to 105, so that’s 106 squares in total.
The plot works by either colouring a square or not colouring it: a square with coordinates is coloured if the inequality is true for and . If not the square is left blank.
If you plot the plot for many values of and , the outcome is the following:
I'll let that sink in a moment. No, your eyes are not deceiving you, the formula plots a bitmap picture of itself! Hence the name Tupper's self-referential formula (though Tupper never called this function that himself in his 2001 paper).
There is one missing detail, however. I haven’t told you the value of the number on the -axis. It’s the following very large number:
[Note: This might disagree with values you find in other articles on Tupper's formula. This is because there are two conventions for how to display the coordinate system. In mathematics the positive y-axis runs upwards while in computer science it is sometime taken to run downwards. But whatever convention you use with what number, the worst that can happen is that the plot appears up side down.]
If you look at the squares with -coordinates between and (and ignore all squares with -coordinates less than and greater than , you will see the bitmap image of Tupper’s formula itself.
The Plot Thickens
Now let’s take it up a notch. Say we didn’t like our 543-digit value of and wanted to scroll up and down the -axis and see what plots we get then. As you scroll up and down the -axis from minus infinity (indicated by the downwards direction) to plus infinity (indicated by the upward direction) Tupper’s formula plots almost everything.
Any picture that can be represented by a grid of pixels of dimensions 106x17 using two colours is somewhere in the plot of the formula for a particular values of . Here are some examples.
Euler’s identity appears for -coordinates between and , where
Next there is a picture of the Gaussian integral, another favourite expression in maths:
The corresponding value of is
Obviously, we don't need to restrict ourselves to pictures of mathematical expressions. Any 106x17 grid of pixels can be found somewhere in the plot of Tupper's formula.
From picture to N
As previously explained, the plotting of this bitmap function transpires over a series of squares. Say you had a picture in mind you wanted to graph and needed to know the corresponding N-value — how would you find it? The process is rather simple:
- Beginning in the bottom left pixel of your desired image, write down a 1 if the pixel is coloured in or a 0 if it is blank. Now consider the square directly above and write down either a 1 or 0 in the same way.
- Continue to move up the first column. Once the first column is dealt with, move onto the second column beginning with the bottom square in this second column. Repeat the allocation of 0s and 1s as above.
- Move up the second column, then the third, fourth, fifth and so on until you have assigned a 0 or 1 to each pixel in each column of the 106x17 pixel image.
- You will now have an incredibly long string of 0s and 1s (a 1802 digit string to be exact). This string represents a binary number. Convert this number into base 10 and multiply by 17.
- Like magic , you now have the value of that corresponds to the image you want to plot.
You might also want to watch the Numberphile video below.
About the author
Harmeet Singh is an A-Level student from London. His A-Levels include Maths, both Further and Advanced, alongside English Literature. He is incredibly passionate about pure mathematics, particularly the Riemann Hypothesis and analysis. Harmeet hopes to complete a mathematics degree at Trinity College, Cambridge, leading onto a professorship and FRS, akin to his idols Ramanujan and G.H. Hardy.
Nice article - thanks. I'm going to have a play on the linked website!
Thank you very much and enjoy!
- Harmeet (the author)
Kindly suggest me any app to plot this graph!!
The value for N does not work when entered into elmismopancho's Tupper Plotter at:
The other plots such as Gaussian integral are correct and work.
Can you double check the value for N?
Thank you for letting us know, a few digits were reversed - it's fixed now!
Great stuff - thanks for that!
Thank you very much!
Thank you for the article! I have enjoyed it
An equivalent way to figure out the value of N is to see the 1802 squares as if they were the elements
of a geometric progression whose first member is a(1)=17 (the square on the botton of the first column) and ratio=2.
The element on the top of the first column would be a(17) and the element on the botton of the second column would be a(18), and so on.
If, for example, we wanted to plot the third square from the botton of the second column the value of N would be:
N = a(20) = 17 x 2^(20-1) = 17 x 2^19 = 8912896
And if we also wanted to plot the top square of the fourth column:
N = a(20) + a(68) = 17 x 2^(20-1) + 17 x 2^(68-1) = 8912896 + 2508757194024499019776 = 2508757194024507932672
In other words, according to its position inside the geometric progression, each square has a value that has to be added to the value of other squares to be plotted together.
The final result for N is the same, but seen from other perspective. :-)
Thank you very much and that's a really interesting perspective on the value of N. Fascinating!