The Universe of Discourse
https://blog.plover.com
The Universe of Discourse (Mark Dominus Blog)enA triviality about numbers that look like abbc
https://blog.plover.com/2024/07/05#multiple-of-37
<p>Looking at license plates the other day I noticed that if you have a
four-digit number <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%24"> with digits <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24abbc%24">, and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%2bc%3db%24">, then
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%24"> will always be a multiple of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2437%24">. For example, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%244773%20%3d%0a37%5ccdot%20129%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241776%20%3d%2037%5ccdot%2048%24">.</p>
<p>Mathematically this is uninteresting. The proof is completely
trivial. (Such a number is simply <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241110a%20%2b111c%24">, and
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24111%3d3%5ccdot%2037%24">.)</p>
<p>But I thought that if someone had pointed this out to me when I was
eight or nine, I would have been very pleased. Perhaps if you have a
mathematical eight- or nine-year-old in your life, they will be
pleased if you share this with them.</p>
Well, I guess I believe everything now!
https://blog.plover.com/2024/04/23#k2
<p>The <em>principle of explosion</em> is that in an inconsistent system
<em>everything</em> is provable: if you prove both <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> and not-<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> for
<em>any</em> <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24">,
you can then conclude <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24"> for <em>any</em> <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24">: </p>
<p>$$(P \land \lnot P) \to Q.$$</p>
<p>This is, to put it briefly, not intuitive. But it is <em>awfully</em> hard
to get rid of because it appears to follow immediately from two
principles that <em>are</em> intuitive:</p>
<ol>
<li><p>If we can prove that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24"> is true, then we can prove that at least
one of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24"> or <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B%24"> is true. (In symbols, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%5cto%28A%5clor%20B%29%24">.)</p></li>
<li><p>If we can prove that at least one of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24"> or <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B%24"> is true, and we
can prove that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24"> is false, then we may conclude that that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B%24"> is
true. (Symbolically, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%28A%5clor%20B%29%20%5cto%20%28%5clnot%20A%5cto%20B%29%24">.).</p></li>
</ol>
<p>Then suppose that we have proved that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> is both true and false.
Since we have proved <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> true, we have proved that at least one of
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> or <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24"> is true. But because we have also proved that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> is
false, we may conclude that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24"> is true. Q.E.D.</p>
<p>This proof is as simple as can be. If you want to get rid of this, you
have a hard road ahead of you. You have to follow Graham Priest into
the wilderness of <a href="https://en.wikipedia.org/wiki/paraconsistent_logic">paraconsistent logic</a>.</p>
<p>Raymond Smullyan observes that although logic is supposed to model
ordinary reasoning, it really falls down here. Nobody, on discovering
the fact that they hold contradictory beliefs, or even a false one,
concludes that therefore they must believe <em>everything</em>. In fact,
says Smullyan, almost everyone <em>does</em> hold contradictory beliefs. His
argument goes like this:</p>
<ol>
<li><p>Consider all the things I believe individually, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B_1%2c%20B_2%2c%0a%20%20%20%5cldots%24">. I believe each of these, considered separately, is true.</p></li>
<li><p>However, I <em>also</em> believe that I'm not infallible, and that at
least one of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B_1%2c%20B_2%2c%20%5cldots%24"> is false, although I don't know
which ones.</p></li>
<li><p>Therefore I believe both <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cbigwedge%20B_i%24"> (because I believe each
of the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B_i%24"> separately) and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5clnot%5cbigwedge%20B_i%24"> (because I
believe that not all the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B_i%24"> are true).</p></li>
</ol>
<p>And therefore, by the principle of explosion, I ought to believe that
I believe absolutely everything.</p>
<p>Well anyway, none of that was exactly what I planned to write about.
I was pleased because I noticed a very simple, specific example of
something I believed that was clearly inconsistent. Today I learned
that <a href="https://en.wikipedia.org/wiki/K2">K2</a>, the second-highest mountain in the world, is in
Asia, near the border of Pakistan and westernmost China. I was
surprised by this, because I had thought that K2 was in Kenya
somewhere.</p>
<p>But I <em>also</em> knew that the highest mountain in Africa was
Kilimanjaro. So my simultaneous beliefs were flatly contradictory:</p>
<ol>
<li>K2 is the second-highest mountain in the world.</li>
<li>Kilimanjaro is not the highest mountain in the world, but it is the
highest mountain in Africa</li>
<li>K2 is in Africa</li>
</ol>
<p>Well, I guess until this morning I must have believed everything!</p>
3-coloring the vertices of an icosahedron
https://blog.plover.com/2024/04/13#colored-icosahedron
<p>I don't know that I have a point about this, other than that it makes me sad.</p>
<p><a href="https://math.stackexchange.com/q/4897997/25554">A recent Math SE post (since deleted) asked</a>:</p>
<blockquote>
<p>How many different ways are there to color the vertices of the
icosahedron with 3 colors such that no two adjacent vertices have
the same color?</p>
</blockquote>
<p>I would love to know what was going on here. Is this homework? Just
someone idly wondering?</p>
<p>Because the interesting thing about this question is (assuming that
the person knows what an icosahedron is, etc.) it should be solvable
in sixty seconds by anyone who makes the least effort. If you don't
already see it, you should try. Try what? Just take an icosahedron,
color the vertices a little, see what happens. Here, I'll help you
out, here's a view of part of the end of an icosahedron, although I
left out most of it. Try to color it with 3 colors so that no two
adjacent vertices have the same color, surely that will be no harder
than coloring the whole icosahedron.</p>
<p><img src="https://pic.blog.plover.com/math/colored-icosahedron/pentagon.svg" class="center" /></p>
<p>The explanation below is a little belabored, it's what OP
would have discovered in seconds if they had actually tried the
exercise.</p>
<p>Let's color the middle vertex, say blue.</p>
<p><img src="https://pic.blog.plover.com/math/colored-icosahedron/pentagon-2.svg" class="center" /></p>
<p>The five vertices around the edge can't be blue, they must be the
other two colors, say red and green, and the two colors must alternate:</p>
<p><img src="https://pic.blog.plover.com/math/colored-icosahedron/pentagon-3.svg" class="center" /></p>
<p>Ooops, there's no color left for the fifth vertex.</p>
<p><img src="https://pic.blog.plover.com/math/colored-icosahedron/pentagon-4.svg" class="center" /></p>
<p>The phrasing of the question, “how many” makes the problem sound
harder than it is: the answer is zero because we can't even color
<em>half</em> the icosahedron.</p>
<p>If OP had even tried, even a little bit, they could have discovered
this. They didn't need to have had the bright idea of looking at a a
partial icosahedron. They could have grabbed one of the pictures from
Wikipedia and started coloring the vertices. They would have gotten
stuck the same way. They didn't have to try starting in the middle of
my diagram, starting at the edge works too: if the top vertex is blue,
the three below it must be green-red-green, and then the bottom two
are forced to be blue, which isn't allowed. If you <em>just try it</em>, you
win immediately. The only way to lose is not to play.</p>
<p>Before the post was deleted I suggested in a comment “Give it a try,
see what happens”. I genuinely hoped this might be helpful. I'll
probably never know if it was.</p>
<p>Like I said, I would love to know what was going on here. I think
maybe this person could have used a dose of Lower Mathematics.</p>
<p>Just now I wondered for the first time: what would it look like if I
were to try to list the principles of Lower Mathematics? “Try it and
see” is definitely in the list.</p>
<div class="bookbox"><table align=right width="20%" bgcolor="#ffffdd"
border=1><tr><td align=center><A HREF="https://bookshop.org/a/93187/9780691164076"><font
size="-2">Buy</font><br><cite><font>How to Solve It</font></cite><br><IMG SRC="https://images-us.bookshop.org/ingram/9780691164076.jpg?height=250&v=v2" BORDER="0"
ALIGN="center" ALT="(How to Solve It cover missing)" ><br>
<font size="-2">from Bookshop.org<br>(with kickback)</a><br><a href="https://bookshop.org/a/00000/9780691164076">(without kickback)</a></font></a>
</td></tr></table></div>
<p>Then I thought: <em>How To Solve It</em> has that sort of list and something like “try it
and see” is
probably on it. So I took it off the shelf and found: “Draw a
figure”, “If you cannot solve the proposed problem”, “Is it possible
to satisfy the condition?”. I didn't find anything called “fuck
around with it and see what you learn” but it is probably in there
under a different name, I haven't read the book in a long time. To
this important principle I would like to add “fuck around with it and
maybe you will stumble across the answer by accident” as happened
here.</p>
<p>Mathematics education is too much method, not enough heuristic.</p>
Optimal boxes with and without lids
https://blog.plover.com/2024/03/06#optimal-boxes
<p>Sometime around 1986 or so I considered the question of the dimensions
that a closed cuboidal box must have to enclose a given volume
but use as little material as possible. (That is, if its surface area
should be minimized.) It is an elementary calculus exercise and it is
unsurprising that the optimal shape is a cube.</p>
<p>Then I wondered: what if the box is open at the top, so that
it has only five faces instead of six? What are the optimal
dimensions then?</p>
<p>I did the calculus, and it turned out that the optimal lidless box has
a square base like the cube, but it should be exactly half as tall.</p>
<p>For example the optimal box-with-lid enclosing a cubic meter is a
1×1×1 cube with a surface area of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%246%24">.</p>
<p>Obviously if you just cut off the lid of the cubical box and throw it
away you have a one-cubic-meter lidless box with a surface area of
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%24">. But the <em>optimal</em> box-without-lid enclosing a cubic meter is
shorter, with a larger base. It has dimensions $$2^{1/3} \cdot
2^{1/3} \cdot \frac{2^{1/3}}2$$</p>
<p>and a total surface area of only <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243%5ccdot2%5e%7b2%2f3%7d%20%5capprox%204%2e76%24">. It
is what you would get if
you took an optimal complete box, a cube, that enclosed <em>two</em> cubic
meters, cut it in half, and threw the top half away.</p>
<p>I found it striking that the optimal lidless box was the same
proportions as the optimal complete box, except half as tall. I asked
Joe Keane if he could think of any reason why that should be obviously
true, without requiring any calculus or computation. “Yes,” he said.
I left it at that, imagining that at some point I would consider it at
greater length and find the quick argument myself.</p>
<p>Then I forgot about it for a while.</p>
<p>Last week I remembered again and decided it was time to consider it at
greater length and find the quick argument myself. Here's the explanation.</p>
<p>Take the cube and saw it into two equal halves. Each of these is a
lidless five-sided box like the one we are trying to construct. The
original cube enclosed a certain volume with the minimum possible material.
The two half-cubes each enclose half the volume with half the
material.</p>
<p>If there were a way to do better than that, you would be able to make a
lidless box enclose half the volume with <em>less</em> than half the
material. Then you could take two of those and glue them back
together to get a complete box that enclosed the original volume with
less than the original amount of material. But we already knew that
the cube was optimal, so that is impossible.</p>
Math SE report 2023-10: Peano's definition of addition is not a tautology, and what was great about Ramanujan?
https://blog.plover.com/2023/12/02#2023-10
<p>Content warning: grumpy complaining. This was a frustrating month.</p>
<h3><a href="https://math.stackexchange.com/q/4781798/25554">Need an intuitive example for how "P is necessary for Q" means "Q⇒P"?</a></h3>
<p>This kind of thing comes up pretty often. Why are there so many ways that the logical
expression <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%5cimplies%20P%24"> can appear in natural language?</p>
<ul>
<li>If <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24">, then <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"></li>
<li><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24"> implies <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"></li>
<li><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24"></li>
<li><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24"> is sufficient for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"></li>
<li><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> is necessary for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24"></li>
</ul>
<p>Strange, isn't it? <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%5cland%20P%24"> is much simpler: “Both <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> are true” is pretty much it.</p>
<p>Anyway this person wanted an intuitive example of “<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24"> is necessary for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24">”</p>
<p>I suggested:</p>
<blockquote>
<p>Suppose that it is <strong>necessary</strong> to have a ticket (<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24">) in order to
board a certain train (<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24">). That is, <strong>if</strong> you board the train
(<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24Q%24">), <strong>then</strong> you have a ticket (<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24P%24">).</p>
</blockquote>
<p>Again this follows the principle that <em>rule enforcement</em> is a good
thing when you are looking for intuitive examples. Keeping ticketless
people off the train is something that the primate brain is wired up
to do well.</p>
<p>My first draft had “board a train” in place of “board a certain
train”. One commenter complained:</p>
<blockquote>
<p>many people travel on trains without a ticket, worldwide</p>
</blockquote>
<p>I was (and am) quite disgusted by this pettifogging.</p>
<blockquote>
<p>I said “<strong>Suppose that</strong>…”. I was not claiming that the condition applies to every train in all of history.</p>
</blockquote>
<p>OP had only asked for an example, not some universal principle.</p>
<h3><a href="https://math.stackexchange.com/q/4792771/25554">Does ...999.999... = 0?</a></h3>
<p>This person is asking one of those questions that often puts Math
StackExchange into the mode of insisting that the idea is completely
nonsensical, when it is actually very close to perfectly mundane
mathematics. (Previously:
<a href="https://blog.plover.com/misc/half-baked.html">[1]</a>
<a href="https://blog.plover.com/math/se/2023-04.html#half-baked">[2]</a>
<a href="https://blog.plover.com/math/se/2023-02.html#half-baked">[3]</a> ) That <em>didn't</em> happen
this time, which I found very gratifying.</p>
<p>Normally, decimal numerals have a finite integer part on the left of
the decimal point, and an infinite fractional part on the right of the
decimal point, as with (for example) <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%7b13%7d%7b3%7d%20%3d%204%2e333%5cldots%24">.
It turns out to work surprisingly well to reverse this, allowing an
infinite integer part on the left and a finite fractional part on the
right, for example <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac25%20%3d%20%5cldots%20333%2e4%24">. For technical
reasons <a href="https://en.wikipedia.org/wiki/P%2dadic_number">we usually do this in base <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24p%24"> where <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24p%24"> is
prime</a>; it doesn't work as well in base <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2410%24">.
But it works well enough to use: If we have the base-10 numeral
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cldots%209999%2e0%24"> and we add <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24">, using the ordinary
elementary-school right-to-left addition algorithm, the carry in the
units place goes to the tens place as usual, then the next carry goes
to the hundreds place and so on to infinity, leaving us with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cldots%0a0000%2e0%24">, so that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cldots%209999%2e0%24"> can be considered a representation
of the number <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%2d1%24">, and that means we don't need negation signs.</p>
<p>In fact this system is fundamental to the way numbers are represented
in computer arithmetic. Inside the computer the integer <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%2d1%24"> is
literally represented as the base-2 numeral
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2411111111%5c%3b11111111%5c%3b11111111%5c%3b11111111%24">, and when we add <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24"> to
it the carry bit wanders off toward infinity on the left. (In the
computer the numeral is finite, so we simulate infinity by just
discarding the carry bit when it gets too far away.)</p>
<p>Once you've seen this a very reasonable next question is whether you
can have numbers that have an infinite sequence of digits on both
sides. I think something goes wrong here — for one thing it is no
longer clear how to actually do arithmetic. For the
infinite-to-the-left numerals arithmetic is straightforward
(elementary-school algorithms go right-to-left anyway) and for the
standard infinite-to-the-right numerals we can sort of fudge it. (Try
multiplying the infinite decimal for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5csqrt%202%24"> by itself and see
what trouble you get into. Or simpler: What's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%244%2e666%5cldots%20%5ctimes%0a3%24">?)</p>
<p>OP's actual question was: If <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cldots%209999%2e0%20%24"> can be considered to
represent <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%2d1%24">, and if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%2e9999%5cldots%24"> can be considered to
represent <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24">, can we add them and conclude that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cldots%0a9999%2e9999%5cldots%20%3d%200%24">?</p>
<p>This very deserving question got <a href="https://math.stackexchange.com/a/4792785/25554">a good answer from someone who was
not me</a>. This was a
relief, because <em>my</em> shameful answer was pure shitpostery. It should have been
heavily downvoted, but wasn't. The gods of Math SE karma are capricious.</p>
<h3><a href="https://math.stackexchange.com/q/4795154/25554">Why define addition with successor?</a></h3>
<p>Ugh, so annoying. OP had read (Bertrand Russell's explanation of) the
Peano definition of addition, and did not understand it. Several
people tried hard to explain, but communication was not happening.
Or, perhaps, OP was more interested in having an argument than in
arriving at an understanding. I lost a bit of my temper when
they claimed:</p>
<blockquote>
<p>Russell's so-called definition of addition (as quoted in my
question) is nothing but a tautology: ….</p>
</blockquote>
<p>I didn't say:</p>
<blockquote>
<p>If you think Bertrand Russell is stupid, it's because you're stupid.</p>
</blockquote>
<p>although I wanted to at first. The reply I did make is still not as
measured as I would like, and although it leaves this point implicit,
the point is still there. I did at least shut up after that. I had
answered OP's question as well as I was able, and carrying on a
complex discussion in the comments is almost never of value.</p>
<h3><a href="https://math.stackexchange.com/q/4799789/25554">Why is Ramanujan considered a great mathematician?</a></h3>
<p>This was easily my best answer of the month, but the question was
deleted, so you will only be able to see it if you have enough Math SE
reputation.</p>
<p>OP asked a perfectly reasonable question: Ramanujan gets a lot of
media hype for stuff like this:</p>
<p>$${\sqrt {\phi +2}}-\phi ={\cfrac {e^{{-2\pi /5}}}{1+{\cfrac
{e^{{-2\pi }}}{1+{\cfrac {e^{{-4\pi }}}{1+{\cfrac {e^{{-6\pi
}}}{1+\,\cdots }}}}}}}}$$</p>
<p>which is not of any obvious use, so “why is it given such high regard?”</p>
<p>OP appeared to be impugning a famous mathematician, and Math SE always
responds badly to that; their heroes must not be questioned. And even
worse, OP mentioned the notorious non-fact that $$1+2+3+\ldots
=-\frac1{12}$$ which drives Math SE people into a frothing rage.</p>
<p>One commenter argued:</p>
<blockquote>
<p>Mathematics is not inherently about its "usefulness". Even if you
can't find practical use for those formulas, you still have to admit
that they are by no means trivial</p>
</blockquote>
<p>I think this is fatuous. OP is right here, and the commenter is
wrong. Mathematicians are not considered great because they produce
wacky and impractical equations. They are considered great because
they solve problems, invent techniques that answer previously
impossible questions, and because they contribute insights into deep
and complex issues.</p>
<p>Some blockhead even said:</p>
<blockquote>
<p>Most of the mathematical results are useless. Mathematics is more like an art.</p>
</blockquote>
<p>Bullshit. Mathematics is about trying to understand stuff, not about
taping a banana to the wall. I replied:</p>
<blockquote>
<p>I don't think “mathematics is not inherently about its usefulness"
is an apt answer here. Sometimes mathematical results have
application to physics or engineering. But for many mathematical
results the application is to other parts of mathematics, and
mathematicians do judge the ‘usefulness’ of results on this
basis. Consider for example Mochizuki's field of “inter-universal
Teichmüller theory”. This was considered interesting only as long as
it appeared that it might provide a way to prove the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24abc%24">
conjecture. When that hope collapsed, everyone lost interest in it.</p>
</blockquote>
<p>My answer to OP elaborated on this point:</p>
<blockquote>
<p>The point of these formulas wasn't that they were useful in
themselves. It's that in order to find them he had to have a deep
understanding of matters that were previously unknown. His
contribution was the deep understanding.</p>
</blockquote>
<p>I then discussed Hardy's book on the work he did with Ramanujan and
<a href="https://archive.org/details/dli.csl.3438">Hardy's own estimation of Ramanujan's work</a>:</p>
<blockquote>
<p>The first chapter is somewhat negative, as it summarizes the parts
of Ramanujan's work that he felt didn't have lasting value — because
Hardy's next eleven chapters are about the work that he felt <em>did</em>
have value.</p>
</blockquote>
<p>So if OP wanted a substantive and detailed answer to their question,
that would be the first place to look.</p>
<p>I also did an arXiv search for “Ramanujan” and found many recent
references, including one with “applications to the Ramanujan
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%cf%84%24">-function”, and concluded:</p>
<blockquote>
<p><a href="https://en.wikipedia.org/wiki/Ramanujan_tau_function">The
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5ctau%24">-function</a>
is the subject of the entire chapter 10 of Hardy's book and appears
to still be of interest as recently as last Monday.</p>
</blockquote>
<p>The question was closed as “opinion-based” (a criticism that I
think my answer completely demolishes) and then it was deleted. Now
if someone else trying to find out why Ramanujan is held in high regard
they will not be able to find my factual, substantive answer.</p>
<p>Screw you, Math SE. This month we both sucked.</p>
Uncountable sets for seven-year-olds
https://blog.plover.com/2023/11/27#uncountable-hotel
<p>I was recently talking to a friend whose seven-year old had been
reading about
<a href="https://en.wikipedia.org/wiki/Hilbert%27s_paradox_of_the_Grand_Hotel">the Hilbert Hotel paradoxes</a>.
One example: The hotel is completely full when a bus arrives with 53
passengers seeking rooms. Fortunately the hotel has a countably
infinite number of rooms, and can easily accomodate 53 more guests
even when already full.</p>
<p>My friend mentioned that his kid had been unhappy with the associated
discussion of <em>uncountable</em> sets, since the explanation he got
involved something about people
whose names are infinite strings, and it got confusing. I said yes,
that is a bad way to construct the example, because names are <em>not</em>
infinite strings, and even one infinite string is hard to get your
head around. If you're going to get value out of the hotel metaphor,
you waste an opportunity if you abandon it for some weird mathematical
abstraction. (“Okay, Tyler, now let <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cmathscr%20B%24"> be a projection from a
vector bundle onto a compact Hausdorff space…”)</p>
<p>My first attempt on the spur of the moment involved the guests
belonging to clubs, which meet in an attached convention center with a
countably infinite sequence of meeting rooms. The club idea is good
but my original presentation was overcomplicated and after thinking
about the issue a little more I sent this email with my ideas for
how to explain it to a bright seven-year-old.</p>
<hr />
<p>Here's how I think it should go. Instead of a separate hotel and
convention center, let's just say that during the day the guests
vacate their rooms so that clubs can meet in the same rooms. Each
club is assigned one guest room that they can use for their meeting
between the hours of 10 AM to 4 PM. The guest has to get out of the
room while that is happening, unless they happen to be a member of the
club that is meeting there, in which case they may stay.</p>
<p>If you're a guest in the hotel, you might be a member of the club that
meets in your room, or you might not be a member of the club that
meets in your room, in which case you have to leave and go to a
meeting of one of your clubs in some other room.</p>
<p>We can paint the guest room doors blue and green: blue, if the guest
there is a member of the club that meets in that room during the day,
and green if they aren't. Every door is now painted blue or green,
but not both.</p>
<p>Now I claim that when we were assigning clubs to rooms, there was a
club we missed that has nowhere to meet. It's the Green Doors Club of
all the guests who are staying in rooms with green doors.</p>
<p>If we did assign the Green Doors Club a guest room in which to meet,
that door would be painted green or blue.</p>
<p>The Green Doors Club isn't meeting in a room with a blue door. The
Green Doors Club only admits members who are staying in rooms with
<em>green</em> doors. That guest belongs to the club that meets in
their room, and it isn't the Green Doors Club because the guest's door is
blue.</p>
<p>But the Green Doors Club isn't meeting in a room with a green door.
We paint a door green when the guest is <em>not</em> a member of the club
that meets in their room, and this guest <em>is</em> a member of the Green
Doors Club.</p>
<p>So however we assigned the clubs to the rooms, we must have missed out
on assigning a room to the Green Doors Club.</p>
<p>One nice thing about this is that it works for finite hotels too. Say
you have a hotel with 4 guests and 4 rooms. Well, obviously you can't
assign a room to each club because there are 16 possible clubs and
only 4 rooms. But the blue-green argument still works: you can assign
any four clubs you want to the four rooms, then paint the doors, then
figure out who is in the Green Doors Club, and then observe that, in
fact, the Green Doors Club is not one of the four clubs that got a
room.</p>
<p>Then you can reassign the clubs to rooms, this time making sure that
the Green Doors Club gets a room. But now you have to repaint the
doors, and when you do you find out that membership in the Green Doors
Club has changed: some new members were admitted, or some former
members were expelled, so the club that meets there is no longer the
Green Doors Club, it is some other club. (Or if the Green Doors Club
is meeting somewhere, you will find that you have painted the doors
wrong.)</p>
<hr />
<p>I think this would probably work. The only thing that's weird about
it is that some clubs have an infinite number of members so that it's
hard to see how they could all squeeze into the same room. That's
okay, not every member attends every meeting of every club they're in,
that would be impossible anyway because everyone belongs to multiple
clubs.</p>
<p>But one place you could go from there is: what if we only guarantee
rooms to clubs with a <em>finite</em> number of members? There are only a
countably infinite number of clubs then, so they do all fit into the
hotel! Okay, Tyler, but what happens to the Green Door Club then?
I said all the finite clubs got rooms, and we know the Green Door Club
<em>never</em> gets a room, so what can we conclude?</p>
<p>It's tempting to try to slip in a reference to Groucho Marx, but I
think it's unlikely that that will do anything but confuse matters.</p>
<p>[ <a href="https://blog.plover.com/math/russell.html">Previously</a> ]</p>
<p>[ Update: My friend said he tried it and it didn't go over as well as I thought it might. ]</p>
Math SE report 2023-09: Sense and reference, Wason tasks, what is a sequence?
https://blog.plover.com/2023/11/24#2023-09
<h3><a href="https://math.stackexchange.com/q/4738482/25554">Proving there is only one proof?</a></h3>
<p>OP asks:</p>
<blockquote>
<p>In mathematics, is it possible to prove that there is only one
(shortest) proof of a given theorem (say, in ZFC)?</p>
</blockquote>
<p>This was actually from back in July, when there was a fairly
substantive answer. But it left out what I thought was a simpler,
non-substantive answer: For a given theorem <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T%24"> it's actually quite
simple to prove that there is (or isn't) only one proof of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T%24">: just
generate all possible proofs in order by length until you find the
shortest proofs of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T%24">, and then stop before you generate anything
longer than those. There are difficult and subtle issues in
provability theory, but this isn't one of them.</p>
<p>I say “non-substantive” because it doesn't address any of the possibly
interesting questions of why a theorem would have only one proof, or
multiple proofs, or what those proofs would look like, or anything
like that. It just answers the question given: is it possible to
prove that there is only one shortest proof.</p>
<p>So depending on what OP was looking for, it might be very
unsatisfying. Or it might be hugely enlightening, to discover that
this seemingly complicated question actually has a simple answer,
just because proofs can be systematically enumerated.</p>
<p>This comes in handy in more interesting contexts. Gödel showed that
arithmetic contains a theorem whose shortest proof is at least one million steps
long! He did it by constructing an arithmetic formula <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24G%24"> which can
be interpreted as saying:</p>
<blockquote>
<p><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24G%24"> cannot be proved in less than one million steps.</p>
</blockquote>
<p>If <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24G%24"> is false, it can be proved (in less than one million steps)
and our system is inconsistent. So assuming that our axioms are
consistent, then <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24G%24"> is true and either:</p>
<ol>
<li>There is no proof of at all of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24G%24">, or</li>
<li>There are proofs of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24G%24"> but the shortest one is at least a million steps</li>
</ol>
<p>Which is it? It can't be (1) because there <em>is</em> a proof of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24G%24">:
simply generate every single proof of one million steps or fewer, and
check at the last line of each one to make sure that it is not <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24G%24">.
So it must be (2).</p>
<h3><a href="https://math.stackexchange.com/q/4761970/25554">What counts as a sequence, and how would we know that it isn't deceiving?</a></h3>
<p>This is a philosophical question: What is a sequence, really? And:</p>
<blockquote>
<p>if I write down random numbers with no pattern at all
except for the fact that it gets larger, is it a viable
sequence?</p>
</blockquote>
<p>And several other related questions that are actually rather
subtle: Is a sequence defined by its elements, or by some
external rule? If the former how can you know when a
sequence is linear, when you can only hope to examine a
finite prefix?</p>
<p>I this is a great question because I think a sequence, properly
construed, is <em>both</em> a rule <em>and</em> its elements. The definition says
that a sequence of elements of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24S%24"> is simply a function <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24f%3a%5cBbb%0aN%5cto%20S%24">. This definition is a sort of spherical cow: it's a nice,
simple model that captures many of the mathematical essentials of the
thing being modeled. It works well for many purposes, but you get
into trouble if you forget that it's just a model. It captures the
denotation, but not the <em>sense</em>. I wouldn't yak so much about this if
it wasn't so often forgotten. But the sense is the interesting part.
If you forget about it, you lose the ability to ask questions like</p>
<blockquote>
<p>Are sequences <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24s_1%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24s_2%24"> the same sequence?</p>
</blockquote>
<p>If all you have is the denotation, there's only one way to answer this
question:</p>
<blockquote>
<p>By definition, yes, if and only if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24s_1%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24s_2%24"> are the same function.</p>
</blockquote>
<p>and there is nothing further to say about it. The question is
pointless and the answer is useless. Sometimes the meaning is hidden
a little deeper. Not this time. If we push down into the denotation,
hoping for meaning, we find nothing but more emptiness:</p>
<blockquote>
<p>Q: What does it mean to say that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24s_1%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24s_2%24"> are the same
function?</p>
<p>A: It means that the sets
$$S_1 = \{ \langle i, s_1(i) \rangle \mid i\in \Bbb N\}$$
and
$$S_2 = \{ \langle i, s_2(i) \rangle \mid i\in \Bbb N\}$$
have exactly the same elements.</p>
</blockquote>
<p>We could keep going down this road, but it goes nowhere and having
gotten to the end we would have seen nothing worth seeing.</p>
<p>But we do ask and answer this kind of question <em>all the time</em>. For example:</p>
<ol>
<li><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24S_1%28n%29%24"> is the infinite sequence of odd numbers starting at <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24"></li>
<li><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24S_2%28n%29%24"> is the infinite sequence of numbers that are the
difference between a square and its previous square, starting at <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%5e2%2d0%5e2%24"></li>
</ol>
<p>Are sequences <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24S_1%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24S_2%24"> the same sequence? Yes, yes, of
course they are, don't focus on the answer. Focus on the question!
What is this question <em>actually asking</em>? </p>
<p>The real essence of the question is not about the denotation, about
just the elements. Rather: we're given descriptions of two possible
computations, and the question is asking if these two computations
will arrive at the same results in each case. That's the <em>real</em>
question.</p>
<p>Well, I started this blog article back in October and it's still not
ready because I got stuck writing about this question. I think the
answer I gave on SE is pretty good, OP asked what is essentially a
philosophical question and the backbone of my answer is on the level
of philosophy rather than mathematics.</p>
<p>[ Addendum: On review, I am pleasantly surprised that this section of
the blog post turned out both coherent and relevant. I really
expected it to be neither. A Thanksgiving miracle! ]</p>
<h3><a href="https://math.stackexchange.com/q/4762191/25554">Can inequalities be added the way that equations can be added?</a></h3>
<p>OP says:</p>
<blockquote>
<p>Suppose you have <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%20%2b%20y%20%3e%206%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%20%2d%20y%20%3e%204%24">. Adding
the inequalities, the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24y%24"> terms cancel and you end up
with … <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%20%3e%205%24">. It is not intuitively obvious to me
that this holds true … I can see that you can't subtract
inequalities, but is it always okay to add them?</p>
</blockquote>
<p>I have a theory that if someone is having trouble with the intuitive
meaning of some mathematical property, it's a good idea to turn it
into a question about fair allocation of resources, or who has more
of some commodity, because human brains are good at monkey tasks like
seeing who got cheated when the bananas were shared out.</p>
<p>About ten years ago someone asked for an intuitive
explanation of why you could add <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20a2%24"> to both sides
of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20a2%20%3c%20%5cfrac%20b2%24"> to get <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20a2%2b%5cfrac%20a2%20%3c%0a%5cfrac%20a2%20%2b%20%5cfrac%20b2%24">. I said:</p>
<blockquote>
<p>Say I have half a bag of cookies, that's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20a2%24">
cookies, and you have half a carton of cookies, that's
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20b2%24"> cookies, and the carton is bigger than the bag,
so you have more than me, so that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20a2%20%3c%20%5cfrac%20b2%24">.</p>
<p>Now a friendly djinn comes along and gives you another
half a bag of cookies, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20a2%24">. And to be fair he
gives me half a bag too, also <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20a2%24">.</p>
<p>So you had more cookies before, and the djinn gave each of
us an extra half a bag. Then who has more <em>now</em>?</p>
</blockquote>
<p>I tried something similar this time around:</p>
<blockquote>
<p>Say you have two bags of cookies, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24">. A
friendly baker comes by and offers to trade with you: you
will give the baker your bag <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> and in return you will
get a larger bag <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24c%24"> which contains <strong>more
cookies</strong>. That is, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%20a%20%5clt%20c%20%24">. You like cookies, so you
agree.</p>
</blockquote>
<p>Then the baker also trades your bag <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24"> for a bigger bag
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24d%24">.</p>
<blockquote>
<p>Is it possible that you might not have more cookies than
before you made the trades? … But that's what it would
mean if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%20a%5clt%20c%20%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%20b%5clt%20d%20%24"> but not <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%20a%2bb%20%5clt%20c%2bd%20%24"> too.</p>
</blockquote>
<p>Someday I'll write up a whole blog article about this idea,
that puzzles in arithmetic sometimes become intuitively
obvious when you turn them into questions about money or
commodities, and that puzzles in logic sometimes become
intuitively obvious when you turn them into questions about
contract and rule compliance.</p>
<p>I don't remember why I decided to replace the djinn with a
baker this time around. The cookies stayed the same though.
I like cookies. Here's another cookie example, <a href="https://math.stackexchange.com/a/1230008/25554">this time
to explain why <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%5cdiv%200%2e5%20%3d%0a2%24"></a>.</p>
<h3><a href="https://math.stackexchange.com/q/4765635/25554">What is the difference between "for all" and "there exists" in set builder notation?</a></h3>
<p>This is the same sort of thing again. OP was was asking
about</p>
<p>$$B = \{n \in \mathbb{N} : \forall x \in \mathbb{N} \text{ and } n=2^x\}$$</p>
<p>but attempting to understand this is trying to swallow two
pills at once. One pill is the logic part (what role is the
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cforall%24"> playing) and the other pill is the arithmetic
part having to do with powers of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">. If you're trying to
understand the logic part and you don't have an
instantaneous understanding of powers of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">,
it can be helpful to simplify matters by replacing the
arithmetic with something you understand intuitively.
In place of the relation <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%20%3d%202%5eb%24"> I like to use
the relation “<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> is the mother of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24">”, which everyone
already knows.</p>
<h3><a href="https://math.stackexchange.com/q/4775987/25554">Are infinities included in the closure of the real set <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5coverline%7b%5cmathbb%7bR%7d%7d%24"></a></h3>
<p>This is a good question by the Chip Buchholtz criterion: The answer is
much longer than the question was. OP wants to know if the closure of
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cBbb%20R%24"> is just <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cBbb%20R%24"> or if it's some larger set like
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5b%2d%5cinfty%2c%20%5cinfty%5d%24">. They are running up against the idea that
topological closure is not an absolute notion; it only makes sense in
the context of an enclosing space.</p>
<p>I tried to draw an analogy between the closure and the
complement of a set: Does the complement of the real numbers
include the number <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24i%24">? Well, it depends on the context.</p>
<p>OP preferred someone else's answer, and I did too, <a href="https://math.stackexchange.com/questions/4775987/are-infinities-included-in-the-closure-of-the-real-set-overline-mathbbr/4776001#comment10148087_4776001">saying</a>:</p>
<blockquote>
<p>I thought your answer was better because it hit all the
important issues more succinctly!</p>
</blockquote>
<p>I try to make things very explicit, but the downside of
that is that it makes my answers longer, and shorter is
generally better than longer. Sometimes it works, and
sometimes it doesn't.</p>
<h3><a href="https://math.stackexchange.com/q/4777350/25554">Vacuous falsehood - does it exist, and are there examples?</a></h3>
<p>I really liked this question because <em>I</em> learned something
from it. It brought me up short: “Huh,” I said. “I never
thought about that.” Three people downvoted the question, I
have no idea why.</p>
<p>I didn't know what a vacuous falsity would be either but I
decided that since the negation of a vacuous truth would be
false it was probably the first thing to look at. I pulled
out my stock example of vacuous truth, which is:</p>
<blockquote>
<p>All my rubies are red.</p>
</blockquote>
<p>This is true, because all rubies are red, but vacuously so
because I don't own any rubies.</p>
<p>Since this is a vacuous truth, negating it ought to give us
a vacuous falsity, if there is such a thing:</p>
<blockquote>
<p>I have a ruby that isn't red.</p>
</blockquote>
<p>This is indeed false. And not in the way one would expect!
A more typical false claim of this type would be:</p>
<blockquote>
<p>I have a belt that isn't leather.</p>
</blockquote>
<p>This is also false, in rather a different way. It's false,
but not vacuously so, because to disprove it you have to
get my belts out of the closet and examine them.</p>
<p>Now though I'm not sure I gave the right explanation in my
answer. I said:</p>
<blockquote>
<p>In the vacuously false case we don't even need to read the second half of the sentence:</p>
<pre><code>there is a ruby in my vault that …
</code></pre>
<p>…
The irrelevance of the “…is not red” part is mirrored exactly in the irrelevance of the “… are red” part in the vacuously true statement:</p>
<pre><code>all the rubies in my vault are …
</code></pre>
</blockquote>
<p>But is this the right analogy? I could have gone the other
way:</p>
<blockquote>
<p>In the vacuously false case we don't even need to read the first half of the sentence:</p>
<pre><code>there is a ruby … that is not red
</code></pre>
<p>…
The irrelevance of the “… in my vault …” part is mirrored exactly in the irrelevance of the “… are red” part in the vacuously true statement:</p>
<pre><code>all the rubies in my vault are …
</code></pre>
</blockquote>
<p>Ah well, this article has been drying out on the shelf for a month
now, I'm making an editorial decision to publish it without thinking
about it any more.</p>
The discrete logarithm, shorter and simpler
https://blog.plover.com/2023/10/20#irish-logarithm-4
<p><a href="https://blog.plover.com/math/irish-logarithm-3.html">I recently discussed the “discrete logarithm”</a>
method for multiplying integers, and I feel like I took too long and
made it seem more complicated and mysterious than it should have been. I
think I'm going to try again.</p>
<p>Suppose for some reason you found yourself needing to multiply a lot
of powers of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">. What's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%244096%c2%b7512%24">? You could use the
conventional algorithm:</p>
<p>$$
\begin{array}{cccccccc}
& & & & 4 & 0 & 9 & 6 \\
× & & & & & 5 & 1 & 2 \\ \hline
%
& & & & 8 & 1 & 9 & 2 \\
& & & 4 & 0 & 9 & 6 & \\
& 2 & 0 & 4 & 8 & 0 & & \\ \hline
%
& 2 & 0 & 9 & 7 & 1 & 5 & 2
\end{array}
$$</p>
<p>but that's a lot of trouble, and a simpler method is available. You
know that $$2^i\cdot 2^j = 2^{i+j}$$</p>
<p>so if you had an easy way to convert $$2^i\leftrightarrow i$$ you
could just convert the factors to exponents, add the exponents, and
convert back. And all that's needed is a simple table:</p>
<p>\begin{array}{rr}
0 & 1\\
1 & 2\\
2 & 4\\
3 & 8\\
4 & 16\\
5 & 32\\
6 & 64\\
7 & 128\\
8 & 256\\
9 & 512\\
10 & 1\,024\\
11 & 2\,048\\
12 & 4\,096\\
13 & 8\,192\\
14 & 16\,384\\
15 & 32\,768\\
16 & 65\,536\\
17 & 131\,072\\
18 & 262\,144\\
19 & 524\,288\\
20 & 1\,048\,576\\
21 & 2\,097\,152\\
\vdots & \vdots \\
\end{array}</p>
<p>We check the table, and find that $$4096\cdot512 = 2^{12}\cdot 2^9 =
2^{12+9} = 2^{21} = 2097152.$$ Easy-peasy.</p>
<p>That is all very well but how often do you find yourself having to
multiply a lot of powers of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">? This was a lovely algorithm but with very
limited application.</p>
<p>What Napier
(<a href="https://en.wikipedia.org/wiki/John_Napier">the inventor of logarithms</a>)
realized was that while not every number is an integer power of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">,
every number <em>is</em> an integer power of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%2e00001%24">, or nearly so. For
example, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2423%24"> is very close to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%2e00001%5e%7b313%5c%2c551%7d%24">. Napier made
up a table, just like the one above, except with powers of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%2e00001%24">
instead of powers of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">. Then to multiply <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5ccdot%20y%24"> you would
just find numbers close to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24y%24"> in Napier's table and use
the same algorithm. (Napier's original table used powers of
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%2e9999%24">, but it works the same way for the same reason.)</p>
<p>There's another way to make it work. Consider the integers mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">,
called <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cBbb%20Z_%7b101%7d%24">. In <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cBbb%20Z_%7b101%7d%24">, every number <em>is</em> an integer power of
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">‍!</p>
<p>For example, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2427%24"> is a power of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">. It's simply <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5e7%24">, because
if you multiply out <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5e7%24"> you get <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24128%24">, and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24128%5cequiv%0a27%5cpmod%7b101%7d%24">.</p>
<p>Or:</p>
<p>$$\begin{array}{rcll}
14 & \stackrel{\pmod{101}}{\equiv} & 10\cdot 101 & + 14 \\
& = & 1010 & + 14 \\
& = & 1024 \\
& = & 2^{10}
\end{array}
$$</p>
<p>Or:</p>
<p>$$\begin{array}{rcll}
3 & \stackrel{\pmod{101}}{\equiv} & 5844512973848570809\cdot 101 & + 3 \\
& = & 590295810358705651709 & + 3 \\
& = & 590295810358705651712 \\
& = & 2^{69}
\end{array}
$$</p>
<p>Anyway that's the secret. In <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cBbb%20Z_%7b101%7d%24"> the silly algorithm
that quickly multiplies powers of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> becomes more practical,
because in <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cBbb%20Z_%7b101%7d%24">, every number is a power of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">.</p>
<p>What works for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> works in other cases larger and more
interesting. It doesn't work to replace <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> (try
it and see what goes wrong), but <a href="https://oeis.org/A001122">we <em>can</em> replace it with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24107%2c%20797%24">, or
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24297779%24"></a>. The key is that if we want to replace <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"> and
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24">, we need to be sure that there is a solution to
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%5ei%3db%5cpmod%20n%24"> for every possible <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24">. (The jargon term here is
that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> must be a
“<a href="https://en.wikipedia.org/wiki/Primitive_root_modulo_n">primitive root mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"></a>”.
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> is a primitive root mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">, but not mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24">.)</p>
<p>Is this actually useful for multiplication? Perhaps not, but it does
have cryptographic applications. Similar to how multiplying is easy
but factoring seems difficult, computing <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%5ei%5cpmod%20n%24"> for given <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%2c%0ai%2c%20n%24"> is easy, but nobody knows a quick way in general to reverse the
calculation and compute the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24i%24"> for which <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%5ei%5cpmod%20n%20%3d%20m%24"> for a
given <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24m%24">. When <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"> is small we can simply construct a lookup
table with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%2d1%24"> entries. But if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"> is a <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24600%24">-digit number,
the table method is impractical. Because of this, Alice and Bob can
find a way to compute a number <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5ei%24"> that they both know, but
someone else, seeing <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5ei%24"> can't easily figure out what the original
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24i%24"> was. See
<a href="https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">Diffie-Hellman key exchange</a>
for more details.</p>
<p>[ Also previously: <a href="https://blog.plover.com/math/irish-logarithm.html">Percy Ludgate's weird variation on this</a> ]</p>
The discrete logarithm
https://blog.plover.com/2023/10/15#irish-logarithm-3
<p>[ Addendum 20231020: This came out way longer than it needed to be, so I
took another shot at it, and wrote <a href="https://blog.plover.com/math/irish-logarithm-4.html">a much simpler explanation of the
same thing</a> that is
only one-third as long. ]</p>
<p>A couple days ago I discussed
<a href="https://blog.plover.com/math/irish-logarithm.html">the weird little algorithm of Percy Ludgate's</a>,
for doing single-digit multiplication using a single addition and
three scalar table lookups. In Ludgate's algorithm, there were two
tables, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24">, satisfying the following properties:</p>
<p>$$
\begin{align}
T_2(T_1(n)) & = n \tag{$\color{darkgreen}{\spadesuit}$} \\
T_2(T_1(a) + T_1(b)) & = ab. \tag{$\color{purple}{\clubsuit}$}
\end{align}
$$</p>
<p>This has been called the “Irish logarithm” method because of its
resemblance to ordinary logarithms. Normally in doing logarithms we have a magic logarithm
function <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%24"> with these properties:</p>
<p>$$
\begin{align}
\ell^{-1}(\ell(n)) & = n \tag{$\color{darkgreen}{\spadesuit}$} \\
\ell^{-1}(\ell(a) + \ell(b)) & = ab. \tag{$\color{purple}{\clubsuit}$}
\end{align}
$$</p>
<p>(The usual notation for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%28x%29%24"> is of course “<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5clog%20x%24">” or “<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cln%20x%24">”
or something of that sort, and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%28x%29%24"> is usually written <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24e%5ex%24">
or <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2410%5ex%24">.)</p>
<p>The properties of Ludgate's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> are formally
identical, with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> playing the role of the logarithm function
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> playing the role of its inverse <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24">.
Ludgate's versions are highly restricted, to reduce the computation to
something simple enough that it can be implemented with brass gears.</p>
<p>Both <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> map positive integers to positive integers,
and can be implemented with finite lookup tables. The ordinary
logarithm does more, but is technically much more difficult. With the
ordinary logarithm you are not limited to multiplying single digit
integers, as with Ludgate's weird little algorithm. You can multiply
any two real numbers, and the multiplication still requires only one
addition and three table lookups. But the cost is huge!
The tables are much larger and more complex, and to use them
effectively you have to deal with fractional numbers, perform table
interpolation, and worry about error accumulation.</p>
<p>It's tempting at this point to start explaining the history and use of
logarithm tables, slide rules, and so on, but this article has already
been delayed once, so I will try to resist. I will do just one
example, with no explanation, to demonstrate the flavor. Let's
multiply <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2413%24">.</p>
<ol>
<li><p>I look up <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> in my table of logarithms and find that
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5clog_%7b10%7d%207%20%5capprox%200%2e84510%24">.<br>
<a href="https://pic.blog.plover.com/math/irish-logarithm-3/7000.png"><img src="https://pic.blog.plover.com/math/irish-logarithm-3/7000-th.png"
class="center" alt="Small section of a page from a book of log
tables with 7.000 and its logarithm highlighted"/></a></p></li>
<li><p>I look up <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2413%24"> similarly and find that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5clog_%7b10%7d%2013%20%5capprox%0a%20%20%201%2e11394%24">.
<a href="https://pic.blog.plover.com/math/irish-logarithm-3/1300.png"><img src="https://pic.blog.plover.com/math/irish-logarithm-3/1300-th.png"
class="center" alt="Small section of a page from a book of log
tables with 1.300 and its logarithm highlighted"/></a></p></li>
<li><p>I add <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%2e84510%20%2b%201%2e1394%20%3d%201%2e95904%24">.</p></li>
<li><p>I do a reverse lookup on <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%2e95904%24"> and find that the result is
approximately <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2491%2e00%24">.
<a href="https://pic.blog.plover.com/math/irish-logarithm-3/9100.png"><img src="https://pic.blog.plover.com/math/irish-logarithm-3/9100-th.png"
class="center" alt="Small section of a page from a book of log
tables with 9.100 and its logarithm highlighted"/></a></p></li>
</ol>
<p>If I were multiplying <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%2e236%24"> by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2413%2e877%24">, I would be willing to
accept all these costs, and generations of scientists and engineers
did accept them. But for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%2e0000%c3%9713%2e000%20%3d%2091%2e000%24"> the process is ridiculous.
One might wonder if there wasn't some analogous technique that would
retain the small, finite tables, and permits multiplication of
integers, using only integer calculations throughout. And there is!</p>
<p>Now I am going to demonstrate an algorithm, based on logarithms, that
<em>exactly</em> multiplies any two integers <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24">, as long as
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24ab%20%e2%89%a4%20100%24">.
Like Ludgate's and the standard algorithm, it will use one
addition and three lookups in tables. Unlike the standard algorithm,
the tables will be small, and will contain only integers.</p>
<p>Here is the table of the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%24"> function, which
corresponds to Ludgate's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24">:</p>
<p>$$
\begin{array}{rrrrrrrrrrr}
{\tiny\color{gray}{1}} & 0, & 1, & \color{darkblue}{69}, & 2, & 24, & 70, & \color{darkgreen}{9}, & 3, & 38, & 25, \\
{\tiny\color{gray}{11}} & 13, & \color{darkblue}{71}, & \color{darkgreen}{66}, & 10, & 93, & 4, & 30, & 39, & 96, & 26, \\
{\tiny\color{gray}{21}} & 78, & 14, & 86, & 72, & 48, & 67, & 7, & 11, & 91, & 94, \\
{\tiny\color{gray}{31}} & 84, & 5, & 82, & 31, & 33, & 40, & 56, & 97, & 35, & 27, \\
{\tiny\color{gray}{41}} & 45, & 79, & 42, & 15, & 62, & 87, & 58, & 73, & 18, & 49, \\
{\tiny\color{gray}{51}} & 99, & 68, & 23, & 8, & 37, & 12, & 65, & 92, & 29, & 95, \\
{\tiny\color{gray}{61}} & 77, & 85, & 47, & 6, & 90, & 83, & 81, & 32, & 55, & 34, \\
{\tiny\color{gray}{71}} & 44, & 41, & 61, & 57, & 17, & 98, & 22, & 36, & 64, & 28, \\
{\tiny\color{gray}{81}} & \color{darkred}{76}, & 46, & 89, & 80, & 54, & 43, & 60, & 16, & 21, & 63, \\
{\tiny\color{gray}{91}} & 75, & 88, & 53, & 59, & 20, & 74, & 52, & 19, & 51, & 50\hphantom{,} \\
\end{array}
$$</p>
<p>(If we only want to multiply numbers with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%5cle%20a%2c%20b%20%5cle%209%24"> we only
need the first row, but with the full table we can also compute things
like <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%c2%b713%3d91%24">.)</p>
<p>Like <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24">, this is not really a two-dimensional array. It just a
list of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24100%24"> numbers, arranged in rows to make it easy to find the
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2481%24">st number when you need it. The small gray numerals in the
margin are a finding aid. If you want to look up <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%2881%29%24"> you can
see that it is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5ccolor%7bdarkred%7d%7b76%7d%24"> without having to count up
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2481%24"> elements. This element is highlighted in red in the table
above.</p>
<p>Note that the elements are numbered from <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24"> to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24100%24">, whereas all
the other tables in these articles have been zero-indexed. I wondered
if there was a good way to fix this, but there really isn't. <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%24">
is analogous to a logarithm function, and the one thing a logarithm
function really must do is to have <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5clog%201%20%3d%200%24">. So too here; we
have <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%281%29%20%3d%200%24">.</p>
<p>We also need an <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24"> table analogous to Ludgate's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24">:</p>
<p>$$
\begin{array}{rrrrrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, & 27, & 54, & 7, \\
{\tiny\color{gray}{10}} & 14, & 28, & 56, & 11, & 22, & 44, & 88, & 75, & 49, & 98, \\
{\tiny\color{gray}{20}} & 95, & 89, & 77, & 53, & 5, & 10, & 20, & 40, & 80, & 59, \\
{\tiny\color{gray}{30}} & 17, & 34, & 68, & 35, & 70, & 39, & 78, & 55, & 9, & 18, \\
{\tiny\color{gray}{40}} & \color{darkblue}{36}, & 72, & 43, & 86, & 71, & 41, & 82, & 63, & 25, & 50, \\
{\tiny\color{gray}{50}} & 100, & 99, & 97, & 93, & 85, & 69, & 37, & 74, & 47, & 94, \\
{\tiny\color{gray}{60}} & 87, & 73, & 45, & 90, & 79, & 57, & 13, & 26, & 52, & 3, \\
{\tiny\color{gray}{70}} & 6, & 12, & 24, & 48, & 96, & \color{darkgreen}{91}, & \color{darkred}{81}, & 61, & 21, & 42, \\
{\tiny\color{gray}{80}} & 84, & 67, & 33, & 66, & 31, & 62, & 23, & 46, & 92, & 83, \\
{\tiny\color{gray}{90}} & 65, & 29, & 58, & 15, & 30, & 60, & 19, & 38, & 76, & 51\hphantom{,} \\
\end{array}
$$</p>
<p>Like <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24">, this is just a list of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24100%24"> numbers in
order.</p>
<p>As the notation suggests, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%24"> are inverses. We
already saw that the first table had <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%2881%29%3d%5ccolor%7bdarkred%7d%7b76%7d%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%281%29%20%3d%0a0%24">. Going in the opposite direction, we see from the second table
that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%2876%29%3d%20%5ccolor%7bdarkred%7d%7b81%7d%24"> (again in red) and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%280%29%3d1%24">.
The elements of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%24"> tell you where to find numbers in the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24">
table. Where is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2417%24"> in the second table? Look at the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2417%24">th
element in the first table. <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%2817%29%20%3d%2030%24">, so <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2417%24"> is at
position <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2430%24"> in the second table.</p>
<p>Before we go too deeply into how these were constructed, let's
try the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%c3%9713%24"> example we did before. The algorithm is just
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5ccolor%7bpurple%7d%7b%5cclubsuit%7d%24">:</p>
<p>$$
\begin{align}
% \ell^{-1}(\ell(a) + \ell(b)) & = ab\tag{$\color{purple}{\clubsuit}$} \\
7·13 &= \ell^{-1}(\ell(7) + \ell(13)) \\
&= \ell^{-1}(\color{darkgreen}{9} + \color{darkgreen}{66}) \\
&= \ell^{-1}(75) \\
&= \color{darkgreen}{91}
\end{align}
$$</p>
<p>(The relevant numbers are picked out in green in the two tables.)</p>
<p>As promised, with three table lookups and a single integer addition.</p>
<p>What if the sum in the middle exceeds <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2499%24">? No problem, the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24">
table wraps around, so that element <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24100%24"> is the same as element <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%24">:</p>
<p>$$
\begin{align}
% \ell^{-1}(\ell(a) + \ell(b)) & = ab\tag{$\color{purple}{\clubsuit}$} \\
3·12 &= \ell^{-1}(\ell(3) + \ell(12)) \\
&= \ell^{-1}(\color{darkblue}{69} + \color{darkblue}{71}) \\
&= \ell^{-1}(140) \\
&= \ell^{-1}(40) &\text{(wrap around)}\\
&= \color{darkblue}{36}
\end{align}
$$</p>
<p>How about that.</p>
<p>(This time the relevant numbers are picked out in blue.)</p>
<p>I said this only computes <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24ab%24"> when the product is at most <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24100%24">.
That is not quite true. If you are willing to ignore a small detail,
this algorithm will multiply <em>any</em> two numbers. The small detail is
that the multiplication will be done mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">. That is, instead of the
exact answer, you get one that differs from it by a multiple of
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">. Let's do an example to see what I mean when I say it works
even for products bigger than <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24100%24">:</p>
<p>$$
\begin{align}
% \ell^{-1}(\ell(a) + \ell(b)) & = ab\tag{$\color{purple}{\clubsuit}$} \\
16·26 &= \ell^{-1}(\ell(16) + \ell(26)) \\
&= \ell^{-1}(4 + 67) \\
&= \ell^{-1}(71) \\
&= 12
\end{align}
$$</p>
<p>This tell us that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2416%c2%b726%20%3d%2012%24">. The correct answer is actually
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2416%c2%b726%20%3d%20416%24">, and indeed <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24416%2d12%20%3d%20404%24"> which is a multiple of
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">.
The reason this happens is that the elements of the second table, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24">,
are not true integers, they are mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> integers.</p>
<p>Okay, so what is the secret here? Why does this work? It should jump
out at you that it is often the case that an entry in the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24">
table is twice the previous entry:</p>
<p>$$\ell^{-1}(1+n) = 2\cdot \ell^{-1}(n)$$</p>
<p>In fact, this is true everywhere, <em>if</em> you remember that the numbers
are not ordinary integers but mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> integers.
For example, the number that follows <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2464%24">, in place of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2464%c2%b72%3d128%24">,
is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2427%24">. But <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2427%5cequiv%20128%5cpmod%7b101%7d%24"> because they differ by a
multiple of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">. From a mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> point of view, it doesn't matter
wther we put <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2427%24"> or <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24128%24"> after <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2464%24">, as they are the same thing.</p>
<p>Those two facts are the whole secret of the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24"> table:</p>
<ol>
<li>Each element is twice the one before, but</li>
<li>The elements are not quite ordinary numbers, but mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> numbers
where <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2427%3d128%3d229%3d330%3d%5cldots%24">.</li>
</ol>
<p>Certainly <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%280%29%20%3d%202%5e0%20%3d%201%24">. And every entry in the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24"> is
twice the previous one, if you are thinking in mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">. The two secrets
are actually one secret:</p>
<p>$$\ell^{-1}(n) = 2^n\pmod{101}.$$</p>
<p>This is why the multiplication algorithm works. Say we want to
multiply <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2413%24"> again. We look up <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2413%24"> in
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%24">, and find <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%287%29%3d9%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%2813%29%3d66%24">. What this is
<em>really</em> telling us is that</p>
<p>$$
\begin{align}
7 & = 2^{9\hphantom6} \pmod{101} \\
13 & = 2^{66} \pmod{101} \\
\end{align}
$$</p>
<p>so that multiplying <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%5ccdot13%24"> mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> is the same as multiplying
$$2^9\cdot 2^{66}.$$</p>
<p>But multiplying exact powers of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> is easy, since you just add the exponents:
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5e9%5ccdot2%5e%7b66%7d%20%3d%202%5e%7b9%2b66%7d%20%3d%202%5e%7b75%7d%24">, whether you are
doing it in regular numbers or mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> numbers. And the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24"> table
tells us directly that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5e%7b75%7d%20%3d%2091%5cpmod%7b101%7d%24">.</p>
<p>The <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%24"> function, which is analogous to the regular logarithm, is
called a <a href="https://en.wikipedia.org/wiki/discrete_logarithm"><em>discrete</em> logarithm</a>.</p>
<p>What's going on with Percy Ludgate's algorithm? It's a sort of
compressed, limited version of the discrete logarithm.</p>
<p>I had a hope that maybe we could reimplement Ludgate's thing by basing it
more directly on discrete logarithms. Say we had the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24"> table
encoded in a wheel of some sort, with the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24100%24"> entries in order around the
rim. There's a “current position” <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24p%24">, initially <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%24">, and a
“current number” <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5ep%24">, initially <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24">.</p>
<p>On the same axle as the wheel, mount a gear with exactly 100 teeth.
We can easily turn the wheel exactly <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24q%24"> positions by taking a
straight bar with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24q%24"> teeth and using it to turn the gear, which
turns the wheel. We easily multiply the
current number by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> just by turning the wheel one position
clockwise.</p>
<p>Multiplying by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> isn't too hard, just turn the wheel <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%249%24">
positions clockwise. We can do this by constructing a short bar with
exactly <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%249%24"> teeth and using it to turn the gear. Or maybe we have a
meshing gear with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%249%24"> teeth, on another axle, which we give one full
turn. Either way, if the current number was <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%24"> before, it's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2435%24">
after.</p>
<p>Multiplying by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243%24"> is rather more of a pain, because we have to turn
the wheel <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2469%24"> positions, so we need a bar or a meshing gear with 69
teeth.</p>
<p>(We could get away with one with only <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2431%24"> teeth, if we could turn
the wheel the other way, but that seems like it might be more
complicated. Hmm, I suppose it would work to use a meshing gear with 31
teeth that engages a second gear (with any number of teeth) that
engages the main gear.)</p>
<p>Anyway I took a look to see if there were any better tables do use, and the
answer is: maybe! If, instead of a table of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5en%24">, we use a table
of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2426%5en%24">, then the brass wheel approach performs a little better:</p>
<p>$$
\begin{array}{rrrrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 26, & 70, & 2, & 52, & 39, & 4, & 3, & 78, & 8, \\
{\tiny\color{gray}{10}}& 6, & 55, & 16, & 12, & 9, & 32, & 24, & 18, & 64, & 48, \\
{\tiny\color{gray}{20}}& 36, & 27, & 96, & 72, & 54, & 91, & 43, & 7, & 81, & 86, \\
{\tiny\color{gray}{30}}& 14, & 61, & 71, & 28, & 21, & 41, & 56, & 42, & 82, & 11, \\
{\tiny\color{gray}{40}}& 84, & 63, & 22, & 67, & 25, & 44, & 33, & 50, & 88, & 66, \\
{\tiny\color{gray}{50}}& 100, & 75, & 31, & 99, & 49, & 62, & 97, & 98, & 23, & 93, \\
{\tiny\color{gray}{60}}& 95, & 46, & 85, & 89, & 92, & 69, & 77, & 83, & 37, & 53, \\
{\tiny\color{gray}{70}}& 65, & 74, & 5, & 29, & 47, & 10, & 58, & 94, & 20, & 15, \\
{\tiny\color{gray}{80}}& 87, & 40, & 30, & 73, & 80, & 60, & 45, & 59, & 19, & 90, \\
{\tiny\color{gray}{90}}& 17, & 38, & 79, & 34, & 76, & 57, & 68, & 51, & 13, & 35\hphantom{,} \\
\end{array}
$$</p>
<p>Multiplying by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> is no longer as simple as turning the wheel one
notch clockwise; you have to turn it <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243%24"> positions counterclockwise.
But that seems pretty easy. Multiplying by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243%24"> is also rather easy:
just turn the wheel <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> positions. If the table above is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24">, then the
analogue of Ludgate's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> table is:</p>
<p>$$
\begin{array}{cccccccccc}
\tiny\color{gray}{1} & \tiny\color{gray}{2} & \tiny\color{gray}{3} & \tiny\color{gray}{4} & \tiny\color{gray}{5} & \tiny\color{gray}{6} & \tiny\color{gray}{7} & \tiny\color{gray}{8} & \tiny\color{gray}{9} \\
0 & 3 & 7 & 6 & 72 & 10 & 27 & 9 & 14 \\
\end{array}
$$</p>
<p>That is, if you want to compute <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243%c2%b76%24">, you start with the wheel in
position <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%24">, then turn it by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%283%29%20%3d%207%24"> positions, then by
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%286%29%20%3d%2010%24">, and
now it's at position <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2417%24">, where the current number is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2418%24">.</p>
<p>The numbers in the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> table are all pretty small, except that to
multiply by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%24"> you have to turn by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2472%24"> positions, which is
kinda awful. Still it's only a little worse than in the powers-of-2
version where to multiply by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243%24"> you would have to turn the wheel by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2469%24">
positions. And <em>overall</em> the powers-of-26 table is better: the sum of
the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%249%24"> entries is only <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24148%24">, which is optimal; the corresponding
sum of the entries for the powers-of-2 table is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24216%24">.</p>
<p>Who knows, it might work, and even if it didn't work well it might be
pretty cool.</p>
<!--
We don't have to do the discrete logarithm with powers of
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> mod <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">; we can change those if we like. (If we change <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> to
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24m%24"> we need to make sure that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> is a
generator of the multiplicative group <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5clangle%20%5cBbb%20Z_%7bm%7d%2c%0a%5ccdot%5crangle%24">. If you don't know what this means, try constructing
the tables for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%3d2%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24m%3d7%24"> or <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24m%3d17%24"> to see what can go
wrong.)
(Public-key cryptography is based on the fact that while it's
relatively easy to efficiently multiply large numbers, factoring the
product again seems to be difficult and time-consuming. This
discrete-logarithm multiplication is similar. Computing <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5en%5cpmod%0ap%24"> is quick and easy, even without having the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cell%5e%7b%2d1%7d%24"> table prepared
ahead of time, and even if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24p%24"> are thousand-digit numbers.
But nobody knows a good way to compute the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24LOG%24"> table for a large
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24p%24">; if someone comes to you with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5en%5cpmod%20p%24"> and asks you to
figure out what <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"> was, it will take you quite a long time to find
out. So there are versions of all the usual public-key encryption
algorithms where the integer factoring problem has been replaced by
the discrete logarithm problem.)
-->
Irish logarithm forward instead of backward
https://blog.plover.com/2023/10/02#irish-logarithm-2
<p>Yesterday I posted about the so-called
<a href="https://blog.plover.com/math/irish-logarithm.html">“Irish logarithm”</a>, Percy
Ludgate's little algorithm for single-digit multiplication.</p>
<p>Hacker News user
<a href="https://news.ycombinator.com/item?id=37728312#37729428">sksksfpuzhpx</a> said:</p>
<blockquote>
<p>There's a much simpler way to derive Ludgate's logarithms</p>
</blockquote>
<p>and referred to Brian Coghlan's aticle
<a href="https://treasures.scss.tcd.ie/miscellany/TCD-SCSS-X.20121208.002/Ludgate-LogarithmixIndexes-20200610-1459.pdf">“Percy Ludgate's Logarithmic indices”</a>.</p>
<p>Whereas I was reverse-engineering Ludgate's tables with a sort of
ad-hoc backtracking search, if you do it right you can do it it more
easily with a simple greedy search.</p>
<p>Uh oh, I thought, I will want to write this up before I move on to the
thing I planned to do next, which made it all the more likely that I
never would get to the thing I had planned to do next. But
<a href="https://shreevatsa.net/post/">Shreevatsa R.</a> came to my rescue and
<a href="https://shreevatsa.net/post/irish-logarithm/">wrote up the Coghlan thing</a>
at least as well as I could have myself. Definitely check it out.</p>
<p>Thank you, Shreevatsa!</p>
<p>[ Update 20231015: <a href="https://blog.plover.com/math/irish-logarithm-3.html">A different kind of all-integer logarithm: the <em>discrete</em> logarithm</a>. ]</p>
<p>[ Update 20231020: <a href="https://blog.plover.com/math/irish-logarithm-3.html">Better explanation of the discrete logarithm</a>. ]</p>
The Irish logarithm
https://blog.plover.com/2023/10/01#irish-logarithm
<p><a href="https://en.wikipedia.org/wiki/Irish_logarithm">The Wikipedia article on “Irish logarithm”</a>
presents this rather weird little algorithm, invented by <a href="https://en.wikipedia.org/wiki/Percy_Ludgate">Percy
Ludgate</a>. Suppose you want to multiply <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24">,
where both are single-digit numbers <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%e2%89%a4a%2cb%e2%89%a49%24">.</p>
<p>Normally you would just look it up on a multiplication table, but
please bear with me for a bit.</p>
<p>To use Ludgate's algorithm you need a different little table:</p>
<p>$$
\begin{array}{rl}
T_1 = &
\begin{array}{cccccccccc}
\tiny\color{gray}{0} & \tiny\color{gray}{1} & \tiny\color{gray}{2} & \tiny\color{gray}{3} & \tiny\color{gray}{4} & \tiny\color{gray}{5} & \tiny\color{gray}{6} & \tiny\color{gray}{7} & \tiny\color{gray}{8} & \tiny\color{gray}{9} \\
50 & 0 & 1 & 7 & 2 & 23 & 8 & 33 & 3 & 14 \\
\end{array}
\end{array}
$$</p>
<p>and a different bigger one:</p>
<!-- table 1 -->
<p>$$
\begin{array}{rl}
T_2 = &
% \left(
\begin{array}{rrrrrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, & 3, & 6, & 12, \\
{\tiny\color{gray}{10}} & 24, & 48, & 0, & 0, & 9, & 18, & 36, & 72, & 0, & 0, \\
{\tiny\color{gray}{20}} & 0, & 27, & 54, & 5, & 10, & 20, & 40, & 0, & 81, & 0, \\
{\tiny\color{gray}{30}} & 15, & 30, & 0, & 7, & 14, & 28, & 56, & 45, & 0, & 0, \\
{\tiny\color{gray}{40}} & 21, & 42, & 0, & 0, & 0, & 0, & 25, & 63, & 0, & 0, \\
{\tiny\color{gray}{50}} & 0, & 0, & 0, & 0, & 0, & 0, & 35, & 0, & 0, & 0, \\
{\tiny\color{gray}{60}} & 0, & 0, & 0, & 0, & 0, & 0, & 49\hphantom{,}
\end{array}
% \right)
\end{array}
$$</p>
<p>I've formatted <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> in rows for easier reading, but it's really
just a zero-indexed list
of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24"> numbers.
So for example <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%2823%29%24"> is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%24">.</p>
<p>The tiny gray numbers in the margin are not part of the table, they
are counting the elements so that it is easy to find element <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2423%24">.</p>
<p>Ludgate's algorithm is simply:</p>
<p>$$
ab = T_2(T_1(a) + T_1(b))
$$</p>
<p>Let's see an example.
Say we want to multiply <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%244%c3%977%24">. We
first look up <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%244%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> in <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24">, and get <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> and
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2433%24">, which we add, getting <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2435%24">. Then <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%2835%29%24">
is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2428%24">, which is the correct answer.</p>
<p>This isn't useful for paper-and-pencil calculation, because it only
works for products up to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%249%c3%979%24">, and an ordinary multiplication table
is easier to use and remember. But Ludgate invented this for use in a
mechanical computing engine, for which it is much better-suited.</p>
<p>The table lookups are mechanically very easy. They are simple
one-dimensional lookups: to find <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%286%29%24"> you just look at entry
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%246%24"> in the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> table, which can be implemented as a series of
ten metal rods of different lengths, or something like that. Looking
things up in a multiplication table is harder because it is two-dimensional.</p>
<p>The single addition in Ludgate's algorithm can also be performed
mechanically: to add <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%28a%29%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%28b%29%24">, you have some thingy
that slides up by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%28a%29%24"> units, and then by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%28b%29%24"> more, and
then wherever it ends up is used to index into <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> to get the
answer. The <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> table doesn't have to be calculated on the fly,
it can be made up ahead of time, and machined from brass or something,
and incorporated directly into the machine. (It's tempting to say
“hardcoded”.)</p>
<p>The tables look a little uncouth at first but it is not hard to figure
out what is going on. First off, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> is the inverse of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> in
the sense that $$T_2(T_1(n)) = n\tag{$\color{darkgreen}{\spadesuit}$}$$</p>
<p>whenever <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"> is in range — that is when <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%e2%89%a4%20n%20%e2%89%a4%209%24">.</p>
<p><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> is more complex. We must construct it so that</p>
<p>$$T_2(T_1(a) + T_1(b)) = ab.\tag{$\color{purple}{\clubsuit}$}$$</p>
<p>for all <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24"> of interest, which means that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%5cle%20a%2c%20b%5cle%0a9%24">.</p>
<p>If you look over the table you should see that the entry <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"> is
often followed by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242n%24">. That is, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%28i%2b1%29%20%3d%202T_2%28i%29%24">, at least
some of the time. In fact, this is true in all the cases we care
about, where <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242n%20%3d%20ab%24"> for some single digits <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%2c%20b%24">.</p>
<p>The second row could just as well have started with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2424%2c%2048%2c%2096%2c%0a192%24">, but Ludgate doesn't need the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2496%2c%20192%24"> entries, so he made
them zero, which really means “I don't care”. This will be important
later.</p>
<p>The algorithm says that if
we want to
compute <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242n%24">, we should compute
$$ \begin{align}
2n
& = T_2(T_1(2) + T_1(n)) && \text{Because $\color{purple}{\clubsuit}$} \\
& = T_2(1 + T_1(n)) \\
& = 2T_2(T_1(n)) && \text{Because moving one space right doubles the value}\\
& = 2n && \text{Because $\color{darkgreen}{\spadesuit}$}
\end{align}
$$</p>
<p>when <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%e2%89%a4n%e2%89%a49%24">.</p>
<p>I formatted <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> in rows of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2410%24"> because that makes it easy to
look up examples like <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%2835%29%20%3d%2028%24">, and because that's how
Wikipedia did it. But this is very misleading, and not just because
it makes <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> appear to be a <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2410%c3%9710%24"> table when it's really a
vector. <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> is actually more like a compressed version of a
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%c3%974%c3%973%c3%973%24"> table.</p>
<p>Let's reformat the table so that the rows have length <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> instead of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2410%24">:</p>
<!-- table 2 -->
<p>$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & 5, & 10, & 20, & 40, & 0, \\
{\tiny\color{gray}{28}} & 81, & 0, & 15, & 30, & 0, & 7, & 14, \\
{\tiny\color{gray}{35}} & 28, & 56, & 45, & 0, & 0, & 21, & 42, \\
{\tiny\color{gray}{42}} & 0, & 0, & 0, & 0, & 25, & 63, & 0, \\
{\tiny\color{gray}{49}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{56}} & 35, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{63}} & 0, & 0, & 0, & 49 \\
\end{array}
$$</p>
<p>We have already seen that moving one column right usually multiplies
the entry by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">. Similarly, moving down by one row is seen to
triple the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> value — not always, but in all the cases of
interest. Since the rows have length <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24">, moving down one row from
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%28i%29%24"> gets you to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%28i%2b7%29%24">, and this is why <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%283%29%20%3d%207%24">:
to compute <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243n%24">, one does:</p>
<p>$$ \begin{align}
3n
& = T_2(T_1(3) + T_1(n)) && \text{Because $\color{purple}{\clubsuit}$} \\
& = T_2(7 + T_1(n)) \\
& = 3T_2(T_1(n)) && \text{Because moving down triples the value}\\
& = 3n && \text{Because $\color{darkgreen}{\spadesuit}$}
\end{align}
$$</p>
<p>Now here is where it gets clever. It would be straightforward easy to build <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24">
as a stack of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%c3%977%24"> tables, with each layer in the stack having
entries quintuple the layer above, like this:</p>
<!-- table 3 -->
<p>$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{28}} & 81, & 0, & 0, & 0, & 0, & 0, & 0, \\
\\
{\tiny\color{gray}{35}} & 5, & 10, & 20, & 40, & 0, & 0, & 0, \\
{\tiny\color{gray}{42}} & 15, & 30, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{49}} & 45, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{56}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{63}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
\\
{\tiny\color{gray}{70}} & 25, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{77}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{84}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{91}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{98}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
\end{array}
$$</p>
<p>This works, if we make <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%285%29%24"> the correct offset, which is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%c2%b75%20%3d%0a35%24">. But it wastes space, and the larger <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> is, the more
complicated and expensive is the brass thingy that encodes it. The
last six entries of the each layer in the stack are don't-cares, so we
can just omit them:</p>
<!-- table 4 -->
<p>$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{28}} & 81, \\
\\
{\tiny\color{gray}{29}} & 5, & 10, & 20, & 40, & 0, & 0, & 0, \\
{\tiny\color{gray}{36}} & 15, & 30, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{43}} & 45, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{50}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{57}} & 0, \\
\\
{\tiny\color{gray}{58}} & 25, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{65}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{72}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{79}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{86}} & 0\hphantom{,} \\
\end{array}
$$</p>
<p>And to compensate we make <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%285%29%20%3d%2029%24"> instead of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2435%24">: you now
move down one layer in the stack by skipping <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2429%24"> entries forward, instead
of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2435%24">.</p>
<p>The table is still missing all the multiples of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24">, but we can
repeat the process. The previous version of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> can now be
thought of as a <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2429%c3%973%24"> table, and we can stack another <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2429%c3%973%24">
table below it, with all the entries in the new layer being <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24">
times the original one:</p>
<!-- table 5 -->
<p>$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{28}} & 81, \\
\\
{\tiny\color{gray}{29}} & 5, & 10, & 20, & 40, & 0, & 0, & 0, \\
{\tiny\color{gray}{36}} & 15, & 30, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{43}} & 45, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{50}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{57}} & 0, \\
\\
{\tiny\color{gray}{58}} & 25, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{65}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{72}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{79}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{86}} & 0, \\
\\
\hline
\\
{\tiny\color{gray}{87}} & 7, & 14, & 28, & 56, & 0, & 0, & 0, \\
{\tiny\color{gray}{94}} & 21, & 42, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{101}} & 63, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{108}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{115}} & 0, \\
\\
{\tiny\color{gray}{116}} & 35, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{123}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{130}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{137}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{144}} & 0, \\
\\
{\tiny\color{gray}{145}} & 0, & 0, & 0, & 0, & 0, & 0, & \ldots \\
\\
\hline
\\
{\tiny\color{gray}{174}} & 49\hphantom{,} \\
\end{array}
$$</p>
<p>Each layer in the stack has <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2429%c2%b73%20%3d%2087%24"> entries, so we could take
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%287%29%20%3d%2087%24"> and it would work, but the last <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2428%24"> entries in
every layer are zero, so we can discard those and reduce the layers to
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2459%24"> entries each.</p>
<!-- table 6 -->
<p>$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{28}} & 81, \\
\\
{\tiny\color{gray}{29}} & 5, & 10, & 20, & 40, & 0, & 0, & 0, \\
{\tiny\color{gray}{36}} & 15, & 30, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{43}} & 45, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{50}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{57}} & 0, \\
\\
{\tiny\color{gray}{58}} & 25, \\
\\
\hline
\\
{\tiny\color{gray}{59}} & 7, & 14, & 28, & 56, & 0, & 0, & 0, \\
{\tiny\color{gray}{66}} & 21, & 42, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{73}} & 63, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{80}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{87}} & 0, \\
\\
{\tiny\color{gray}{88}} & 35, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{95}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{102}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{109}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{116}} & 0, \\
\\
{\tiny\color{gray}{117}} & 0, \\
\\
\hline
\\
{\tiny\color{gray}{118}} & 49\hphantom{,} \\
\end{array}
$$</p>
<p>Doing this has reduced the layers from <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2487%24"> to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2459%24"> elements each,
but Ludgate has another trick up his sleeve. The last few
numbers in the top layer are <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2445%2c%2025%2c%24"> and a lot of zeroes.
If he could somehow finesse <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2445%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2425%24">,
he could trim the top two layers all the way back to only 38 entries each:</p>
<!-- table 7 -->
<p>$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{28}} & 81, \\
\\
{\tiny\color{gray}{29}} & 5, & 10, & 20, & 40, & 80, & 0, & 0, \\
{\tiny\color{gray}{36}} & 15, & 30,
\\
\\
\hline
\\
{\tiny\color{gray}{38}} & 7, & 14, & 28, & 56, & 0, & 0, & 0, \\
{\tiny\color{gray}{45}} & 21, & 42, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{52}} & 63, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{59}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{66}} & 0, \\
\\
{\tiny\color{gray}{67}} & 35, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{74}} & 0, & 0,
\\
\hline
\\
{\tiny\color{gray}{76}} & 49\hphantom{,} \\
\end{array}
$$</p>
<p>We're now missing <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2425%24"> and we need to put it back.
Fortunately the place we want to put it is
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%285%29%20%2b%20T_1%285%29%20%3d%2029%2b29%20%3d%2058%24">, and that slot contains a zero
anyway. And similarly we want to put <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2445%24"> at position <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2414%2b29%20%3d%0a43%24">, also empty:</p>
<!-- table 8 -->
<p>$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{28}} & 81, \\
\\
{\tiny\color{gray}{29}} & 5, & 10, & 20, & 40, & 0, & 0, & 0, \\
{\tiny\color{gray}{36}} & 15, & 30,
\\
\\
\hline
\\
{\tiny\color{gray}{38}} & 7, & 14, & 28, & 56, & 0, & \color{purple}{45}, & 0, \\
{\tiny\color{gray}{45}} & 21, & 42, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{52}} & 63, & 0, & 0, & 0, & 0, & 0, & \color{purple}{25}, \\
{\tiny\color{gray}{59}} & 0, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{66}} & 0, \\
\\
{\tiny\color{gray}{67}} & 35, & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{74}} & 0, & 0, \\
\\
\hline
\\
{\tiny\color{gray}{76}} & 49\hphantom{,} \\
\end{array}
$$</p>
<p>The arithmetic pattern is no longer as obvious, but property <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5ccolor%7bpurple%7d%7b%5cclubsuit%7d%24">
still holds.</p>
<p>We're not done yet! The table still has a lot of zeroes we can squeeze
out. If we change <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%285%29%24"> from <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2429%24"> to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2423%24">, the
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%2c10%2c20%2c40%24"> group will slide backward to just after the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2454%24">, and the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2415%2c%0a30%24"> will move to the row below that.</p>
<p>We will also have to move the
other multiples of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%24">. The <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%24"> itself moved back by six entries, and so
did everything after that in the table, including the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2435%24"> (from
position <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2432%2b29%24"> to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2432%2b23%24">) and the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2445%24"> (from position
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2414%2b29%24"> to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2414%2b23%24">) so those are still in the right
places. Note that this means that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> has moved from position
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2438%24"> to
position <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2432%24">, so we now have <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%287%29%20%3d%2032%24">.</p>
<p>But the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2425%24"> is giving us trouble. It needed to move back twice
as far as the others, from <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2429%2b29%20%3d%2058%24"> to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2423%2b23%20%3d%2046%24">, and
unfortunately it now collides with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2463%24"> which is currently at position
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%2b7%2b32%20%3d%2046%24">.</p>
<!-- table 9 -->
<p>$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & \color{purple}{5}, & \color{purple}{10}, & \color{purple}{20}, & \color{purple}{40}, & 0, \\
{\tiny\color{gray}{28}} & 81, & 0, & \color{purple}{15} & \color{purple}{30}, \\
\\
\hline
\\
{\tiny\color{gray}{32}} & 7, & 14, & 28, & 56, & 0, & \color{darkgreen}{45}, & 0, \\
{\tiny\color{gray}{39}} & 21, & 42, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{46}} & {63\atop\color{darkred}{¿25?}} & 0, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{53}} & 0, & 0, & \color{darkgreen}{35}, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{60}} & 0, & 0, & 0, & 0, \\
\\
\hline
\\
{\tiny\color{gray}{64}} & 49\hphantom{,} \\
\end{array}
$$</p>
<p>We need another tweak to fix <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2425%24">. <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> is currently at
position <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2432%24">. We can't move <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> any farther back to the left
without causing more collisions. But we can move it <em>forward</em>, and if
we move it forward by one space, the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2463%24"> will move up one space also
and the collision with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2425%24"> will be solved. So we insert a zero between
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2430%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24">, which moves up <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> from position <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2432%24"> to
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2433%24">:</p>
<p><!-- table 10 -->
$$
\begin{array}{rrrrrrrr}
{\tiny\color{gray}{0}} & 1, & 2, & 4, & 8, & 16, & 32, & 64, \\
{\tiny\color{gray}{7}} & 3, & 6, & 12, & 24, & 48, & 0, & 0, \\
{\tiny\color{gray}{14}} & 9, & 18, & 36, & 72, & 0, & 0, & 0, \\
{\tiny\color{gray}{21}} & 27, & 54, & 5, & 10, & 20, & 40, & 0, \\
{\tiny\color{gray}{28}} & 81, & 0, & 15 & 30, \\
\\
\hline
\\
{\tiny\color{gray}{32}} & \color{purple}{0}, & \color{darkgreen}{7}, & \color{darkgreen}{14}, & \color{darkgreen}{28}, & \color{darkgreen}{56}, & 45, & 0, \\
{\tiny\color{gray}{39}} & 0, & \color{darkgreen}{21}, & \color{darkgreen}{42}, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{46}} & 25,& \color{darkgreen}{63}, & 0, & 0, & 0, & 0, & 0, \\
{\tiny\color{gray}{53}} & 0, & 0, & 0, & \color{darkgreen}{35}, & 0, & 0, & 0, \\
{\tiny\color{gray}{60}} & 0, & 0, & 0, & 0, \\
\\
\hline
\\
{\tiny\color{gray}{64}} & \color{purple}{0}, & \color{purple}{0}, & \color{darkgreen}{49}\hphantom{,} \\
\end{array}
$$</p>
<p>All the other multiples of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> moved up by one space, but not the
non-multiples <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2425%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2445%24">. Also <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2449%24"> had to move up by two,
but that's no problem at all, since it was at the end of the table and
has all the space it needs.</p>
<p>And now we are done! This is exactly Ludgate's table, which has the
property that</p>
<p>$$T_2(p + 7q + 23r + 33s) = 2^p3^q5^r7^s$$</p>
<p>whenever <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5ep3%5eq5%5er7%5es%20%3d%20ab%24"> for some <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%e2%89%a4a%2cb%e2%89%a49%24">.
Moving right by one space multiplies the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> entry
by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24">, at least for the entries we care about. Moving right by
seven spaces multiplies the entry by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243%24">. To multiply by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%245%24"> or
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24"> we move right by or <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2423%24"> or by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2433%24">, respectively.</p>
<p>These are exactly the values in the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> table:</p>
<p>$$\begin{align}
T_1(2) & = 1\\
T_1(3) & = 7\\
T_1(5) & = 23\\
T_1(7) & = 33
\end{align}$$</p>
<p>The rest of the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> table can be obtained by remembering <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5ccolor%7bdarkgreen%7d%7b%5cspadesuit%7d%24">,
that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%28T_1%28n%29%29%20%3d%20n%24">, so for example <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%286%29%20%3d%208%24"> because
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%288%29%20%3d%206%24">. Or we can get <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%286%29%24"> by multiplication, using <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5ccolor%7bpurple%7d%7b%5cclubsuit%7d%24">:
multiplying by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%246%24"> is the same as multiplying by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%24"> and then by
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%243%24">, which means you move right by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24"> and then by <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%247%24">, for a
total of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%248%24">. Here's <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> again for reference:</p>
<p>$$
\begin{array}{rl}
T_1 = &
\begin{array}{cccccccccc}
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline
50 & 0 & 1 & 7 & 2 & 23 & 8 & 33 & 3 & 14 \\
\end{array}
\end{array}
$$</p>
<p>(Actually I left out a detail: <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%280%29%20%3d%2050%24">.
Ludgate wants <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%28T_1%280%29%20%2b%20T_1%28b%29%29%20%3d%200%24"> for all <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24">. So
we need <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%28T_1%280%29%20%2b%20k%29%20%3d%200%24"> for each <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24k%24"> in <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24">.
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%280%29%20%3d%2050%24"> is the smallest value that works. This is rather
painful, because it means that
the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%2466%24">-item table above is not sufficient. Ludgate has to extend
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> all the way out to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24101%24">
items in order to handle the seemingly trivial case of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%5ccdot%200%20%3d%0aT_2%2850%20%2b%2050%29%24">. But the last 35 entries are all zeroes, so the
the brass widget probably doesn't have to be too much more complicated.)</p>
<p>Wasn't that fun? A sort of mathematical engineering or a kind that has
not been really useful for at least fifty years.</p>
<p>But actually that was not what I planned to write about! (Did you
guess that was coming?) I thought I was going to write this bit as a
brief introduction to something else, but the brief introduction turned out
to be 2500 words and a dozen complicated tables.</p>
<p>We can only hope that part 2 is forthcoming. I promise nothing.</p>
<p>[ Update 20231002: Rather than the ad-hoc backtracking approach I
described here, one can construct <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_1%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24T_2%24"> in a simpler and more direct way. <a href="https://shreevatsa.net/post/irish-logarithm/">Shreevatsa R. explains</a>. ]</p>
<p>[ Update 20231015: <a href="https://blog.plover.com/math/irish-logarithm-3.html">Part 2 has arrived!</a> It
discusses a different kind of all-integer logarithm called the
“discrete” logarithm. ]</p>
<p>[ Update 20231020: <a href="https://blog.plover.com/math/irish-logarithm-4.html">I think this is a clearer explanation of the discrete logarithm</a>. Shorter, anyway. ]</p>
Math SE report 2023-06: funky-looking Hasse diagrams, and what is a polynomial anyway?
https://blog.plover.com/2023/09/05#2023-06
<h3><a href="https://math.stackexchange.com/q/4718043/25554">Is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e4%2dx%5e4%20%3d%200%24"> a fourth-degree equation?</a></h3>
<p>This is actually a really good question! (You can tell because it's
quick to ask and complicated to answer.) It goes back to a very
fundamental problem that beginners in mathematics, which is that there
is a difference between an object's true nature and the way it happens
to be written down. And often these problems are compounded because
there <em>is</em> no way to talk about the object except by referring to how
it is written down.</p>
<p>OP says:</p>
<blockquote>
<p>The best definition I could find for the degree of an equation is the
following:</p>
<blockquote>
<p>The highest power of the unknown term whose coefficient isn't zero
in a given equation</p>
</blockquote>
</blockquote>
<p>And they are bothered by this, and rightly so. I was almost derailed
at this point into writing an article about what an equation is, but
I'm going to put it off for another day, because I think to get to
this person's question what we really need to do is to say what
a <em>polynomial</em> is.</p>
<p>One way is to describe it as an expression in a certain form, but this
is a bit roundabout. It's like describing a rational number as an
expression of the form <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%20n%20d%24"> where <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24n%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24d%24"> are
relatively prime integers. Under this sort of definition, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e4%2dx%5e4%24">
isn't a polynomial at all, because it's not an expression of the
correct form.</p>
<p>But I think the right way to define a polynomial is that it's an
element of the free ring over some ring <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24C%24"> of coefficients. This
leaves completely open the question of how a polynomial is written, or
what it looks like. It becomes a theorem that polynomials are in
one-to-one correspondence with finite sequences of elements of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24C%24">.
Then we can say that the “degree” of a polynomial is one less than the
length of the corresponding finite sequence, or something like that.</p>
<p>[ Sometimes we make an exception for the zero polynomial and say its
degree is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%2d%5cinfty%24">,
to preserve the law <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5coperatorname%7bdeg%7d%28pq%29%20%3d%0a%5coperatorname%7bdeg%7d%28p%29%2b%5coperatorname%7bdeg%7d%28q%29%24">.) ]</p>
<p>In this view the zero polynomial is simply the zero element of the
ring. The polynomial called “<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e4%24">” is the fourth power of the
free element <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%24">.</p>
<p>Since the polynomials are elements of a ring, addition, subtraction,
and multiplication come along automatically, and we can discuss the
value of the expression <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e4%2dx%5e4%24">, which by the usual properties of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%2d%24">
is also the zero polynomial. </p>
<p>Anyway that all is pretty much what I said: </p>
<blockquote>
<p><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e4%2dx%5e4%24"> is just a
way to write the polynomial <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%240%24">, which is <em>not</em> a fourth-degree
polynomial. Similarly <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e5%2bx%5e4%2dx%5e5%24"> is not a fifth-degree
polynomial.</p>
</blockquote>
<p>There's an underlying reality here, the abstract elements of the
ring <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24R%5bx%5d%24">. And then there's a representation theorem, which is
that elements of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24R%5bx%5d%24"> are in one-to-one correspondence with finite
sequences of elements of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24R%24">. The ring laws give us ways to normalize
arbitrary expressions involving polynomials. And then there's also
the important functor that turns every polynomial ring into a ring of
functions, turning the polynomial <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e4%24"> into the function <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5cmapsto%0ax%5e4%24">.</p>
<p>This kind of abstract approach isn't usually explained in secondary or
tertiary education, and I'm not sure it would be an improvement if it
were. (You'd have to explain rings, for one thing.) But the main
conceptual point is that there is a difference between the thing itself
(say, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e4%24">) and the way we happen to write the thing (say,
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%5e5%2bx%5e4%2dx%5e5%24">), and some properties are properties of the thing
itself and others are properties of expressions, of the way the thing
has been written. The degree of a polynomial is a property of the
thing itself, not of the way it happens to be written, so both of
those expressions are ways to write the same polynomial, which is
fourth-degree, regardless of the fact that in one of them, “the
highest power of the unknown term whose coefficient isn't zero” is
five.</p>
<p>There is one example of this abstraction that everyone learns in
childhood, rational numbers. I lean hard on this example, because
most people know it pretty well, even if they don't realize it yet.
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac15%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac6%7b30%7d%24"> are <em>the same thing</em>, written in two
different ways. Mathematicians will, without even thinking about it,
speak of the numerator of a rational number, and without batting an
eyelash will say that the numerator of the rational number
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac%7b6%7d%7b30%7d%24"> is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24">. The <em>fraction</em> <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac6%7b30%7d%24"> is a
mere notation that <em>represents</em> a rational number, in this case the
rational number <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cfrac15%24">, and this rational number has a numerator
of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%241%24">.</p>
<p>Beginning (and intermediate) computer programmers also have this
issue, that the thing itself, usually some embedding of data in the
computer's memory, may be serialized into a string in multiple ways.
There's a string that represents the thing, and then
there's the thing itself, but it's hard to talk about the thing itself
because anything you can <em>write</em> is a string. I wish this were made
explicit in CS education. Computer programmers who don't pick up on
this crucial point, at least on an intuitive level, do not progress
past intermediate.</p>
<h3><a href="https://math.stackexchange.com/q/4713789/25554">What are the names given to statements that can be true or false?</a></h3>
<p>I think I totally flubbed this one. OP is really concerned with
<em>open</em> and <em>closed</em> formulas. For example, “<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%20%3e%202%24">” is true, or
false, depending on the value of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%24">. And OP astutely noted that
while “<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%3e4%20%5cto%20x%3e%202%24">” is always true, its meaning still depends on
the value of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24x%24">.</p>
<p>I did get around to explaining that part of the issue, eventually.
The crucial point, which is that there are <em>formulas</em> which may have
free variables and then there are <em>statements</em> which do not, is buried
at the end after a lot of barely-relevant blather about Quinian quasiquotation. What
was I thinking? Perhaps I should go back and shorten the answer to just
the relevant part.</p>
<h3><a href="https://math.stackexchange.com/q/4735608/25554">How does one identify the weakest preconditions in Hoare triples?</a></h3>
<p>I wrote a detailed explanation of how one identifies weakest
preconditions in Hoare triples, before realizing that actually OP
understood this perfectly, and their
confusion was because their book wrote “<code>{x≠1}</code>” where it should have
had “<code>{x≠-1}</code>”.</p>
<p>Sheesh.</p>
<h3><a href="https://math.stackexchange.com/q/4738241/25554">Artifacts of mathematical logic</a></h3>
<p>This was fun. OP wants actual physical artifacts that embody concepts
from mathematical logic, the way one models of the platonic
solids embody concepts from solid geometry.</p>
<p>I couldn't think of anything good, but then
<a href="https://math.stackexchange.com/a/4738252/25554">Michael Weiss brought up Lewis Carroll's <em>Game of Logic</em></a>.
This reminded me that Martin Gardner had written
<a href="https://archive.org/details/logicmachinesdia227gard">a book about embodiments of simple logic</a>,
including the Carroll one, so I mentioned that. It's a fun book.
Check out the account of
<a href="https://en.wikipedia.org/wiki/Ramon_Llull">Ramon Llull</a>, who missed
being canonized because his martyrdom looked a bit too much like FAFO.</p>
<p>I find this answer a little unsatisfying though. The logic machines
in Gardner's book do only a little boolean algebra, or maybe at best a
tiny bit of predicate logic. But I'd love to see a physical system
that somehow encapsulated sequent calculus or natural deduction or
something like that. Wouldn't it be cool to have blocks stuck
together with magnets or physical couplings, and if you could
physically detach the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B%24"> from <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%5cto%20B%24"> only if you already had an
assemblage that matched <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24"> exactly? I have no idea how you'd do
it. Maybe a linear logic model would be more feasible: once you used
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24"> with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%5cto%20B%24"> to get <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B%24">, you wouldn't be able to use either
one again.</p>
<p>We need some genius to come and invent some astonishing mechanism that
formerly seemed impossible. I wonder if Ernő Rubik is available?</p>
<p>Joachim Breitner's <a href="http://incredible.pm/">Incredible Proof Machine</a>
is a fun thing along these lines, but it's not at all an artifact.</p>
<h3><a href="https://math.stackexchange.com/q/4741341/25554">Is there a name for this refinement of the subset ordering?</a></h3>
<p>This was my question. I've never seen this ordering elsewhere, but it
has a simple description. We start with a totally ordered finite set
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24S%24">. Then if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B%24"> are subsets of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24S%24">, we deem <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%0a%5cpreceq%20B%24"> if there is an injective mapping
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24f%3aA%5cto%20B%24"> where <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%20%5cle%20f%28a%29%24"> for each <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%5cin%20A%24">.</p>
<p>So for example, if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24S%24"> has three elements <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%5clt%20b%5clt%20c%24"> then the
ordering I want, on <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%242%5eS%24">, has this Hasse diagram:</p>
<p><a href="https://pic.blog.plover.com/math/se/2023-06/ord3.png"><img src="https://pic.blog.plover.com/math/se/2023-06/ord3.png"
class="center" alt="At far left, least, is the empty set. Then, in a
line to the right, the set {a}, then {b}, then both {ab} and {c}, then
right of both of these is {ac}, then {bc}, then S={abc}"/></a></p>
<p><img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5c%5c%7bb%5c%5c%7d%5cprec%5c%5c%7ba%2cb%5c%5c%7d%24"> because we can match the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24">'s. And
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5c%5c%7ba%2cb%5c%5c%7d%5cprec%20%5c%5c%7ba%2c%20c%5c%5c%7d%24"> because we can match <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> and
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24"> with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24c%24">. But <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5c%5c%7bc%5c%5c%7d%5cnot%5cprec%5c%5c%7ba%2c%20b%5c%5c%7d%24"> because we can't
match <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24c%24"> with either <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> or with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24">, and
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5c%5c%7ba%2cb%5c%5c%7d%5cnot%5cprec%5c%5c%7bc%5c%5c%7d%24"> because, while we can match either of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24">
or <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24"> with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24c%24">, we aren't allowed to match both of them with
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24c%24">.</p>
<p>Here's the corresponding Hasse diagram for <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%7cS%7c%3d4%24">:</p>
<p><a href="https://pic.blog.plover.com/math/se/2023-06/ord3.png"><img src="https://pic.blog.plover.com/math/se/2023-06/ord4.png" class="center" alt="A more complicated
Hasse diagram with 16 nodes, one for each subset of {a,b,c,d}."/></a></p>
<p>Maybe a better way to describe this is: the bottom element is
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5cvarnothing%24">. To go up the lattice one step, you either increment
one of the elements of the current set, or you insert an <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> if
there isn't one already. So from <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5c%5c%7bb%2cd%5c%5c%7d%24"> you can either increment
the <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24b%24"> to move up to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5c%5c%7bc%2c%20d%5c%5c%7d%24">
or you can insert an <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24a%24"> to move up to <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24%5c%5c%7ba%2c%20b%2c%20d%5c%5c%7d%24">.</p>
<p>This ordering comes up in connection with a problem I've thought about a lot:
Say you have a number <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%24"> and you want to find <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24AB%3dN%24"> with <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24">
and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B%24"> as
close together as possible. Even if you have the prime
factorization of <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%24"> available, it's not usually clear what the
answer is. (In general it's NP-hard.)</p>
<p>If <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%24"> is the product of two primes, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%3dp_1p_2%24"> the answer is
obvious. And if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%24"> is a product of three primes <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%20%3dp_1p_2p_3%24">
there is a definitive answer. Without loss of generality, <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24p_1%20%e2%89%a4%20p_2%0a%e2%89%a4%20p_3%24">, and the answer is simply that <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%3dp_1p_2%2c%20B%3dp_3%24"> is always
optimal.</p>
<p>But if <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24N%20%3dp_1p_2p_3p_4%24"> it can go two different ways. Assuming
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24p_1%20%e2%89%a4%20p_2%0a%e2%89%a4%20p_3%20%e2%89%a4%20p_4%24">, it usually turns out that the optimal solution is
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%3dp_1p_4%2c%20B%3dp_2p_3%24">. But sometimes the optimal solution is <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%3dp_1p_2p_3%2c%0aB%3dp_4%24">. These are the only two possibilities.</p>
<p>Which ways of splitting the prime factors <em>might</em> be optimal relates
to those Hasse diagrams above. The possibly-optimal splits between
<img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24A%24"> and <img src="https://chart.apis.google.com/chart?chf=bg,s,00000000&cht=tx&chl=%24B%24"> correspond to nodes that are just at the boundary of
the left and right halves of the diagram.</p>
<p>Nobody had an answer for what this order was called, so I could not
look it up. This is OK, I will figure it all out eventually.</p>