Tupper-Sketch


There is a inequality that was first defined by Jeff Tupper that when is graphed in a two-dimensional plane at a specific offset it can be instructed to plot itself. This page attempts to describe it a little bit as well as give some implementation details.

As said previously Jeff Tupper, presented in SIGGRAPH, $2001$ a paper that described a special formula that is able, given a proper offset in the $y$-axis, to replicate itself when graphed in a two-dimensional plane. The formula that was presented follows.


Let $k \geq 0$ be an arbitrary offset and also let $x \in 0 \leq x < 107$ and $y \in k \leq y < k + 17$ be the valid number ranges. For every $x$, $y$ combination inside the valid ranges plot the points on the two-dimensional plane generated by $x$, $y$ that satisfy the following inequality:


$$\frac{1}{2} < \left\lfloor \mathrm{mod}\left( \left\lfloor {y \over 17} \right\rfloor 2^{-17\lfloor x \rfloor - \mathrm{mod} (\lfloor y \rfloor, 17) }, 2\right)\right\rfloor$$

This formula itself is essentially a way to decode a monochrome bitmap image that is stored in the offset $k$ value. If the $k$ value is divided by $17$ then the least-significant-bit of the number encodes the bottom-left corner which is point $(k, 0)$; that's correct if we assume the plane is $(y,x)$, obviously should the plane be defined as $(x,y)$ then the encoded point becomes $(0, k)$.


Finally, for reference, the $k$ offset value (a $543$-digit big-integer) that is required to plot the formula is the following:

960 939 379 918 958 884 971 672 962 127 852 754 715 004 339 660 129 306 651 505 519 271 702 802 395 266 424 689 642 842 174 350 718 121 267 153 782 770 623 355 993 237 280 874 144 307 891 325 963 941 337 723 487 857 735 749 823 926 629 715 517 173 716 995 165 232 890 538 221 612 403 238 855 866 184 013 235 585 136 048 828 693 337 902 491 454 229 288 667 081 096 184 496 091 705 183 454 067 827 731 551 705 405 381 627 380 967 602 565 625 016 981 482 083 418 783 163 849 115 590 225 610 003 652 351 370 343 874 461 848 378 737 238 198 224 849 863 465 033 159 410 054 974 700 593 138 339 226 497 249 461 751 545 728 366 702 369 745 461 014 655 997 933 798 537 483 143 786 841 806 593 422 227 898 388 722 980 000 748 404 719

Formula alterations


Let's start by the formula itself, the floors are used in the case that we draw in an arbitrary DPI settings, which basically means that we have higher resolution than just natural numbers. In this version we are only creating the formula inside the $(k+16, 107)$ box that contains natural numbers hence they are not needed in the actual calculations that we perform in this version and are displayed for completeness.

Big-Integer library hurdles


Additionally problems where encountered during the creation of this as none of the big-integer libraries that I tried supported negative exponentiation and all gave me hell. This happened because they did not explicitly mention anywhere that this particular functionality was not supported... so I implemented the formula in a straightforward way assuming that it was... after lot's of debugging hours I finally figured that it was not supported and changed the negative exponentiation portion into its equivalent right binary shift (this was used in other implementations as well!).