Suvarna Garge (Editor)

Tupper's self referential formula

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

Tupper's self-referential formula is a formula that, when graphed in two dimensions at a specific location in the plane, can be "programmed" to visually reproduce the formula itself.

Contents

History

It was defined by Jeff Tupper. It is used in various math and computer science courses as an exercise in graphing formulae.

While it is called "self-referential", Tupper did not name it as such.

The formula was published in his 2001 SIGGRAPH paper discussing methods related to the GrafE formula-graphing program Tupper developed.

Formula

The formula is an inequality defined as:

1 2 < m o d ( y 17 2 17 x m o d ( y , 17 ) , 2 )

or, as plaintext,

where ⌊ ⌋ denotes the floor function, and mod is the modulo operation.

Let k equal the following 543-digit integer:

If one graphs the set of points (xy) in 0 ≤ x < 106 and k ≤ y < k + 17 satisfying the inequality given above, the resulting graph looks like this (the axes in this plot have been reversed, otherwise the picture would be upside-down and mirrored):

The formula is a general-purpose method of decoding a bitmap stored in the constant k, and it could actually be used to draw any other image. When applied to the unbounded positive range 0 ≤ y, the formula tiles a vertical swath of the plane with a pattern that contains all possible 17-pixel-tall bitmaps. One horizontal slice of that infinite bitmap depicts the drawing formula itself, but this is not remarkable, since other slices depict all other possible formulae that might fit in a 17-pixel-tall bitmap. Tupper has furnished extended versions of his original formula that rule out all but one slice.

The constant k is a simple monochrome bitmap image of the formula treated as a binary number and multiplied by 17. If k is divided by 17, the least significant bit encodes the upper-right corner (k, 0); the 17 least significant bits encode the rightmost column of pixels; the next 17 least significant bits encode the 2nd-rightmost column, and so on.

A video explaining this formula can be found here

References

Tupper's self-referential formula Wikipedia