12 lines
29 KiB
JSON
12 lines
29 KiB
JSON
{
|
|
"hash": "e6b66233e4bd8354553fa53b3612202a",
|
|
"result": {
|
|
"engine": "jupyter",
|
|
"markdown": "---\ntitle: \"Polynomial Counting 4: Two 2's\"\nformat:\n html:\n html-math-method: katex\ndate: \"2021-02-09\"\ndate-modified: \"2025-02-12\"\njupyter: python3\ncategories:\n - algebra\n - python\n---\n\n<style>\n .cell-output-display .figure {\n text-align: center;\n }\n\n /* #long-trunc-figures .figure-img { */\n .figure-img {\n max-width: 512px;\n object-fit: contain;\n height: 100%;\n }\n</style>\n\n\nThis post assumes you have read [the first](../1), which introduces generalized polynomial counting,\n and [the second](../2), which restricts the focus and specifies the general aim.\n\n\nExtra Metals\n------------\n\nAs previously shown, the golden ratio (recurrence $\\langle 1, 1|$) can be generalized in several ways.\nThe silver ratio was introduced as the next \"metallic mean\",\n a sequence of quadratic roots of the form $\\langle n, 1|$,\n and the limiting ratios of the corresponding recurrences.\n\nThe metallic ratios have simple [*continued fraction*](https://en.wikipedia.org/wiki/Continued_fraction) expansions:\n\n$$\n\\begin{gather*}\n \\langle n, 1| ~~\\iff~~ x^2 - nx - 1 \\\\\n x^2 = nx + 1 ~~\\implies~~\n x = n + \\frac{1}{x} \\\\\n x = n + \\cfrac{1}\n {n + \\cfrac{1}\n {n + \\cfrac{1}\n {n + \\cfrac{1}{\\ddots}}\n }\n }\n = [n; \\underline{n}]\n\\end{gather*}\n$$\n\nAgain, the underline denotes repetition, since the overbar has been used for negation.\n\nParametrizing the carry in both terms (recurrence $\\langle n, n|$) demonstrates a strange duality\n with the above continued fraction:\n\n$$\n\\begin{gather*}\n \\langle n, n| ~~\\iff~~ x^2 - nx - n \\\\\n x^2 = nx + n ~~\\implies~~\n x = n + \\frac{n}{x} \\\\\n x = n + \\cfrac{n}{n + \\cfrac{n}{n + \\cfrac{n}{n + \\cfrac{n}{\\ddots}}}} =\n n + \\cfrac{\\textcolor{red}{\\cancel{n}}}\n {\\textcolor{red}{\\cancel{n}} + \\cfrac{\\textcolor{red}{\\cancel{n}}}\n {n + \\cfrac{\\textcolor{blue}{\\cancel{n}}}\n {\\textcolor{blue}{\\cancel{n}} + \\cfrac{\\textcolor{blue}{\\cancel{n}}}{\\ddots}}\n }\n } \\\\\n x = n + \\cfrac{1}\n {1 + \\cfrac{1}\n {n + \\cfrac{1}\n {1 + \\cfrac{1}{\\ddots}}\n }\n }\n = [n; \\underline{1, n}]\n\\end{gather*}\n$$\n\nIn other words, the root of $\\langle n, 1|$ has continued fraction n repeating,\n and the root of $\\langle n, n|$ has continued fraction $n, 1$ repeating.\n\n\n### Gray Silver\n\nThe golden ratio belongs to both series.\nAfter it, the next term in in the non-metallic series is the recurrence $\\langle 2, 2 |$.\nIt produces the series $0, 1, 2, 6, 16\\dots$ ([OEIS A002605](http://oeis.org/A002605)),\n and the limiting ratio of its successive terms is $1 + \\sqrt 3 \\approx 2.7321\\dots$.\nThis value and the polynomial coefficients are bounded above by 3, so it stands to reason that\n a ternary alphabet is suitable.\nThe trick for expanding 3 works as before:\n\n$$\n\\textcolor{red}{3}00 = 2\\textcolor{red}{22}\n= \\textcolor{blue}{22}2 = \\textcolor{blue}{1}002\n$$\n\n:::: {.row .text-center}\n::: {#canonical-cendree-table .column width=\"60%\"}\n\n| *n* <br> (Decimal) | *n* <br> (Unnamed Ratio) | *n* <br> (Unnamed Sequence) |\n|:------------------:|:------------------------:|:---------------------------:|\n| 0 | 0 | 0 |\n| 1 | 1 | 1 |\n| 2 | 2 | 10 |\n| 3 | 10.02 | 11 |\n| 4 | 11.02 | 20 |\n| 5 | 12.02 | 21 |\n| 6 | 20.1102 | 100 |\n| 7 | 21.1102 | 101 |\n| 8 | 100.1102 | 110 |\n| 9 | 101.1102 | 111 |\n| 10 | 102.1102 | 120 |\n\n:::\n::::\n\nAs an homage to heraldry terminology, I choose to call this system cendrée,\n and the root of the polynomial the ashen ratio (abbreviated *κ*).\nGold and silver (\"or\" and \"argent\") are \"metals\"; cendrée is a non-standard color\n referring to an ashen gray, which reflects its relationship to the metallic means.\n\n\nAsh on the Fulcrum\n------------------\n\nJust like the silver ratio base, we can try expressing these using a balanced alphabet\n {-1, 0, 1} instead of the standard one {0, 1, 2}.\nThere, we had the choice of forbidding either the string \"11\" or \"10\", because when the carry\n was applied to either, the negative of the other would appear.\nJust like then, we must choose whether to forbid \"11\" or \"TT\" (its negative), since carrying\n at one produces the other.\n\n$$\n0\\textcolor{red}{11} = \\textcolor{red}{1}\\bar{1}\\bar{1}\n$$\n\nI choose to permit \"11\" since both terms of the carry are positive.\n\n\n### Intractible Repetition\n\nOur first target for conversion into a balanced form is \"2\".\n\n$$\n\\textcolor{red}{2.0}_{\\kappa}\n = \\textcolor{red}{1}0.\\textcolor{blue}{\\bar{2}0}_{\\kappa}\n = 1\\textcolor{blue}{\\bar{1}}.0\\textcolor{orange}{20}_{\\kappa}\n = 1\\bar{1}.\\textcolor{orange}{1}0\\bar{2} _{\\kappa}\n = \\dots\n = 1\\bar{1}.\\underline{1\\bar{1}}_{\\kappa}\n$$\n\nBy iteratively applying the carry, we get a repeating balanced expansion.\nInstead of this, we could derive an expansion by decrementing the expansion of three\n\n$$\n2 = 3 - 1 = 10.02_{\\kappa} + \\bar{1}\n= 1\\bar{1}.0\\textcolor{green}{2}_{\\kappa}\n= 1\\bar{1}.1\\bar{1}0\\textcolor{green}{2}_{\\kappa}\n= \\dots\n= 1\\bar{1}.\\underline{1\\bar{1}}_{\\kappa}\n$$\n\nfor which we get the same expansion after recursing on the symbol \"2\".\n\nBoth of the above derivations involve an infinite number of steps, so there might still be some nagging suspicion\n that the methods used are invalid.\nTo put it on firm(er) ground, we can derive the carry polynomial directly from this series (and vice versa)\n using a geometric series argument:\n\n::: {#geometric-series-2}\n$$\n\\begin{gather*}\n 1.\\underline{\\vphantom{\\bar{1}}1}_x\n = 1 + x^{-1} + x^{-2} + x^{-3} + \\dots\n = \\frac{1}{1 - (1/x)}\n = \\frac{x}{x - 1}\n \\\\\n 1.\\underline{\\bar{1}1}_x\n = 1 -\\ x^{-1} + x^{-2} -\\ x^{-3} + \\dots\n = \\frac{1}{1 + (1/x)}\n = \\frac{x}{x + 1}\n \\\\\n 2 = 1\\bar{1}.\\underline{1\\bar{1}}_x\n = \\frac{x^2}{x + 1}\n \\\\\n x^2 = 2x + 2 \\iff \\langle 2, 2 |\n\\end{gather*}\n$$\n:::\n\nWe assume both series converge, since $\\kappa > 1$.\n\nRecall that in decimal, repeating expansions usually signify rational numbers, like $0.\\underline{3}_{10} = 1/3$.\nSimilarly, we can interpret \"$1\\bar{1}.\\underline{1\\bar{1}}$\" as a base three expansion by evaluating\n $x^2 / ( x + 1 )$ at three, getting $1\\bar{1}.\\underline{1\\bar{1}}_3 = 9/4 = 2.25_{10}$.\nNormally, the rule is that when the denominator of a rational number and base are coprime\n (in the first example, three and ten; in the second, four and three), its expansion repeats.\nBut two in the irrational base *κ* breaks that rule in a balanced alphabet.\n\n\n### Mixing Ashes\n\nNaively, we can convert each entry of the earlier table to a balanced form by replacing \"2\"s with\n (shifts of) the repeating expansion.\nBut notice that each listed fractional expansion above three appears to end in \"2\".\nIn contrast, the [silver ratio expansions](../2#canonical-silver-table) ended in both \"1\" and \"2\".\n\nWhile this isn't a problem with the fractional base on its own, it complicates things\n when considering the balanced alphabet.\nIn fact, it seems to be the case that *all* base *κ* expansions of integers above three terminate in \"2\",\n but I won't bother proving it (see note for a sketch[^1]).\n\nInstead of converting directly, we can also just try counting from zero again, remembering the aforementioned\n trick for converting \"2\", but we may get problems when \"2\" appears multiple times in the expansion.\nAlternatively, by applying a finite version of the rule, we can move \"2\" further and further to the right.\n\n\n:::: {.row .text-center}\n::: {#canonical-balanced-cendree-table .column width=\"100%\"}\n\n<style>\n#canonical-balanced-cendree-table td > em\n{\n color: red !important;\n font-style: normal !important;\n}\n</style>\n\n| *n* <br> (Decimal) | *n* <br> (Mixed Cendrée) | *n* <br> (Balanced Cendrée) | Remark |\n|-------------------:|:------------------------:|:---------------------------:|:------------------------------------------|\n| 0 | 0 | 0 | |\n| 1 | 1 | 1 | |\n| *2* | *2* | *1T. 1T...* | |\n| 2 | 1T.02 | 1T. 1T... | Example of pushing \"2\" to the right |\n| 3 | 10.02 | 10. 1T... | |\n| 4 | 11.02 | 11. 1T... | |\n| *5* | *12.02* | *11. 1T...* | |\n| 5 | 1T0.02 | 1T0. 1T... | Carry \"012\" to \"1T0\" |\n| 6 | 1T1.02 | 1T1. 1T... | |\n| *7* | *1T2.02* | *1T2. 1T...* | |\n| 7 | 10T.1102 | 10T.11 1T... | Push \"02000\" to \"1T1T02\" |\n| 8 | 100.1102 | 100.11 1T... | |\n| 9 | 101.1102 | 101.11 1T... | |\n| *10* | *102.1102* | *102.11 1T...* | |\n| 10 | 110.T102 | 110.T1 1T... | Carry \"2.1\" to \"10.T\" |\n| 11 | 111.T102 | 111.T1 1T... | |\n| *12* | *112.T102* | *112.T1 1T...* | |\n| *12* | *2T0.T102* | | Carry \"012\" to \"1T0\" |\n| 12 | 1T0T.001102 | 1T0T.0011 1T... | Push \"0200000000\" to \"1T1T1T1T02\" |\n\n: {tbl-colwidths=\"[15,20,25,40]\"}\n\n:::\n::::\n\nBetween some rows of the table, we have to apply the carry slightly more greedily --\n on the strings \"21\" and \"12\" as well as \"22\".\nIn fact, looking slightly ahead to fifteen, we have to use another trick:\n\n$$\n\\begin{align*}\n15_{10} = 1\\bar{1}0\\textcolor{red}{2}.001102_{\\kappa}\n &= 1\\bar{1}\\textcolor{red}{1\\bar{1}.02}1102_{\\kappa} \\\\\n &= 1\\bar{1}1\\bar{1}.0\\textcolor{blue}{21}102_{\\kappa}\n = 1\\bar{1}1\\bar{1}.\\textcolor{blue}{10\\bar{1}}102_{\\kappa}\n\\end{align*}\n$$\n\nIn other words, \"2\" should only be pushed to the right as far as an occurrence of \"11\", since at that point we can carry.\n\nIt remains to be proven that all but the rightmost \"2\" can be eliminated from a balanced expansion,\n but good \"pushes\" appear to suffice.\n\n\n-ary to -adic\n-------------\n\nWe can convert a repeating expansions back into the ratio of two integers by using a fairly simple procedure.\nHere, we apply that procuedure is applied to both $0.\\underline{69}_{10}$\n and the string in question, \"$0.\\underline{1\\bar{1}}_{p}$\", for generic $p$:\n\n$$\n\\begin{gather*}\n {\n 0.\\underbrace{\n \\underline{\\textcolor{blue}{69}}_{10}\n }_{\\text{length } \\textcolor{red}{2}}\n }\n = \\frac{\\textcolor{blue}{69}_{10}}{10^{\\textcolor{red}{2}} - 1}\n = \\frac{\\textcolor{blue}{69}_{10}}{99_{10}}\n = \\frac{23_{10}}{33_{10}}\n \\\\\n 0.\\underline{\\textcolor{blue}{1\\bar{1}}}_p\n = \\frac{\\textcolor{blue}{1\\bar{1}}_p}{p^2 - 1}\n = \\frac{p - 1}{p^2 - 1}\n = \\frac{1}{p + 1}\n\\end{gather*}\n$$\n\nThese fractions can be used to construct [p-*adic numbers*](https://en.wikipedia.org/wiki/P-adic_number).\nDoing so requires us to realize that $p + 1$ always divides $p^{2n} - 1$.\nDoing the long division directly for some small $n$, we get:\n\n$$\n\\begin{align*}\n &\\frac{p^2 - 1}{p+1} = \\frac{10\\bar{1}_p}{11_p}\n & \\substack{\n \\phantom{11}{\\underline{\\phantom{)1}1\\bar{1}}} \\\\[3pt]\n 11)10\\bar{1} \\\\\n \\phantom{11)}\\underline{11} \\phantom{0} \\\\[3pt]\n \\phantom{11)1}{\\bar{1}\\bar{1}} \\\\\n \\phantom{11)1}{\\underline{\\bar{1}\\bar{1}}} \\\\[3pt]\n \\phantom{11)1}00\n } \\\\\n \\\\\n &\\frac{p^4 - 1}{p+1} = \\frac{1000\\bar{1}_p}{11_p}\n & \\substack{\n \\phantom{11}{\\underline{\\phantom{)1}1\\bar{1}1\\bar{1}}} \\\\[3pt]\n 11)1000\\bar{1} \\\\\n \\phantom{11)} \\underline{11} \\phantom{000} \\\\[3pt]\n \\phantom{11)1} \\bar{1}0 \\phantom{00}\\\\\n \\phantom{11)1} \\underline{\\bar{1}\\bar{1}} \\phantom{00} \\\\[3pt]\n \\phantom{11)10}10 \\phantom{0} \\\\\n \\phantom{11)10} \\underline{11} \\phantom{0} \\\\[3pt]\n \\phantom{11)100} \\bar{1}\\bar{1} \\\\\n \\phantom{11)100} \\underline{\\bar{1}\\bar{1}} \\\\[3pt]\n \\phantom{11)100} 00 \\\\\n }\n\\end{align*}\n$$\n\nIf we assert $p^\\infty$ approaches zero (regardless of whether $p$ is greater than or less than 1),\n then in the limit we have the quotient $\\bar{1}_p / 11_p = \\dots 1\\bar{1}1\\bar{1}1\\bar{1}_p$.\n\n\n### Flip it Radix-ways\n\nThe series we're actually interested in is $1_p / 11_p$, which is the negative of the above series.\nSince we're using a balanced alphabet, we can negate this by simply replacing $\\bar{1}$ with $1$\n (and vice versa), producing...\n\n$$\n0.\\underline{1\\bar{1}}_p\n = \\frac{1_p}{11_p}\n = \\underline{\\bar{1}1}\\bar{1}1_p\n$$\n\n...which is the initial expansion, but flipped about the radix point.\nWe might also remember what [we did earlier with geometric series](#geometric-series-2) and just do\n\n$$\n\\begin{align*}\n \\underline{1}1_p\n &= 1 + p + p^2 + p^3 + ...\n = \\frac{1}{1 - p} \\\\\n \\underline{\\bar{1}1}\\bar{1}1_p\n &= 1 - p + p^2 - p^3 + ...\n = \\frac{1}{1 + p}\n\\end{align*}\n$$\n\nContrary to the usual case, in a *p*-adic sense, these series always converge,\n since $p^n$ is considered to always shrink as $n$ grows.\n\n\n### Back to *κ*\n\nReturning to base *κ*, we can create the *κ*-adic expansion for two through simple addition:\n\n$$\n\\begin{align*}\n &\\phantom{+} 1\\bar{1}.000000\\dots_\\kappa\n ~=~ \\dots00001\\bar{1}_\\kappa \\\\\n &+ \\underline{00.1\\bar{1}1\\bar{1}1\\bar{1}\\dots_\\kappa\n ~=~ \\dots\\bar{1}1\\bar{1}1\\bar{1}1}_\\kappa \\\\\n & \\phantom{+} 1\\bar{1}.1\\bar{1}1\\bar{1}1\\bar{1}\\dots_\\kappa\n ~=~ \\dots\\bar{1}1\\bar{1}100_\\kappa \\\\\n\\end{align*}\n$$\n\nWe can check this expansion by power series manipulations:\n\n$$\n\\begin{align*}\n 2 = \\dots\\bar{1}1\\bar{1}100_\\kappa\n &=\\kappa^2 - \\kappa^3 + \\kappa^4 - \\kappa^5 +\\dots \\\\\n &= \\kappa^2(1 - \\kappa + \\kappa^2 - \\kappa^3 +\\dots) \\\\\n &= \\kappa^2 \\cdot \\frac{1}{1 - (-\\kappa)} \\\\\n &= \\frac{\\kappa^2}{\\kappa + 1} \\\\[8pt]\n {2\\kappa + 2}\n &= \\kappa^2\n\\end{align*}\n$$\n\nThis gives us the defining relation of *κ*, so the expansion appears to be correct.\n\n\nTwo Plus Two Equals Chaos\n-------------------------\n\n*p*-adic expansions are still expressions in the base *p*, so the carry rule still applies.\nHowever, since the carry continues to infinity, we have a necessarily limited view,\n which we can at best combat by marking repeating sections.\n\nWhile the *κ*-adic expansion for two can be incremented once to produce a valid expansion one for three,\n problems arise when attempting to construct four.\nThe most direct method is to start with the symbol \"4\" and manipulate it:\n\n$$\n\\begin{align*}\n 4_{\\kappa}\n &= 2\\bar{4}0_{\\kappa}\n = \\bar{2}600_{\\kappa}\n = 3\\bar{8}000_{\\kappa}\n = \\bar{4}\\text{B}0000_{\\kappa} \\\\\n &= 5\\bar{\\text E}10000_{\\kappa}\n = \\bar{7}\\text{J}0\\textcolor{red}{1}0000_{\\kappa}\n = \\dots\n\\end{align*}\n$$\n\nLatin characters used as numerals start at A for ten, as in hexadecimal.\nAs we carry to the left, the most significant digits (which I call the \"carry head\") grow larger without bound.\nHowever, in doing so, a residual \"1\" (marked in red) is left behind in the fourth place value.\n\nIn typical *p*-adics, *p* is an integer, and the carry head is a single digit wide.\n*κ* is not an integer, and the carry head here is two digits wide.\nThis may seem a little dubious, but truncating immediately to the right of the carry head\n will produce the same effect regardless of its size.\n\n\n### Alternative Constructions\n\nTo keep the head small, it would be nice if it were taken mod an integer.\nBoth $\\bar{1}$ and $1$ are odd, so one might hope that in between carries, we could mod out by two.\nUnfortunately, this is not the case.\nAll of the expansions above are identically four, and manipulating the digits directly would just\n give a different number.\n\nInstead, we could try representing \"4\" in a more direct manner\nThere are a few other options available.\n\n- Add the nonrepeating part of the mixed balanced expansion of 4 with the\n $\\kappa$-adic version of the repeating part (Another direct manipulation)\n\n- Increment the least significant digit in the expansion of 2 twice (Addition)\n $$\n 4 = 2 + 2 = \\frac{\\kappa^2}{1 + \\kappa} + 2 = \\dots\\bar{1}1\\bar{1}102_{\\kappa}\n $$\n\n- Add the expansion of 2 to itself (Multiplication)\n $$\n 4 = 2 \\cdot 2 = 2 \\cdot \\frac{\\kappa^2}{1 + \\kappa} = \\dots\\bar{2}2\\bar{2}200_{\\kappa}\n $$\n\n- Square the power series expansion of 2 (Exponentiation)\n $$\n \\begin{gather*}\n 4 = 2^2 = \\left(\\frac{\\kappa^2}{1 + \\kappa}\\right)^2 =\n -\\kappa^4 \\left(\n \\frac{d}{dx} \\frac{1}{1 + x}\n \\right)_{x = \\kappa}\n = \\dots\\bar{4}3\\bar{2}10000_{\\kappa}\n \\end{gather*}\n $$\n\nIf all of these series are expansions of four, then they should produce the same string after\n applying the carry enough times.\nFortunately, this seems to be the case, as this table demonstrates:\n\n$$\n\\begin{array}{}\n {\\kappa^2 \\over 1 + \\kappa} + 2 &\\phantom{00}&\n {2\\kappa^2 \\over 1 + \\kappa} &\\phantom{00}&\n \\left({\\kappa^2 \\over 1 + \\kappa}\\right)^2 \\\\[10pt] \\hline\n \\vphantom{2^{2^{2^2}}}\\dots\\bar{1}1\\bar{1}1\\bar{1}102 \\\\[4pt]\n \\dots\\bar{1}1\\bar{1}1\\bar{1}2\\bar{2}0 \\\\[4pt]\n \\dots\\bar{1}1\\bar{1}1\\bar{2}400 &&\n \\dots\\bar{2}2\\bar{2}2\\bar{2}200 \\\\[4pt]\n \\dots\\bar{1}1\\bar{1}3\\bar{6}000 &&\n \\dots\\bar{2}2\\bar{2}3\\bar{4}000 \\\\[4pt]\n \\dots\\bar{1}1\\bar{4}90000 &&\n \\dots\\bar{2}2\\bar{4}70000 \\\\[4pt]\n \\dots\\bar{1}5\\bar{\\text C}10000 &&\n \\dots\\bar{1}5\\bar{\\text A}10000 &&\n \\dots\\bar{4}3\\bar{2}10000 \\\\[4pt]\n \\dots\\bar{7}{\\text H}010000 &&\n \\dots\\bar{6}\\text F010000 &&\n \\dots\\bar{5}5010000 \\\\[4pt]\n \\dots\\bar{\\text N}1010000 &&\n \\dots\\bar{\\text L}1010000 &&\n \\dots\\bar{9}1010000 \\\\[4pt]\n \\textcolor{green}{\\dots\\bar{1}1010000} &&\n \\textcolor{green}{\\dots\\bar{1}1010000} &&\n \\textcolor{green}{\\dots\\bar{1}1010000}\n\\end{array}\n$$\n\nThe rightmost series is the most resilient to the carry head growth, but it comes at\n the cost of not operating on a repeating series.\nIn the range shown, all three columns converge to the same digit sequence, which truncated to 20 terms is:\n\n$$\n4 = \\dots \\bar{1}00000\\bar{1}00001\\bar{1}1010000_\\kappa = \\kappa^4 + \\kappa^6 -\\ \\kappa^7 + \\dots\n$$\n\nContrary to the sequence used to build it, this expansion appears to be nonrepeating.\nAs of writing, there are\n [no matches](http://oeis.org/search?q=1%2C0%2C1%2C-1%2C1%2C0%2C0%2C0%2C0%2C-1%2C0%2C0%2C0%2C0%2C0%2C-1&sort=&language=&go=Search)\n in the OEIS, even if the leading 0's are ignored.\nThe Haskell used to generate each expansion above can be found [here](./cendree.hs),\n and the first 8192 digits be found in a CSV [here](./cendree_adic_4.csv).\n\n\n### All Positive\n\nIf we are slightly greedier with the carry, we can clear it of all negative digits.\nFor example,\n\n$$\n\\begin{align*}\n 4 &= \\dots \\bar{1}00000\\bar{1}00001\\bar{1}1010000_\\kappa \\\\\n &= \\dots \\bar{1}00000\\bar{1}000\\bar{1}311010000_\\kappa \\\\\n &= \\dots \\bar{1}00000\\bar{1}001\\bar{3}111010000_\\kappa \\\\\n &= \\dots \\bar{1}00000\\bar{1}0\\bar{2}51111010000_\\kappa \\\\\n &= \\dots \\bar{1}00000\\bar{1}2\\bar{6}11111010000_\\kappa \\\\\n &= \\dots \\bar{1}00000\\bar{4}8011111010000_\\kappa \\\\\n &= \\quad \\vdots \\\\\n &= \\dots 0 11000 0 0011111010000_\\kappa \\\\\n &= \\kappa^4 + \\kappa^6 + \\kappa^7 + \\kappa^8 + \\kappa^9 \\dots\n\\end{align*}\n$$\n\nAgain, it appears to be possible to achieve this sequence by applying the carry enough times,\n starting with any of the alternative expansions.\nA similar CSV containing 8192 terms is available [here](./cendree_adic_4_binary.csv).\n\nThis alternate expansion is somewhat confounding, since *κ* is bounded above by the\n integer three and should therefore require three symbols in its alphabet.\nI can think of two explanations, and do not know whether either of them are correct:\n\n- The expansion is related to the conjugate root $\\kappa^* = 1 -\\ \\sqrt 3 \\approx -0.73205\\dots$.\n The reciprocal of this number is less than two.\n- Because infinite precision is required, the minimal alphabet can become (possibly arbitrarily) small.\n\n\nSearching for Repetition\n------------------------\n\nThe [discrete Fourier transform](https://en.wikipedia.org/wiki/Discrete_Fourier_transform)\n is an operation on a discrete signal (i.e., a sequence of numbers).\nIt has the desirable property that it converts highly repetitive signals sequences into ones with peaks.\nWe can use this to assess whether an expansion repeats or not.\n\nSince our expansions are infinite, we'll need to truncate them.\nUnfortunately, this renders us unable to pick up on repetitions larger than a certain size.\nIn other words, to detect very large periods, we need to truncate our sequence to a large number of terms.\n\nFor example, the digits in the decimal expansion of 1/7 form the string \"142857\", repeating.\nTruncating this sequence to 256 terms, we can plot its DFT:\n\n::: {#a6158b7e .cell execution_count=2}\n``` {.python .cell-code code-fold=\"true\"}\nfrom itertools import cycle, islice\nfrom matplotlib import pyplot as plt\nimport numpy as np\n\none_seventh = list(islice(cycle([1,4,2,8,5,7]), 256))\n\nplt.title(\"DFT of first 256 digits of decimal expansion of 1/7\")\nplt.plot(abs(np.fft.fft(one_seventh))[:129])\n```\n\n::: {.cell-output .cell-output-display}\n{width=583 height=431}\n:::\n:::\n\n\nThe clear peak near forty is because the expansion repeats every 6 terms and\n $\\frac{256}{43} < 6 < \\frac{256}{42}$.\n\n\n### Four-ier Transforms\n\nIf the $\\kappa$-adic expansion of four is nonrepeating, then its DFT should not have any noticeable peaks.\n\n::: {#079df1ce .cell execution_count=3}\n``` {.python .cell-code code-fold=\"true\"}\nimport csv\n\nwith open(\"cendree_adic_4.csv\") as f:\n cendree_adic_4 = [int(i) for i in list(csv.reader(f))[0]]\n\nplt.title(\"DFT of first 256 digits of $\\\\kappa$-adic expansion of 4\")\nplt.plot(abs(np.fft.fft(cendree_adic_4[:256]))[:129])\n```\n\n::: {.cell-output .cell-output-display}\n{width=575 height=432}\n:::\n:::\n\n\nThe DFT of the first 256 terms shows it to be very noisy.\nThere is a pronounced spike at the right edge of the graph (the Nyquist frequency),\n but it has a simple explanation: $1$ appears only at even place values and $\\bar{1}$ at odd.\nAt Nyquist, the DFT degenerates into an alternating sum, so its value is simply the number of nonzero digits.\n\nIf we map the negatives out of the sequence, the peak moves to the left edge (where the DFT degenerates into a sum).\n\n::: {#219cff53 .cell execution_count=4}\n``` {.python .cell-code code-fold=\"true\"}\nplt.title(\"DFT of $4_{\\\\kappa}$ after mapping $\\\\bar{1}$ to $1$\")\nplt.plot(abs(np.fft.fft([abs(i) for i in cendree_adic_4[:256]]))[:129])\n```\n\n::: {.cell-output .cell-output-display}\n{width=575 height=435}\n:::\n:::\n\n\nIf you look closely, you'll notice that this plot is a mirror of the other.\n\n\n### Longer Truncations\n\nEven in the 8192-term truncation, there are no noticeable spikes in its DFT,\n lending further credence to its aperiodicity.\nIf it feels like we're doing something wrong, we might also try the \"all-positive\" variant of the expansion.\nUnfortunately, we're not so lucky.\nEven then, we just end up with pure noise.\n\n:::: {#long-trunc-figures .row layout-ncol=\"2\"}\n::: {.column width=\"40%\"}\n\n::: {#e5d46955 .cell execution_count=5}\n``` {.python .cell-code code-fold=\"true\"}\nplt.title(\"DFT of first 8192 digits of $4_{\\\\kappa}$\")\nplt.plot(abs(np.fft.fft(cendree_adic_4))[:len(cendree_adic_4) // 2])\n\n#\n```\n\n::: {.cell-output .cell-output-display}\n{width=575 height=432}\n:::\n:::\n\n\n:::\n\n::: {.column width=\"40%\"}\n\n::: {#0370766d .cell execution_count=6}\n``` {.python .cell-code code-fold=\"true\"}\n# Alternatively, with the non-balanced expansion\nwith open(\"cendree_adic_4_binary.csv\") as f:\n cendree_adic_4_binary = [int(i) for i in list(csv.reader(f))[0]]\n\nplt.title(\"DFT of first 8192 digits of $4_\\\\kappa$ (binary)\")\nplt.plot(abs(np.fft.fft(cendree_adic_4_binary))[1:len(cendree_adic_4_binary) // 2])\n```\n\n::: {.cell-output .cell-output-display}\n{width=575 height=432}\n:::\n:::\n\n\n:::\n::::\n\nMuch like the expansion of irrational numbers in integral bases, the balanced\n *κ*-adic expansion of four seems to be nonrepeating.\nThis is surprising, considering four is an integer, and especially since its expansion terminates\n in a normal alphabet and repeats in a balaced alphabet.\n\n\nClosing\n-------\n\nThis concludes the discussion of base *κ* and the *κ*-adics.\nRemember, we only bothered investigating *κ*-adic expansions for the number four.\nGreater integers suffer the same issues, and other bases are certainly possible.\nHopefully, four provides an illuminating enough example of the general chaos induced by irrational bases.\n\nThe [next post](../5) will return to integral sequences, and the patterns produced from their\n \"erroneousness\" as an actual base.\n\n[^1]:\n <details>\n <summary>\n Proof sketch that base *κ* expansions of integers above three end in \"2\"\n </summary>\n\n Recall that $3 = 10.02_{\\kappa}$ and $4 = 11.02_{\\kappa}$.\n\n We can add two expansion together to produce a new valid expansion.\n Hence,\n\n :::: {.row layout-ncol=\"2\"}\n ::: {.column width=\"40%\"}\n $$\n \\begin{align*}\n 8 &= 4 + 4\n = 11.02_{\\kappa} + 11.02_{\\kappa} \\\\\n &= \\textcolor{red}{22}.04_{\\kappa}\n = \\textcolor{red}{1}00.0\\textcolor{blue}{4}_{\\kappa}\n = 100.\\textcolor{blue}{1102}_{\\kappa}\n \\end{align*}\n $$\n :::\n\n ::: {.column width=\"40%\"}\n $$\n \\begin{align*}\n 11_{10} &= 8 + 3\n = 100.1102_{\\kappa} + 10.02_{\\kappa} \\\\\n &= 110.1\\textcolor{red}{3}02_{\\kappa}\n = 110.\\textcolor{red}{2004}_{\\kappa} \\\\\n &= 110.200\\textcolor{blue}{4}_{\\kappa}\n = 110.20\\textcolor{blue}{1102}_{\\kappa}\n \\end{align*}\n $$\n :::\n ::::\n\n From these examples, we see that adding small numbers like three will, at most,\n produce a \"3\" or \"4\" in the negative second place value.\n\n If there is a \"2\" in the negative first place value, then expanding \"3\" or \"4\" in the negative\n second will give a \"3\" there, which is troublesome.\n But we got in this position by adding three; by adding two first, we can apply the carry\n across the zeroth and negative first place values instead, which produces\n at most a \"3\" in the first place value.\n Expanding \"3\" at this place value places a \"2\" back in the negative first place value,\n and we don't have to worry about modifying digits in other negative place values.\n\n If there is *not* a \"2\" in the negative first place value, then expanding the \"3\" or \"4\"\n in the negative second place value pushes a \"2\" into the negative fourth place value.\n From here \"2\" is either in the terminal position, or causes another expansion of \"3\" or \"4\".\n In the latter cases, we recurse, eventually pushing a \"2\" into a negative even place value in terminal position.\n </details>\n\n",
|
|
"supporting": [
|
|
"index_files"
|
|
],
|
|
"filters": [],
|
|
"includes": {}
|
|
}
|
|
} |