{ "hash": "f1d1f6321eb69b507eacbbdbfb621264", "result": { "engine": "jupyter", "markdown": "---\ntitle: \"Numbering Numbers, Part 2: Ordering Obliquely\"\ndescription: |\n How do we construct an irrational number from rational ones?\nformat:\n html:\n html-math-method: katex\ndate: \"2023-12-31\"\ndate-modified: \"2025-07-29\"\ncategories:\n - haskell\n - diagonal argument\n---\n\n\n\nThis post assumes you have read the [previous one](./1), which discusses the creation of sequences\n containing every integer, every binary fraction, and in fact, every fraction.\nFrom the fractions, we also could enumerate quadratic irrational numbers using the *question-mark function*.\n\n\nOther Irrationals\n-----------------\n\nBecause rationals -- and even some irrationals -- can be enumerated, we might imagine\n that it would be nice to enumerate *all* irrational numbers.\nUnfortunately, we're not very lucky this time.\n\nLet's start by making what we mean by \"number\" more concrete\nWe've already been exposed to infinite expansions, like 1/3 in binary (and conveniently, also decimal).\nIn discussing the question mark function, I mentioned the utility of repeating expansions as a means of\n accessing quadratic rationals in the Stern-Brocot tree.\nA general sequence need not repeat, so we can choose to treat these extra \"infinite expansions\" as numbers.\nProving that a rational number must have a repeating expansion is difficult, but if we accept this premise,\n then the new non-repeating expansions are our irrationals.\nFor example, $2 - \\varphi \\approx 0.381966...$, which we encountered last time, is such a number.\n\nDoing this introduces a number of headaches, the least of which is that of\n the definition of arithmetic on such quantities.\nHowever, we need only be concerned with the contents of these sequences to show why\n we can't list out all irrationals.\n\n\n### Diagonalization\n\nWe can narrow our focus to the interval between 0 and 1, since the numbers outside this interval\n are their reciprocals.\nNow (if we agree to use base ten), \"all numbers between 0 and 1\" as we've defined them begin with \"0.\",\n followed by an infinite sequence of digits 0-9.\nSuppose that we have an enumeration of every infinite sequence on this list -- no sequence is left out.\n[Cantor's diagonal argument](https://en.wikipedia.org/wiki/Cantor%27s_diagonal_argument) shows that\n a new sequence can be found by taking the sequence on the diagonal\n and changing each individual digit to another one.\nThe new sequence differs in at least one place from every element on the list,\n so the new sequence cannot be on the list.\nTherefore, such an enumeration cannot exist.\n\nThis is illustrated for binary sequences in this diagram:\n\n\n
\n
\n , via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:Diagonal_argument_01_svg.svg\">\n \"Diagonal\n \n\n
\n Source: Jochen Burghardt, via Wikimedia Commons\n
\n
\n
\n\nIt's fairly common to show this argument without much further elaboration,\n but there are a few problems with doing so:\n\n- We're using infinite sequences of digits, not numbers.\n - Equality between sequences is defined by having all elements coincide.\n- We assume we have an enumeration of sequences to which the argument applies.\n The contents of the enumeration are a mystery.\n- We have no idea which sequences are rational numbers, or if we'd construct one\n by applying the diagonal argument.\n\n\n### Equality\n\nThe purpose of the diagonal argument is to produce a new sequence which was not previously enumerated.\nThe sequence is different in all positions, but what we actually want is equality with respect to the base.\nIn base ten, we have the peculiar identity that\n [$0.\\overline{9} = 1$](https://en.wikipedia.org/wiki/0.999...).\nThis means that if the diagonal argument (applied to base ten sequences) constructs a new sequence\n with the digit 9 repeating forever, it might be equivalent to a sequence which was already in the list:\n\n::: {#5805c2a5 .cell .plain execution_count=3}\n\n::: {.cell-output .cell-output-display}\n```{=html}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Sequence\n \n 0\n \n 1\n \n 2\n \n 3\n \n 4\n \n 5\n \n ...\n
\n 0\n \n \n 1\n \n \n 2\n \n 3\n \n 4\n \n 5\n \n 6\n \n ...\n
\n 1\n \n 9\n \n \n 2\n \n \n 4\n \n 8\n \n 3\n \n 7\n \n ...\n
\n 2\n \n 2\n \n 2\n \n \n 8\n \n \n 2\n \n 2\n \n 2\n \n ...\n
\n \n 3\n \n \n \n 2\n \n \n \n 3\n \n \n \n 9\n \n \n \n 3\n \n \n \n 9\n \n \n \n 9\n \n \n \n ...\n \n
\n 4\n \n 9\n \n 4\n \n 9\n \n 4\n \n \n 9\n \n \n 4\n \n ...\n
\n 5\n \n 8\n \n 1\n \n 2\n \n 5\n \n 7\n \n \n 9\n \n \n ...\n
\n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n
\n \n ω\n \n \n \n 2\n \n \n \n 3\n \n \n \n 9\n \n \n \n 4\n \n \n \n 0\n \n \n \n 0\n \n \n \n ...\n \n
\n```\n\nA case in which the diagonal argument could construct a number already on the list.\n:::\n:::\n\n\nIn the above table, sequence 3 is assumed to continue with 9's forever.\nThe new sequence ω comes from taking the red digits along the diagonal and mapping each digit\n to the next one (mod ten).\nIn the enumeration given, the diagonal continues with 9's forever, so we end up with 0's forever in ω.\n\n\n### Picking a Sequence and Ensuring Rationals\n\n\"No problem, just pick another enumeration,\" you might say.\nIndeed, the example given relies on a simple function and an enumeration\n to which it is particularly ill-suited.\n\nInstead, let's focus on something we *can* do.\nInstead of assuming we have all irrational numbers listed out already, let's start smaller.\nAs of last post, we already have several ways to enumerate all rational numbers between 0 and 1.\nWe can take this enumeration and convert each rational number to positional expansions in a base.\nThen after applying the diagonal argument, the resulting quantity *should* be an irrational number.\n\nFor convenience, we'll use binary expansions of rationals as our sequences.\nThat way, to get a unique sequence on the diagonal, we only have to worry\n about changing \"0\"s to \"1\"s (and vice versa).\nSince we have less flexibility in our digits, it also relieves us from some of the responsibility\n of finding a \"good\" function, like in the decimal case.\nHowever, it's still possible the argument constructs a number already equal to something on the list.\n\n\nInto Silicon\n------------\n\nBefore going any further, let's write a function for applying the diagonal argument to\n a list of binary sequences.\nThis can be implemented in Haskell fairly easily:\n\n\n\nNothing about this function is specific to \"binary sequences\", since `Int` contains values\n other than `1` and `0`.\nIt's just more intuitive to work with them instead of \"`True`\" and \"`False`\"\n (since `Bool` actually does have 2 values).\nYou can replace `(1 -)` with `not` to get a similar function for the type `Bool`.\n\nWe also need a function to get a rational number's binary expansion.\nThis is simple if you recall how to do long division.\nWe try to divide the numerator by the denominator, \"emit\" the quotient as part of the result list,\n then continue with the remainder (and the denominator is unchanged).\nIt's not *quite* that simple, since we also need to \"bring down\" more zeroes.\nIn binary, we can add more zeroes to an expansion by just multiplying by 2.\n\n::: {#852dbb85 .cell layout-ncol='2' execution_count=5}\n\n::: {.cell-output .cell-output-display}\n```\nx = 1 / 3 = 0.010101010...\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\ny = 1 / 5 = 0.001100110...\n```\n:::\n:::\n\n\nThis function gives us the leading 0 (actually the integer part of the quotient of `n` by `d`),\n but we can peel it off by applying `tail`.\n\nSince we intend to interpret these sequences as binary numbers, we might as well also\n convert this into a form we recognize as a number.\nAll we need to do is take a weighted sum of each sequence by its binary place value.\n\n::: {#65218a76 .cell execution_count=6}\n\n::: {.cell-output .cell-output-display}\n```\n0.2\n```\n:::\n:::\n\n\nThe precision `p` here is mostly useless, since we intend to take this to as far as `Double` will go.\n`p` = 100 will do for most sequences, since it's rare that we'll encounter more than a few zeroes\n at the beginning of a sequence.\n\n\nSome Enumerations\n-----------------\n\nNow, for the sake of argument, let's look at an enumeration that fails.\nUsing the tree of binary fractions from the last post, we use a breadth-first search to create\n a list of terminating binary expansions.\n\n![\n Tree of binary fractions, as the tree of terminating binary expansions.
\n We perform a BFS on the left subtree to obtain the values between 0 and 1.\n](../1/binary_expansion_tree.png)\n\n\n\n::: {#d68623fb .cell .plain execution_count=8}\n\n::: {.cell-output .cell-output-display}\n```{=html}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Sequence\n \n Fraction\n \n 0\n \n 1\n \n 2\n \n 3\n \n 4\n \n 5\n \n 6\n \n 7\n \n ...\n
\n 0\n \n 1/2\n \n \n 1\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 1\n \n 1/4\n \n 0\n \n \n 1\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 2\n \n 3/4\n \n 1\n \n 1\n \n \n 0\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 3\n \n 1/8\n \n 0\n \n 0\n \n 1\n \n \n 0\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 4\n \n 3/8\n \n 0\n \n 1\n \n 1\n \n 0\n \n \n 0\n \n \n 0\n \n 0\n \n 0\n \n ...\n
\n 5\n \n 5/8\n \n 1\n \n 0\n \n 1\n \n 0\n \n 0\n \n \n 0\n \n \n 0\n \n 0\n \n ...\n
\n 6\n \n 7/8\n \n 1\n \n 1\n \n 1\n \n 0\n \n 0\n \n 0\n \n \n 0\n \n \n 0\n \n ...\n
\n 7\n \n 1/16\n \n 0\n \n 0\n \n 0\n \n 1\n \n 0\n \n 0\n \n 0\n \n \n 0\n \n \n ...\n
\n ...\n \n \n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n
\n ω\n \n \n \n 0\n \n 0\n \n 1\n \n 1\n \n 1\n \n 1\n \n 1\n \n 1\n \n ...\n
\n```\n:::\n:::\n\n\nComputing the diagonal sequence, it quickly becomes apparent that we're going\n to keep getting \"0\"s along the diagonal.\nThis is because we're effectively just counting in binary some number of digits to the right.\nThe length of a binary expansion grows logarithmically, but going down the diagonal is a linear process.\nIn other words, we can't count fast enough by just adding 1 (or adding any number, really).\n\nEven worse than this, we get a sequence which is equal to sequence 1 as a binary expansion.\nWe can't even rely on the diagonal argument to give us a new number that *isn't* equal\n to a binary fraction.\n\n\n### Stern-Brocot Diagonal\n\nThe Stern-Brocot tree contains more than just binary fractions, so we're bound to encounter more than\n \"0\" forever when running along the diagonal.\nAgain, looking at the left subtree, we can read off fractions between 0 and 1.\n\n![\n Stern-Brocot tree\n](../1/stern-brocot_tree.png)\n\nWe end up with the following enumeration:\n\n::: {#b59f03fa .cell .plain execution_count=9}\n\n::: {.cell-output .cell-output-display}\n```{=html}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Sequence\n \n Fraction\n \n 0\n \n 1\n \n 2\n \n 3\n \n 4\n \n 5\n \n 6\n \n 7\n \n ...\n
\n 0\n \n 1/2\n \n \n 1\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 1\n \n 1/3\n \n 0\n \n \n 1\n \n \n 0\n \n 1\n \n 0\n \n 1\n \n 0\n \n 1\n \n ...\n
\n 2\n \n 2/3\n \n 1\n \n 0\n \n \n 1\n \n \n 0\n \n 1\n \n 0\n \n 1\n \n 0\n \n ...\n
\n 3\n \n 1/4\n \n 0\n \n 1\n \n 0\n \n \n 0\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 4\n \n 2/5\n \n 0\n \n 1\n \n 1\n \n 0\n \n \n 0\n \n \n 1\n \n 1\n \n 0\n \n ...\n
\n 5\n \n 3/5\n \n 1\n \n 0\n \n 0\n \n 1\n \n 1\n \n \n 0\n \n \n 0\n \n 1\n \n ...\n
\n 6\n \n 3/4\n \n 1\n \n 1\n \n 0\n \n 0\n \n 0\n \n 0\n \n \n 0\n \n \n 0\n \n ...\n
\n 7\n \n 1/5\n \n 0\n \n 0\n \n 1\n \n 1\n \n 0\n \n 0\n \n 1\n \n \n 1\n \n \n ...\n
\n ...\n \n \n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n
\n ω\n \n \n \n 0\n \n 0\n \n 0\n \n 1\n \n 1\n \n 1\n \n 1\n \n 0\n \n ...\n
\n```\n:::\n:::\n\n\nWhen expressed as a decimal, the new sequence corresponds to the value 0.12059395276... .\nDually, its continued fraction expansion begins \\[0; 8,3,2,2,1,2,12, ...\\].\nWhile the number is (almost) certainly irrational, I have no idea whether it is algebraic or transcendental.\n\n\n### Pairs, without repeats\n\nWe have a second, similar enumeration given by `allRationalsMap` in the previous post.\nWe'll need to filter out the numbers greater than 1 from this sequence, but that's not too difficult\n since we're already filtering out repeats.\n\n::: {#ab2a268b .cell .plain execution_count=10}\n\n::: {.cell-output .cell-output-display}\n```{=html}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Sequence\n \n Fraction\n \n 0\n \n 1\n \n 2\n \n 3\n \n 4\n \n 5\n \n 6\n \n 7\n \n ...\n
\n 0\n \n 1/2\n \n \n 1\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 1\n \n 1/3\n \n 0\n \n \n 1\n \n \n 0\n \n 1\n \n 0\n \n 1\n \n 0\n \n 1\n \n ...\n
\n 2\n \n 1/4\n \n 0\n \n 1\n \n \n 0\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 3\n \n 2/3\n \n 1\n \n 0\n \n 1\n \n \n 0\n \n \n 1\n \n 0\n \n 1\n \n 0\n \n ...\n
\n 4\n \n 1/5\n \n 0\n \n 0\n \n 1\n \n 1\n \n \n 0\n \n \n 0\n \n 1\n \n 1\n \n ...\n
\n 5\n \n 1/6\n \n 0\n \n 0\n \n 1\n \n 0\n \n 1\n \n \n 0\n \n \n 1\n \n 0\n \n ...\n
\n 6\n \n 2/5\n \n 0\n \n 1\n \n 1\n \n 0\n \n 0\n \n 1\n \n \n 1\n \n \n 0\n \n ...\n
\n 7\n \n 3/4\n \n 1\n \n 1\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n \n 0\n \n \n ...\n
\n ...\n \n \n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n
\n ω\n \n \n \n 0\n \n 0\n \n 1\n \n 1\n \n 1\n \n 1\n \n 0\n \n 1\n \n ...\n
\n```\n:::\n:::\n\n\nThis new sequence has a decimal expansion equivalent to 0.24005574958...\n (continued fraction expansion begins \\[0; 4, 6, 28, 1, 1, 5, 1, ...\\]).\nAgain, this is probably irrational, since WolframAlpha has no idea on whether a closed form exists.\n\n\nThe Diagonal Transform\n----------------------\n\nWhy stop with just one?\nThis new number can just be tacked onto the beginning of the list.\nThen, we re-apply the diagonal argument to obtain a new number.\nAnd so on ad infinitum.\n\n\n\n::: {#f6421e15 .cell .plain execution_count=12}\n\n::: {.cell-output .cell-output-display}\n```{=html}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Sequence\n \n Fraction\n \n 0\n \n 1\n \n 2\n \n 3\n \n 4\n \n 5\n \n 6\n \n 7\n \n ...\n
\n ...\n \n \n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n
\n \n -2\n \n \n \n \n \n \n \n 1\n \n \n \n 1\n \n \n \n 1\n \n \n \n 1\n \n \n \n 1\n \n \n \n 0\n \n \n \n 1\n \n \n \n 1\n \n \n \n ...\n \n
\n \n -1\n \n \n \n \n \n \n \n 0\n \n \n \n 0\n \n \n \n 0\n \n \n \n 1\n \n \n \n 1\n \n \n \n 1\n \n \n \n 1\n \n \n \n 0\n \n \n \n ...\n \n
\n 0\n \n 1/2\n \n \n 1\n \n \n \n 0\n \n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n 0\n \n ...\n
\n 1\n \n 1/3\n \n 0\n \n \n 1\n \n \n \n 0\n \n \n 1\n \n 0\n \n 1\n \n 0\n \n 1\n \n ...\n
\n 2\n \n 2/3\n \n 1\n \n 0\n \n \n 1\n \n \n \n 0\n \n \n 1\n \n 0\n \n 1\n \n 0\n \n ...\n
\n 3\n \n 1/4\n \n 0\n \n 1\n \n 0\n \n \n 0\n \n \n \n 0\n \n \n 0\n \n 0\n \n 0\n \n ...\n
\n 4\n \n 2/5\n \n 0\n \n 1\n \n 1\n \n 0\n \n \n 0\n \n \n \n 1\n \n \n 1\n \n 0\n \n ...\n
\n 5\n \n 3/5\n \n 1\n \n 0\n \n 0\n \n 1\n \n 1\n \n \n 0\n \n \n \n 0\n \n \n 1\n \n ...\n
\n 6\n \n 3/4\n \n 1\n \n 1\n \n 0\n \n 0\n \n 0\n \n 0\n \n \n 0\n \n \n \n 0\n \n \n ...\n
\n 7\n \n 1/5\n \n 0\n \n 0\n \n 1\n \n 1\n \n 0\n \n 0\n \n 1\n \n \n 1\n \n \n ...\n
\n ...\n \n \n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n \n ...\n
\n```\n\nUsing the Stern-Brocot enumeration ~~because I like it better~~\n:::\n:::\n\n\nFor completeness's sake, the decimal expansions of the first few numbers which pop are as follows:\n\n::: {#a360b5ab .cell execution_count=13}\n\n::: {.cell-output .cell-output-display}\n```\n0.12059395276295479\n0.9839683315741587\n0.39401828609177836\n0.7474914867558182\n3.876798422930419e-2\n0.7802097209903278\n0.3215249242021624\n0.6795283379777878\n0.1938245109955674\n0.947203605609322\n```\n:::\n:::\n\n\nDoes this list out \"all\" irrational numbers? Not even close.\nIn fact, this just gives us a bijection between the original enumeration\n and a new one containing our irrationals.\n\nThe new numbers we get also depend heavily on the order of the original sequence.\nThis is obvious just by looking at the first entry produced by our two good enumerations.\nPerhaps if we permuted the enumeration of rationals in all possible ways, we would end up listing\n all irrational numbers, but we'd also run through\n [all ways of ordering the natural numbers](https://en.wikipedia.org/wiki/Baire_space_%28set_theory%29).\n\nThe fact that \"bad\" enumerations exist tells us that it's not even guaranteed that we don't collide\n with any rationals.\nI conjecture that the good enumerations won't do so, since we shouldn't ever encounter\n an infinite sequence of \"0\"s or \"1\"s, and a sequence should eventually differ\n in at least one position from one already listed.\n\n\n### Almost Involution\n\nSince the function has the same input and output type, you may wonder what happens when\n it's applied multiple times.\nPerhaps it is possible that since `\\x -> 1 - x` is an involution, so too is this new function.\nAlas, experimentation proves us wrong.\n\n::: {#7f43a316 .cell layout-ncol='2' execution_count=14}\n\n::: {.cell-output .cell-output-display}\n```\n0.5\n0.3333333333333333\n0.9166666666666666\n0.125\n0.7124999999999999\n0.2875\n0.859375\n7.5e-2\n0.6841517857142857\n0.486328125\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\n1/2\n1/3\n11/12\n1/8\n57/80\n23/80\n55/64\n3/40\n???, possibly 613/896\n249/512\n```\n:::\n:::\n\n\nThe fraction forms of the above numbers are my best guesses.\nEither way, it only matches for the first two terms before going off the rails.\n\nEven stranger than this distorted reflection is the fact that going through the mirror again\n doesn't take us anywhere new:\n\n::: {#30df5ac9 .cell execution_count=15}\n\n::: {.cell-output .cell-output-display}\n```\n0.12059395276295479\n0.9839683315741587\n0.39401828609177836\n0.7474914867558182\n3.876798422930419e-2\n0.7802097209903278\n0.3215249242021624\n0.6795283379777878\n0.1938245109955674\n0.947203605609322\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\nTrue\n```\n:::\n:::\n\n\nIn other words, applying the transform thrice is the same as applying the transform once.\nNot that this has been shown rigorously in the least -- it's only been tested in a 100x100 square.\n\nRegardless, this semi-involutory behavior is strange and nontrivial.\nAnd it's not limited to this enumeration.\nFor example, the filtered `allRationalsMap` iterations shows:\n\n::: {#3232aac9 .cell layout='[[1,1],[1]]' execution_count=16}\n\n::: {.cell-output .cell-output-display}\n```\n0.5\n0.3333333333333333\n0.75\n0.16666666666666666\n0.7\n0.41666666666666663\n0.8687499999999999\n0.1015625\n0.5295758928571428\n0.49453125\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\n1/2\n1/3\n3/4\n1/6\n7/10\n5/12\n139/160\n13/128\n???, possibly 949/1792\n633/1280\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\nTrue\n```\n:::\n:::\n\n\nMeanwhile, the bad enumeration just gives more binary fractions, but it still doesn't mean\n double-transforming returns the original diagonal.\n\n::: {#e67a04cf .cell layout='[[1,1],[1,1],[1]]' execution_count=17}\n\n::: {.cell-output .cell-output-display}\n```\nFirst diagonal transform: \n0.25\n1.0\n0.5\n0.625\n6.25e-2\n0.78125\n0.390625\n0.6328125\n0.19140625\n0.814453125\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\nGuesses\n1/4\n1/1\n1/2\n5/8\n1/16\n25/32\n25/64\n81/128\n49/256\n417/512\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\nSecond diagonal transform: \n0.5\n0.25\n0.75\n0.125\n0.6875\n0.46875\n0.859375\n0.1171875\n0.55859375\n0.435546875\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\nGuesses\n1/2\n1/4\n3/4\n1/8\n11/16\n15/32\n55/64\n15/128\n143/256\n223/512\n```\n:::\n\n::: {.cell-output .cell-output-display}\n```\nTrue\n```\n:::\n:::\n\n\nWhat does it mean that the initial enumeration comes back as a completely different one?\nSince the new one is \"stable\" with respect to applying the diagonal transform twice,\n are the results somehow preferable or significant?\n\n\nClosing\n-------\n\nThese questions, and others I have about the products of this process, I unfortunately have no answer for.\nI was mostly troubled by how rare it is to find people applying the diagonal argument\n to something to anything other than random sequences.\n\nRandom sequences, either by choice or by algorithm (if you can even call them random at that point),\n are really only good to show *how* to apply the diagonal argument.\nWithout knowing *what* the argument is applied to, it's useless for constructive arguments.\nIt also still remains to be proven that your new sequences are sufficient for the purpose\n (since I've only shown a case in which it fails).\n\n(Recycled) diagrams made in Geogebra.\n\n\n", "supporting": [ "index_files" ], "filters": [], "includes": { "include-in-header": [ "\n\n\n" ] } } }