12 lines
24 KiB
JSON

{
"hash": "aa1e4b76ce6b05a54c89d9c108f20b48",
"result": {
"engine": "jupyter",
"markdown": "---\ntitle: \"Counting in 2D, Part 1: Lines, Leaves, and Sand\"\ndescription: |\n An introduction to two-dimensional counting using polynomials of two variables.\nformat:\n html:\n html-math-method: katex\ndate: \"2021-02-23\"\ndate-modified: \"2025-02-20\"\njupyter: python3\ncategories:\n - algebra\n - sandpile\n - python\nexecute:\n echo: false\n---\n\n<style>\n .cell-output-display .figure {\n text-align: center;\n }\n\n .figure-img {\n max-width: 512px;\n object-fit: contain;\n height: 100%;\n }\n</style>\n\n\n\nPreviously, I've written about positional systems and so-called \"[polynomial counting](../1)\".\nBasically, this generalizes familiar integer bases like two and ten into less familiar irrational ones\n like the golden ratio.\nHowever, all systems I presented have something in common: they all use polynomials of a single variable.\nDoes it make sense to count in two variables?\n\n\nPreliminaries\n-------------\n\nBefore proceeding, I'll summarize some desired characteristics of polynomials which can be\n used as carries in positional systems.\n\nCarry polynomials must be nonpositive when evaluated at 1 (otherwise the digital root of\n an expansion is unbounded).\nMoreover, to make things easier, either:\n\n- All coefficients have the same sign but one, which has a much larger\n magnitude than the rest (and forces the digital root condition)\n - These are *explicit* irrational carries\n- They are monic (have leading coefficient 1) and the remaining coefficients are all negative\n and monotonically increase toward 0 after the second coefficient (0's are allowed anywhere)\n - These are *implicit* irrational carries\n\nIn previous systems, it was discovered that implicit carries can be multiplied,\n typically by cylotomic polynomials, to obtain explicit rules for larger numerals.\n\n\nA Game of Che...ckers\n---------------------\n\n[Conway's checkers](https://en.wikipedia.org/wiki/Conway%27s_Soldiers) is a game played by attempting to\n advance game pieces to the furthest extent beyond a line.\nA piece can only be moved by jumping it horizontally or vertically over others, which removes them from play.\nSquinting hard enough, in one dimension, this is similar to how in phinary, a \"1\" in an\n expansion can jump over an adjacent \"1\" to its left.\n\n$$\n\\begin{array}{}\n \\bullet \\\\ \\hline \\bullet \\\\ \\hline \\vphantom{\\bullet}\n\\end{array} \\huge⤸ \\normalsize\n~\\longrightarrow~\n\\begin{array}{}\n \\vphantom{\\bullet} \\\\ \\hline \\vphantom{\\bullet} \\\\ \\hline \\bullet\n\\end{array}\n\\quad \\iff \\quad\n0\\textcolor{red}{11} = \\textcolor{red}{1}00\n$$\n\nIn fact, it is exactly the same.\nThe best solution of the game relies on a geometric series in *φ*, as seen in\n [this video by Numberphile](https://www.youtube.com/watch?v=Or0uWM9bT5w).\n\n\n### Pairs of Checkers\n\nTo actually take phinary and systems like it from 1D to 2D, we really just need a carry rule that respects the\n second dimension.\nTo do this, we use a new variable *y* and invent a carry rule based on it.\n\nThe smallest way to extend our one-dimensional string of digits is do just introduce a second string.\nBased on this, my intuition was to replace the standard hop with the movement of a knight in chess.\n\n$$\n\\begin{gather*}\n \\begin{array}{c|c}\n \\bullet & \\phantom{\\bullet} \\\\\n \\hline \\bullet \\\\ \\hline \\vphantom{\\bullet}\n \\end{array}\n ~\\longrightarrow~\n \\begin{array}{c|c}\n \\phantom{\\bullet} & \\phantom{\\bullet} \\\\\n \\hline \\\\ \\hline & \\bullet\n \\end{array}\n ~~ \\iff ~~\n \\left. \\begin{array}{}\n 0\\textcolor{red}{11}_x \\\\\n 000_y\n \\end{array} \\right]\n = \\left. \\begin{array}{}\n 000_x \\\\\n \\textcolor{red}{1}00_y\n \\end{array} \\right ] \\\\ \\\\\n y^2 = x + 1,~ x^2 = y + 1\n\\end{gather*}\n$$\n\nThis looks good on the surface, but it turns out that the polynomials aren't sufficiently intertwined.\nSince each variable is a function of the other, they can easily be coaxed into a single polynomial:\n\n$$\ny = x^2 - 1 \\longrightarrow y^2 = (x^2 - 1)^2 = x + 1 \\\\[6pt]\nx^4 - 2x^2 + 1 = x + 1 \\\\\nx^3 - 2x - 1 = 0 \\\\\n(x + 1)(x^2 - x - 1) = 0\n$$\n\nThe same argument applies symmetrically for *y*.\nOne of the resultant polynomials is the minimal polynomial of *φ*, so the prospective\n 2D system reduces back to standard phinary.\n\nThere are additional problems with this \"pairs of strings\" model.\nFor example, terms like *xy* never appear, and there is no way to represent them by just using two strings.\nAlso, both sequences have a ones' place, but should agree that $x^0 = y^0 = 1$.\n\n\nBuilding the Plane\n------------------\n\nIf it is the case that both powers of variables should share the one's digit, then why not\n join the two strings there?\nIn other words, for each variable, we think of a line with a distinguished point for zero.\nWe then match the distinguished points together.\nThus, instead of a point separator between positive and negative powers,\n the radix point is now a pair of lines that share a vertex.\nFrom this pair of lines, according to Euclid, we can make a plane.\n\n$$\n\\begin{array}{|c}\n \\hline\n f & d & a \\\\\n e & b \\\\\n c\n\\end{array}\n\\begin{matrix} ~\\equiv~\n ax^2 + bxy + cy^2 + dx + ey + f, \\\\\n \\text{the general form of a conic}\n\\end{matrix}\n$$\n\nSince the horizontal and vertical correspond with the *x* and *y* appearing in polynomials,\n it may be easy to confuse this with the *x*- and *y*-axes of the typical Cartesian plane.\nThe key differences here are that these are discrete (two-dimensional) strings, rather than a continuous plane,\n and along each point, there exists a cell in which an integer value lives.\n\n\n### An Arithmetical Aside\n\nExpressed in this way, it is very simple to compute the sum of two polynomials.\nJust like in the 1D system, we can align the one's places, add them together term-by-term, then apply carry rules.\nWith luck, this produces a canonical form.\n\nIt should also be possible to multiply two polynomials together.\nIn a single variable, multiplication is a somewhat involved 1D convolution.\nIn two, it is naturally [2D convolution](https://en.wikipedia.org/wiki/Kernel_(image_processing)),\n an operation typically encountered in image processing and signal analysis.\nI won't bother building up an intuition for this, since it won't be relevant to discussion.\n\nEven if multiplication is difficult, division is always harder.\nIn polynomials of a single variable, we can do synthetic (or long) division.\nNotationally, we work in the direction that the digits do not extend (i.e., downward).\nWith 2D numbers, we have digits in both dimensions.\nFortunately, computer algebra systems can divide and factor polynomials of two variables\n reasonably quickly, so this point is moot if we allow ourselves to use one.\n\n\n1, 2, 3, Takeoff\n----------------\n\nWhere should we start in a world of planar numbers?\nWell, we want to assign an integer to a polynomial with extent in both *x* and *y*.\nThe simplest way to do this is by letting $n = x + y$: when the one's place has\n a magnitude of *n*, it flows into *x* and *y*.\n\nIf $n = 1$, then the sum of coefficients is skewed toward the LHS, and the digital root is unbounded.\nWe had a similar restriction in one dimension.\nTherefore, let $n = 2$.\nThe expansions of the powers of 2 are:\n\n$$\n\\begin{matrix}\n &&\\text{Carry:}&\\begin{array}{|c} \\hline\n -2 & 1 \\\\\n 1\n \\end{array}\\\\\n 1 & 2 & ... & 4 & ... & 8 \\\\\n \\begin{array}{|c} \\hline\n 1\n \\end{array} &\n \\begin{array}{|c} \\hline\n 0 & 1 \\\\\n 1\n \\end{array} & ... &\n \\begin{array}{|c} \\hline\n 0 & 2 \\\\\n 2\n \\end{array} & ... &\n \\begin{array}{|c} \\hline\n 0 & 4 \\\\\n 4\n \\end{array} \\\\ \\\\ &&&\n \\begin{array}{|c} \\hline\n 0 & 0 & 1 \\\\\n 0 & 0 & 1 \\\\\n 1 & 1\n \\end{array} & ... &\n \\begin{array}{|c} \\hline\n 0 & 0 & 2 \\\\\n 0 & 0 & 2 \\\\\n 2 & 2\n \\end{array} \\\\ \\\\ &&&&&\n \\begin{array}{|c} \\hline\n 0 & 0 & 0 & 1 \\\\\n 0 & 0 & 1 & 1 \\\\\n 0 & 1 & 0 & 1 \\\\\n 1 & 1 & 1\n \\end{array}\n\\end{matrix}\n$$\n\nThe final entry of each column is achieved by applying the carry enough times, reducing all digits\n to \"0\"s and \"1\"s.\nIn doing so, the typical binary expansion is visible along first row and column, albeit reversed.\nThis is always the case, since when the carry is restricted to a single dimension (i.e., let $y = 0$),\n we get the 1D binary carry.\nMore visually, there is no mechanism for the carry to disturb the column and row by spreading either left or up.\nI'll call this system *dibinary*, since it is binary across two variables.\n\nAn additional property of this system is that the number of \"1\"s that appear in the expansion is equal\n to the number itself.\nThese two properties make it a sort of hybrid between unary and binary, bridging their\n binary expansion and its [Hamming weight](https://en.wikipedia.org/wiki/Hamming_weight).\n\nThis notation is very heavy, but fortunately lends itself well to visualization.\nEach integer's expansion is more or less an image, so we can arrange each as frames in a video:\n\n\n\n:::: {.row .text-center }\n::: {.column width=\"60%\"}\n{{< video ./count_xy2.mp4 >}}\n:::\n::::\n\nStarting at the expansion of twelve, the terms extend past the first column and row.\nIt instead grows faster along the diagonal, along which larger triangles appear when\n counting to higher and higher integers.\nMeanwhile, lower degrees (toward the upper left) appear to be slightly less predictable.\n\n\n### Higher *n*\n\nBy incrementing *n*, the expansions of numbers shrink exponentially, and simply incrementing is not fast enough.\nFortunately, this is a simple enough system that we can scalar-multiply base expansions, then assiduously apply the carry.\nAscending the powers of *n* in this manner for the carries where *n* = 3 and 4:\n\n\n\n:::: {.row layout-ncol=\"2\"}\n::: {}\n{{< video ./count_xy3.mp4 >}}\n\n$$x + y = 3$$\n:::\n\n::: {}\n{{< video ./count_xy4.mp4 >}}\n\n$$x + y = 4$$\n:::\n::::\n\nYellow corresponds to the highest allowed numeral, $n - 1$.\nIt seems like the lower-right grows much rounder as *n* increases.\nHowever, neither appears to have an emergent pattern as dibinary did.\n\nYou might be familiar with the way hexadecimal is a more compact version of binary.\nFor example,\n\n$$\\textcolor{red}{1}\\textcolor{blue}{2}_{16} = \\textcolor{red}{0001}\\textcolor{blue}{0010}_{2}$$\n\nbecause both one hexadecimal digit and four binary digits range over zero to fifteen.\nConsequently, by grouping group *m* digits of an expansion in base *b*, one can easily convert to base $b^m$.\n\nIf such a procedure still exists in 2D, applying it somehow destroys the pattern in the $n = 2$ case,\n as the quaternary system is very chaotic.\n\n\nCarry Curves\n------------\n\nSince the carry is a polynomial in both *x* and *y*, it lends itself to interpretation as an algebraic curve.\nTaking *x* or *y* to higher powers will dilate expansions along that axis.\n\nThe carry is not the only curve which exists in a system, as each integer is also a polynomial unto itself.\nAdding a constant term will not change anything unless it causes carries to occur.\nStarting at the carry digit, some of the *incremented curves* made by the carry $x + y = 2$ are shown below.\n\n::: {#d66886e3 .cell layout='[[3,3],[2,2,2]]' execution_count=5}\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-5-output-1.png){width=662 height=470}\n:::\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-5-output-2.png){width=662 height=470}\n:::\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-5-output-3.png){width=662 height=470}\n:::\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-5-output-4.png){width=662 height=470}\n:::\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-5-output-5.png){width=662 height=470}\n:::\n:::\n\n\nIn each of these figures, the line is the curve which corresponds to the carry polynomial.\nAlong with it, while counting, additional shapes like hyperbolae seem to appear and disappear,\n only to be replaced with higher-order curves.\nThese higher order curves can be difficult to graph, so they show up as thicker lines.\nAt sixty-four, it appears as though the reflection of the carry across the origin\n (the curve $x + y = -2$) \"wants\" to appear.\n\nThe continued presence of the original carry curve in larger integers suggests that\n the points it passes through are important.\nThis curve happens to intersect with the *x* and *y* axes, which we can interpret as the \"base\"\n with respect to a single variable.\nFor dibinary, these are the aforementioned \"typical binary expansions\".\nWe can also evaluate the polynomial at $(x, y) = (1, 1)$, a point on the carry curve,\n to compute its digital root, which is also equal to the integer it represents.\nThis underlies a key difference from the 1D case.\n1D systems are special because the carry can be equated with a base (or bases), which\n is a discrete, zero-dimensional point (one dimension less) on a number line.\nIn higher dimensions, all points on the carry curve (or hypersurface) are \"bases\" we can plug in\n to test that an expansion is valid.\nThis makes naming much harder, since there are no preferred numbers to represent the system,\n like the golden ratio does with phinary.\n\n\nCasting the Line\n----------------\n\nWe may want to extend the \"unary\" property to other carries.\nTo do this, we construct a curve which passes through $(1, 1)$.\n\nLines of the form $(n - 1)x + y = n$ trivially satisfy this relationship.\nFurther, while the digits along the *y* column will be expansions of base *n*, those along *x* will\n be in base $n / (n - 1)$.\n\nFor example, for $n = 3$\n\n$$\n\\begin{matrix}\n &&&\\text{Carry:}&\n \\begin{array}{|c} \\hline\n -3 & 2 \\\\\n 1\n \\end{array}\\\\\n 1 & ... & 3 & ... & 6 & ... & 9 \\\\\n \\begin{array}{|c} \\hline\n 1\n \\end{array} & ... &\n \\begin{array}{|c} \\hline\n 0 & 2 \\\\\n 1\n \\end{array} & ... &\n \\begin{array}{|c} \\hline\n 0 & 4 \\\\\n 2\n \\end{array} & ... &\n \\begin{array}{|c} \\hline\n 0 & 6 \\\\\n 3\n \\end{array} \\\\ \\\\ &&&&\n \\begin{array}{|c} \\hline\n 0 & 1 & 2 \\\\\n 2 & 1\n \\end{array} & ... &\n \\begin{array}{|c} \\hline\n 0 & 3 & 2 \\\\\n 3 & 1\n \\end{array} \\\\ \\\\ &&&&&&\n \\begin{array}{|c} \\hline\n 0 & 0 & 1 & 2 \\\\\n 0 & 1 & 0 & 2 \\\\\n 1 & 1 & 1\n \\end{array}\n\\end{matrix}\n$$\n\nThe expansion in the *y* column looks trivially correct, since $y^2 = 9$ when $x = 0$.\nWe can check the base of the expansion of nine (\"2100\") by factoring a polynomial:\n\n::: {#0aef62ff .cell execution_count=6}\n\n::: {.cell-output .cell-output-display .cell-output-markdown}\n$\\displaystyle 2 x^{3} + x^{2} - 9 = \\left(2 x - 3\\right) \\left(x^{2} + 2 x + 3\\right)$\n:::\n:::\n\n\nThe linear polynomial has 3/2 as a root, while the quadratic one has only complex roots.\n\nNaturally, these expansions work symmetrically by considering *y* to have the $n - 1$ coefficient instead of *x*.\nThis transposes the carry (and hence the expansion).\n\n\n### Slanted Counting\n\nFor good measure, let's see what it looks like when we count in the $n = 3$ and $n = 4$ cases.\n\n\n\n:::: {.row layout-ncol=\"2\"}\n::: {}\n{{< video ./count_x2y3.mp4 >}}\n\n$$2x + y = 3$$\n:::\n\n::: {}\n{{< video ./count_x3y4.mp4 >}}\n\n$$3x + y = 4$$\n:::\n::::\n\nThe pattern produced is similar to the one from dibinary.\nHowever, the triangular pattern no longer grows all at once, and instead, the bottom leads the top.\nMeanwhile, the disordered part in the upper left of the expansion appears to grow larger as *n* increases,\n not to mention that it contains many artifacts from smaller colors.\n\nThe slope of the pattern is $1 / (n - 1)$, since this is the ratio of growth between *x* and *y*.\nAs *n* grows, the diagonal pattern gets thinner and takes longer to show up.\nThis is because the size of the alphabet causing expansions to shrink *geometrically*, while the digital\n root is always increasing *arithmetically*.\nThe binary alphabet is the smallest possible, so the minimal shrinkage is in dibinary.\n\n\n### Incremented Curves\n\nBelow are some incremented curves for $n = 3$.\nThese curves show an interesting phenomenon: an extra line is present in in the expansion of six.\nThis line turns into a spike at twelve, then at fifteen, it seems to grow to encompass the point at infinity.\n\n::: {#7233ad25 .cell layout-ncol='2' execution_count=8}\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-8-output-1.png){width=662 height=470}\n:::\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-8-output-2.png){width=662 height=470}\n:::\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-8-output-3.png){width=662 height=470}\n:::\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-8-output-4.png){width=662 height=470}\n:::\n:::\n\n\nLeaves in the Mirror\n--------------------\n\nAlgebraic curves are not my forte.\nStill, we can very briefly look at some classical examples from the perspective of carries.\n\n\n### Quadratic Curves\n\nUnfortunately, the most common quadratic curves are largely uninteresting.\nBriefly, here are some comments about some the simplest cases:\n\n- Unit circle ($x^2 + y^2 - 1 = 0$) and hyperbola ($\\pm x^2 \\mp y^2 - 1 = 0$)\n - The sum of coefficients is positive, which means that expansions are unbounded.\n - Alternatively, coefficients are of an improper form, since one positive coefficient\n does not outweigh all remaining negative coefficients.\n - The curve as a function in *x* and *y* can be written in simpler terms, i.e., $F(x, y) = G(x^2, y^2)$\n- Hyperbola ($xy \\pm 1 = 0$)\n - The curve is a function of only *xy*, i.e., $F(x, y) = P(xy)$,\n so the curve degenerates to one-dimensional unary.\n- Parabolae ($y = \\pm x^2,~ x = \\pm y^2$)\n - One coefficient does not outweigh the other.\n - The system degenerates to a single dimeension due to the fact that either *y* is a polynomial in *x* or vice versa\n\nOther polynomials in *x* and *y* may produce rotations or dilations of these curves,\n but the key fact is that this interpretation is secondary.\nWhat truly matters is that one cell affects relatively close cells in a certain way.\n\n\n### Higher-Order Curves\n\nAll unit Fermat curves $x^n + y^n = 1$ are not suitable as carries, since their digital root is unbounded.\nScaling up the curve, for example to $x^n + y^n = 2$, will just degenerate back to the previous\n examples with lines, but spaced out by zeros between entries.\n\nThe [folium of Descartes](https://en.wikipedia.org/wiki/Folium_of_Descartes) is another\n classical curve that played a role in the development of calculus, described by the equation:\n\n$$\n\\begin{gather*}\n x^3 + y^3 - 3axy = 0\n \\\\ \\\\\n \\begin{array}{|c} \\hline\n 0 & 0 & 0 & 1 \\\\\n 0 & -3a \\\\\n 0 & \\\\\n 1\n \\end{array}\n\\end{gather*}\n$$\n\nAs written above, the position of the 3*a* term may be confusing.\nAs the negative term in an explicit carry, we must place it atop the digit we are carrying,\n meaning that expansions will propagate toward negative powers of *x* and *y* as well as positive.\nWhile the shape of the curve is different from an ordinary line, the coefficients are arranged\n too similarly; for $a = 2/3$ (so the curve passes through the point $(1, 1)$) incrementing appears as:\n\n:::: {.row layout-ncol=\"2\"}\n\n::: {#a034e9c1 .cell execution_count=9}\n\n::: {.cell-output .cell-output-display .cell-output-markdown}\n\\begin{gather*}2: &\\begin{array}{c|cc}0 & 0 & 0 & 1 \\\\ \\hline 0 & 0 & 0 & 0 \\\\ 0 & 0 & 0 & 0 \\\\ 1 & 0 & 0 & 0 \\\\ \\end{array}\\\\\\\\ \\\\ 4: &\\begin{array}{cc|cccc}0 & 0 & 0 & 0 & 0 & 0 & 1 \\\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\ \\hline 0 & 0 & 0 & 0 & 0 & 1 & 0 \\\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 \\\\ 1 & 0 & 0 & 0 & 0 & 0 & 0 \\\\ \\end{array}\\\\\\end{gather*}\n:::\n:::\n\n\n{{< video ./count_folium.mp4 >}}\n::::\n\nClearly, this also tends back toward dibinary, but with the yellow digits spaced out more.\n\n\nLaplace's Sandstorm\n-------------------\n\nAs stated previously, polynomials naturally multiply by convolution.\nIn the context of this operation, the discrete 2D Laplacian is frequently used\nWhile commonly presented as a matrix, it has very little to do with the machinery of\n linear algebra which normally empowers matrices.\n\n::: {layout-ncol=\"2\"}\n$$\n\\begin{gather*}\n \\begin{bmatrix}\n 0 & 1 & 0 \\\\\n 1 & -4 & 1 \\\\\n 0 & 1 & 0\n \\end{bmatrix} ~\\implies~\n \\begin{array}{c|cc}\n & 1 & \\\\ \\hline\n 1 & -4 & 1 \\\\\n & 1\n \\end{array} \\\\ \\\\\n x + x^{-1} + y + y^{-1} - 4 = 0 \\\\\n x + xy^2 + y + yx^2 - 4xy = 0\n\\end{gather*}\n$$\n\n::: {#f66b7676 .cell execution_count=10}\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-10-output-1.png){width=662 height=469}\n:::\n:::\n\n\n:::\n\nFrom the above, it is clear that this is a cubic curve.\nAside from the trivial solution $x = y = 0$ (which obviously also satisfies *x* = *y*),\n the curve made by the carry does not intersect either axis.\nThere is an additional isolated point at (1, 1), implying some is in unary-ness this system.\nIf we make it a carry, then the first few powers of 4 are\n\n$$\n\\begin{matrix}\n 1 & ... & 4 & ... & 16 \\\\\n \\begin{array}{|c} \\hline\n 1\n \\end{array} & ... &\n \\begin{array}{c|cc}\n 0 & 1 & 0 \\\\ \\hline\n 1 & 0 & 1 \\\\\n 0 & 1 &\n \\end{array} & ... &\n \\begin{array}{c|cc}\n 0 & 4 & 0 \\\\ \\hline\n 4 & 0 & 4 \\\\\n 0 & 4 &\n \\end{array} \\\\ \\\\ &&&&\n \\begin{array}{cc|cc}\n & & 1 \\\\\n & 2 & 0 & 2 \\\\ \\hline\n 1 & 0 & 4 & 0 & 1 \\\\\n & 2 & 0 & 2 \\\\\n & & 1\n \\end{array} \\\\ \\\\ &&&&\n \\begin{array}{cc|cc}\n & & 1 \\\\\n & 2 & 1 & 2 \\\\ \\hline\n 1 & 1 & 0 & 1 & 1 \\\\\n & 2 & 1 & 2 \\\\\n & & 1\n \\end{array}\n\\end{matrix}\n$$\n\nAs the negative (and largest) term, we carry at the \"4\" entry, as shown above.\nTerms progress along lower and higher powers of *x* and *y*.\nHowever, rather than just rightward propagation interfering with downward propagation (and vice versa),\n all directions can interfere with each other.\n\nThis system can be interpreted more naturally as a\n [sandpile](https://en.wikipedia.org/wiki/Abelian_sandpile_model).\nAs a cellular automaton, it is rather popular as a coding challenge\n ([video by The Coding Train](https://www.youtube.com/watch?v=diGjw5tghYU)),\n and when the grid is finite, certain subsets of all possible elements form finite groups under addition\n ([video by Numberphile](https://www.youtube.com/watch?v=1MtEUErz7Gg)).\nThese videos discuss toppling the initial value, but do not point out the analogy to polynomial expansions.\n\n\n\n:::: {.row .text-center }\n::: {.column width=\"60%\"}\n{{< video ./count_laplace.mp4 >}}\n:::\n::::\n\nThe shapes produced by this pattern are well-known, with larger numbers appearing as fractals.\nGenerally, the expansions are enclosed within a circle, with shrinking triangular looking sections.\nThis is eerily similar to the same shrinking triangles which appear in other unary-like carries.\n\n\nClosing\n-------\n\nAll of the 2D carries presented here are explicit carries.\nUnlike phinary, they have no additional rules hidden in mutliples of the carry.\nIt seems to be the case that implicit carries in two variables can be found by\n selecting a cyclotomic polynomial (in *x*, *y*, and $x + y$)\n and computing an explicit carry by multiplying it with another polynomial.\nSome of my investigations into this topic are available [here](../cell2).\n\nI should also mention that my notational inspiration for arranging digits things in\n a 2D array is Norman Wildberger's variable-free approach to\n \"[bipolynumbers](https://www.youtube.com/watch?v=_9FvrO1JTTI)\", a term he uses\n to refer to polynomials of two variables.\n\nJust as learning to count on polynomials in a single variable opens up a world of possibilities,\n learning to count on those in two variables is a perplexing topic that is worth exploring.\n\n",
"supporting": [
"index_files"
],
"filters": [],
"includes": {}
}
}