Tupper's self-referential formula: Difference between revisions

Content deleted Content added
Removed hardcoded wrapping of k so that it wraps properly on different screen sizesUndid revision 1191503740 by Artemetra (talk)
 
(7 intermediate revisions by 7 users not shown)
Line 14:
 
<math display=block>\frac{1}{2} < \left\lfloor \mathrm{mod}\left(\left\lfloor \frac{y}{17} \right\rfloor 2^{-17 \lfloor x \rfloor - \mathrm{mod}\left(\lfloor y\rfloor, 17\right)},2\right)\right\rfloor</math>
where <math>\lfloor \dots \rfloor</math> denotes the [[Floor and ceiling functions|floor function]], and mod is the [[modulo operation]].
or, in plaintext:
:{{code|1/2 < floor(mod(floor(y/17)*2^(-17*floor(x)-mod(floor(y),17)),2))}}
 
where <math>\lfloor \rfloor</math> denotes the [[Floor and ceiling functions|floor function]], and mod is the [[modulo operation]].
 
== Plots ==
Line 26 ⟶ 23:
[[File:Tupper_formula_constant_derivation.svg|thumb|91px<!-- 91px gives acceptable text rendering with least overshoot or ugly gaps -->|Derivation of ''k'']]
 
[[Graph of a function|Graphing]] the set of points <math>(x, y)</math> in <math>0 \le x < 106</math> and <math>k \le y < k + 17</math> which satisfy the formula, results in the following plot:{{NoteTag|1=The axes in this plot have been reversed, otherwise the picture would be upside-down and mirrored.}}
 
[[File:Tupper's self referential formula plot.svg]]
 
The formula is a general-purpose method of decoding a bitmap stored in the constant <math>k</math>, and it could actually be used to draw any other image. When applied to the unbounded positive range <math>0 \le y</math>, 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 created extended versions of his original formula that rule out all but one slice.<ref>{{Cite web |url=http://www.peda.com/selfplot/ |website=Pedagoguery Software |title=Selfplot directory |access-date=2022-01-15}}</ref>
 
The constant <math>k</math> is a simple [[1-bit color|monochrome]] [[bitmap|bitmap image]] of the formula treated as a binary number and multiplied by 17. If <math>k</math> is divided by 17, the [[least significant bit]] encodes the upper-right corner <math>(k, 0)</math>; 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.
 
It fundamentally describes a way to plot points on a two-dimensional surface. The value of <math>k</math> is the number whose binary numberdigits that formsform the plot in base 10. The following plot demonstrates the addition of different values of <math>k</math>. In the fourth subplot, the k-value of "AFGP" and "Aesthetic Function Graph" areis added to get the resultant graph, where both the texts can be seen with some distortion, due to the effects of binary addition. The information regarding the shape of the plot is stored within <math>k</math>.<ref>{{cite web |title=Tupper's-Function |date=2019-06-13 |url=https://github.com/AEFGP/Tupper-s-Function |publisher=Aesthetic Function Graphposting |access-date=2019-07-07 |website=Github}}</ref>
 
[[File:Tuppers-formula-test.png|center|thumb|Addition of different values of k]]
Line 62 ⟶ 59:
 
== External links ==
* {{official|http://www.dgp.toronto.edu/~mooncake/|Jeff Tupper's official website}}
* [http://www.peda.com/selfplot/ Extensions of Tupper's original self-referential formula]
* [https://rosettacode.org/wiki/Tupper%27s_self-referential_formula Tupper's self-referential formula in Rosetta Code], implementation in several programming languages
* [https://amcrae.github.io/TupperPlot/TupperPlot.html TupperPlot], an implementation in JavaScript
* [https://web.archive.org/web/20130319093833/http://www.pypedia.com/index.php/Tupper_self_referential_formula Tupper self referential formula], an implementation in Python