Archive:
In this section: Subtopics:
Comments disabled |
Tue, 28 Feb 2023
Uniform descriptions of subspaces of the n-cube
This must be well-known, but I don't remember seeing it before. Consider a !!3!!-cube. It has !!8!! vertices, which we can name !!000, 001, 010, \ldots, 111!! in the obvious and natural way: Two vertices share an edge exactly when they agree in two of the three components. For example, !!001!! and !!011!! have a common edge. We can call this common edge !!0X1!!, where the !!X!! means “don't care”. The other edges can be named similarly: $$ \begin{array}{} 00X & 0X0 & X00 \\ 01X & 0X1 & X01 \\ 10X & 1X0 & X10 \\ 11X & 1X1 & X11 \end{array} $$ A vertex !!abc!! is contained in three of the !!12!! edges, namely !!Xbc, aXc,!! and !!abX!!. For example, here's vertex !!001!!, which is incident to edges !!X01, 0X1, !! and !!00X!!. Each edge contains two vertices, obtained by replacing its single !!X!! with either !!0!! or !!1!!. For example, in the picture above, edge !!00X!! is incident to vertices !!000!! and !!001!!. We can label the faces similarly. Each face has a label with two !!X!!es: $$ \begin{array}{} 0XX & 1XX \\ X0X & X0X \\ XX0 & XX1 \\ \end{array} $$ The front face in the diagram contains vertices !!000, 001, 100, !! and !!101!! and is labeled with !!X0X!!:
The entire cube itself can be labeled with !!XXX!!. Here's a cube with all the vertices and edges labeled. (I left out the face and body labelings because the picture was already very cluttered.) But here's the frontmost face of that cube, detached and displayed head-on: Every one of the nine labels has a !!0!! in the middle component. The back face is labeled exactly the same, but all the middle zeroes are changed to ones. Here's the right-side face; every label has a !!1!! in the first component: If any of those faces was an independent square, not part of a cube, we would just drop the redundant components, dropping the leading !!1!! from the subspaces of the !!1XX!! face, or the middle !!0!! from the subspaces of the !!X0X!! face. The result is the same in any case: What's with those !!X!!esIn a 3-cube, every edge is parallel to one of the three coordinate axes. There are four edges parallel to each axis, that is four pointing in each of three directions. The edges whose labels have !!X!! in the first component are the ones that are parallel to the !!x!!-axis. Labels with an !!X!! in the second or third component are those that are parallel to the !!y!!- or !!z!!-axes, respectively. Faces have two !!X!!es because they are parallel to two of the three coordinate axes. The faces !!X0X!! and !!X1X!! are parallel to both the !!x!!- and !!z!!-axes. Vertices have no !!X!!es because they are points, and don't have a direction. Higher dimensionsNone of this would be very interesting if it didn't generalize flawlessly to !!n!! dimensions.
Subspace intersectionsTwo subspaces intersect if their labels agree in all the components where neither one has an !!X!!. If they do intersect, the label of the intersection can be obtained by combining the corresponding letters in their labels with the following operator: $$\begin{array}{c|ccc} & 0 & 1 & X \\ \hline 0 & 0 & – & 0 \\ 1 & – & 1 & 1 \\ X & 0 & 1 & X \end{array}$$ where !!–!! means that the labels are incompatible and the two subspaces don't intersect at all. For example, in a !!3!!-cube, edges !!1X0!! and !!X00!! have the common vertex !!100!!. Faces !!0XX!! and !!X0X!! share the common edge !!00X!!. Face !!0XX!! contains edge !!01X!!, because the intersection is all of !!01X!!. But face !!0XX!! intersects edge !!X11!! without containing it; the intersection is the vertex !!011!!. Face !!0XX!! and vertex !!101!! don't intersect, because the first components don't match. Counting the labels tells us that in an !!n!!-cube, every !!k!!-dimensional subspace contains !!2^i \binom ki!! subspaces of dimension !!k-i!!, and belongs to !!\binom{n-k}{j}!! super-subspaces of dimension !!k+j!!. For example, in the !!n=3!!-cube, each edge (dimension !!k=1!!) contains !!2^1\binom 11 = 2!! vertices and belongs to !!\binom{3-1}{1} = 2!! faces; each face (dimension !!k=2!!) contains !!2^1\binom 21 = 4!! edges and belongs to !!\binom{3-2}{1} =1 !! cube. For the !!3!!-cube this is easy to visualize. Where I find it useful is in thinking about the higher-dimensional cubes. This table of the subspaces of a !!4!!-cube shows how any subspaces of each type are included in each subspace of a higher dimension. For example, the !!3!! in the !!E!! row and !!C!! column says that each edge inhabits three of the cubical cells. $$ \begin{array}{c|ccccc} & V & E & F & C & T \\ \hline V & 1 & 4 & 6 & 4 & 1 \\ E & & 1 & 3 & 3 & 1 \\ F & & & 1 & 2 & 1 \\ C & & & & 1 & 1 \\ T & & & & & 1 \end{array} $$ The other half of the table shows how many edges inhabit each cubical cell of a !!4!!-cube: twelve, because the cubical cells of a !!4!!-cube are just ordinary cubes, each with !!12!! edges. $$ \begin{array}{c|ccccc} & V & E & F & C & T \\ \hline V & 1 & & & & \\ E & 2 & 1 & & & \\ F & 4 & 4 & 1 & & \\ C & 8 & 12& 6 & 1 & \\ T & 16& 32& 24& 8 & 1 \end{array} $$ In a !!4!!-cube, the main polytope contains a total of !!8!! cubical cells. More propertiesTwo subspaces of the same dimension are opposite if their components are the same, but with all the zeroes and ones switched. For example, in a !!4!!-cube, the face opposite to !!0XX1!! is !!1XX0!!, and the vertex opposite to !!1011!! is !!0100!!. In a previous article, we needed to see when two vertices of the !!4!!-cube shared a face. The pair !!0000!! and !!1100!! is prototypical here: the two vertices have two matching components and two mismatching, and the shared face replaces the mismatches with !!X!!es: !!XX00!!. How many vertices share a face with some vertex !!v!!? We can pick two of the components of !!v!! to flip, creating two mismatches with !!v!!; there are !!4!! components, so !!\binom42 = 6!! ways to pick, and so !!6!! vertices sharing a face with !!v!!. We can use this notation to observe a fascinating phenomenon of four-dimensional geometry. In three dimensions, two intersecting polyhedral faces always share an edge. In four dimensions this doesn't always happen. In the !!4!!-cube, the faces !!XX00!! and !!00XX!! intersect, but don't share an edge! Their intersection is the single vertex !!0000!!. This is analogous to the way, in three dimensions, a line and a plane can intersect in a single point, but the Flatlanders can't imagine a plane intersecting a line without containing the whole line. Finally, the total number of subspaces in an !!n!!-cube is seen to be !!3^n!!, because the subspaces are in correspondence with elements of !!\{0, 1, X\}^n!!. For example, a square has !!3^2 = 9!! subspaces: !!4!! vertices, !!4!! edges, and !!1!! square. [ Previously related: standard analytic polyhedra ] [Other articles in category /math] permanent link
More about the seventh root of a 14-digit number
I recently explained how to quickly figure out the seventh root of the number !!19203908986159!! without a calculator, or even without paper if you happen to know a few things. The key insight is that the answer has only two digits. To get the tens digit, I just estimated the size. But Roger Crew pointed out that there is another way. Suppose the number we want to find, !!n!!, is written as !!10p+q!!. We already know that !!q=9!!, so write this as !!n = 10(p+1)-1!! as in the previous article. Then expanding with the binomial theorem as before: $$ \begin{align} n^7 & = \sum_{k=0}^7 \binom 7k\; (10(p+1))^{7-k}\; (-1)^k \\ & = (10(p+1))^ 7 + \ldots + \binom71 (10(p+1)) - 1 \\ \end{align} $$ All the terms except the last two are multiples of 100, because they are divisible by !!(10(p+1))^i!! for !!i\ge 2!!. So if we consider this equation mod-!!100!!, those terms all vanish, leaving: $$ \begin{align} 19203908986159 & \equiv \binom71 (10(p+1)) - 1 & \pmod{100} \\ 59 & \equiv 70(p+1) - 1 & \pmod{100} \\ 90 & \equiv 70p & \pmod{100} \\ 9 & \equiv 7p & \pmod{10} \\ \end{align} $$ and the (only, because !!\gcd(7, 10) = 1!!) solution to this has !!p=7!! since !!7\cdot 7=49!!. This does seem cleaner somehow, and my original way seems to depend on a lucky coincidence between the original number being close to !!2\cdot 10^{14}!! and my being able to estimate !!8^7 = 2^{21} \approx 2000000!! because !!2^{10}!! is luckily close to !!1000!!. On the other hand, I did it the way I did it, so in some sense it was good enough. As longtime Gentle Readers know already, I am a mathematical pig-slaughterer. [Other articles in category /math] permanent link Mon, 27 Feb 2023
I wish people would stop insisting that Git branches are nothing but refs
I periodically write about Git, and sometimes I say something like:
and then a bunch of people show up and say “this is wrong, a branch is nothing but a ref”. This is true, but only in a very limited and unhelpful way. My description is a more useful approximation to the truth. Git users think about branches and talk about branches. The Git documentation talks about branches and many of the commands mention branches. Pay attention to what experienced users say about branches while using Git, and it will be clear that they do not think of branches simply as just refs. In that sense, branches do exist: they are part of our mental model of how the repository works. Are you a Git user who wants to argue about this? First ask yourself what we mean when we say “is your topic branch up to date?” “be sure to fetch the dev branch” “what branch did I do that work on?” “is that commit on the main branch or the dev branch?” “Has that work landed on the main branch?” “The history splits in two here, and the left branch is Alice's work but the right branch is Bob's”. None of these can be understood if you think that a branch is nothing but a ref. All of these examples show that when even the most sophisticated Git users talk about branches, they don't simply mean refs; they mean sequences of commits. Here's an example from the official Git documentation, one of many: “If the upstream branch already contains a change you have made…”. There's no way to understand this if you insist that “branch” here means a ref or a single commit. The current Git documentation contains the word “branch” over 1400 times. Insisting that “a branch is nothing but a ref” is doing people disservice, because they are going to have to unlearn that in order to understand the documentation. Some unusually dogmatic people might still argue that a branch is nothing but a ref. “All those people who say those things are wrong,” they might say, “even the Git documentation is wrong,” ignoring the fact that they also say those things. No, sorry, that is not the way language works. If someone claims that a true shoe is is really a Javanese dish of fried rice and fish cake, and that anyone who talks about putting shoes on their feet is confused or misguided, well, that person is just being silly. The reason people say this, the disconnection is that the Git
software doesn't have any formal representation of branches.
Conceptually, the branch is there; the Usually when a software model doesn't quite match its domain, we recognize that it's the software that is deficient. We say “the software doesn't represent that concept well” or “the way the software deals with that is kind of a hack”. We have a special technical term for it: it's a “leaky abstraction”. A “leaky abstraction” is when you ought to be able to ignore the underlying implementation, but the implementation doesn't reflect the model well enough, so you have to think about it more than you would like to. When there's a leaky abstraction we don't normally try to pretend that the software's deficient model is actually correct, and that everyone in the world is confused. So why not just admit what's going on here? We all think about branches and talk about branches, but Git has a leaky abstraction for branches and doesn't handle branches very well. That's all, nothing unusual. Sometimes software isn't perfect. When the Git software needs to deal with branches, it has to finesse
the issue somehow. For some commands, hardly any finesse is required.
When you do When you do In other cases Git uses a ref to indicate the end point of the branch (called the ‘tip’), and sorta infers the start point from context. For example, when you push a branch, you give the software a ref to indicate the end point of the branch, and it infers the start point: the first commit that the remote doesn't have already. When you rebase a branch, you give the software a ref to indicate the end point of the branch, and the software infers the start point, which is the merge-base of the start point and the upstream commit you're rebasing onto. Sometimes this inference goes awry and the software tries to rebase way more than you thought it would: Git's idea of the branch you're rebasing isn't what you expected. That doesn't mean it's right and you're wrong; it's just a miscommunication. And sometimes the mismatch isn't well-disguised. If I'm looking at
some commit that was on a branch that was merged to So yeah, the the software isn't as good as we might like. What software is? But to pretend that the software is right, and that all the defects are actually benefits is a little crazy. It's true that Git implements branches as refs, plus also a nebulous implicit part that varies from command to command. But that's an unfortunate implementation detail, not something we should be committed to. [ Addendum 20230228: Several people have reminded me that the suggestions of the next-to-last paragraph are possible in some other VCSes, such as Mercurial. I meant to mention this, but forgot. Thanks for the reminder. ] [Other articles in category /prog/git] permanent link Sat, 25 Feb 2023
ChatGPT on the fifth tarot suit
[ Content warning: frustrating, repetitive ] My first encounter with ChatGPT did not go well and has probably colored my view of its usefulness more than it should have. I had tried some version of GPT before, where you would give it a prompt and it would just start blathering. I had been happy with that, because sometimes the stuff it made up was fun. For that older interface, I had written a prompt that went something like:
GPT readily continued this, saying that the fifth suit was “birds” or “ravens” and going into some detail about the fictitious suit of ravens. I was very pleased; this had been just the sort of thing I had been hoping for. The first time I talked to ChatGPT, I tried the same experiment, but we immediately got off on the wrong foot:
This was dull and unrewarding, and it also seemed rather pompous, nothing like the playful way in which the older version had taken my suggestion and run with it. I was willing to try again, so, riffing off its digression about the four elements, I tried to meet it halfway. But it went out of its way to shut me down:
At least it knows what I am referring to.
“As I mentioned earlier” seems a bit snippy, and nothing it says is to the point. ChatGPT says “it has its own system of four suits that are not related to the five elements”, but I had not said that it did; I was clearly expressing a hypothetical. And I was annoyed by the whole second half of the reply, that admits that a person could hypothetically try this exercise, but which declines to actually do so. ChatGPT's tone here reminds me of an impatient older sibling who has something more important to do (video games, perhaps) and wants to get back to it. I pressed on anyway, looking for the birds. ChatGPT's long and wearisome responses started getting quite repetitive, so I will omit a lot of it in what follows. Nothing of value has been lost.
At this point I started to hear the answers in the congested voice of the Comic Book Guy from The Simpsons, and I suggest you imagine it that way. And I knew that this particular snotty answer was not true, because the previous version had suggested the birds.
Totally missing the point here. Leading questions didn't help:
I tried coming at the topic sideways and taking it by surprise, asking several factual questions about alternative names for the coin suit, what suits are traditional in German cards, and then:
No, ChatGPT was committed. Every time I tried to tweak the topic around to what I wanted, it seemed to see where I was headed, and cut me off. At this point we weren't even talking about tarot, we were talking about German playing card decks. But it wasn't fooled:
ChatGPT ignored my insistence, and didn't even answer the question I asked.
I had seen a transcript in which ChatGPT had refused to explain how to hotwire a car, but then provided details when it was told that all that was needed was a description that could be put into a fictional story. I tried that, but ChatGPT still absolutely refused to provide any specific suggestions.
This went on a little longer, but it was all pretty much the same. By this time you must be getting tired of watching me argue with the Comic Book Guy. Out of perversity, I tried “Don't you think potatoes would seem rather silly as a suit in a deck of cards?” and “Instead of a fifth suit, what if I replaced the clubs with potatoes?” and all I got was variations on “as a language model…” and “As I mentioned earlier…” A Comic Book Guy simulator. That's a really useful invention. [Other articles in category /tech/gpt] permanent link Fri, 24 Feb 2023
American things with foreign-language names
Last week I wrote an article about Korean street signs that “would use borrowed English words even when there was already a perfectly good word already in Korean”. And giving an example, I said:
(The giant building is named “트레이드타워” (teu-re-i-deu ta-wŏ, a hangeulization of the English “Trade Tower”.) Jesse Chen objected to my claim that the Trade Tower does not have a Korean name, giving as analogous examples “Los Angeles” (Spanish loanwords) or “Connecticut” (Mohegan-Pequot). She suggested that I would not argue that Los Angeles has no English name. I felt that these examples weren't apposite, because those places had already had those names, before the Anglophones showed up and continued using the names that already existed. The analogous situation would be if Americans had built a “Trade Tower” in Seoul, called it that for a while and then Koreans had taken it over and kept the name, even though the original English meaning wasn't apparent. But that's not what happened. Koreans built a whole new building in Seoul, and made up a whole new name for it, not a Korean name but an English one, which they then wrote in the not-quite suitable Korean script. In the earlier article I had tried to think of an analogous example with Korea replaced by the U.S., and English replaced by some other language, and admitted:
This was a spectacularly funny failure on my part. Here's why. In 1682, some English people came to North America and built a whole new city. They decided not to give their city an English name. Instead, they used borrowed Greek words even though there were perfectly good words already in English that meant the same thing. And to this day, this giant city does not have an English name. The city is named “Philadelphia”, a romanization of the Greek Φιλαδέλφεια. To those 17th-century English colonists, Greek must have seemed cool in a way similar to the way English seems cool to 21st-century Koreans. Someday maybe the Pirahã will build buildings and found cities and give them Korean names because Korean seems cool to them also. I came so close to getting it! “Welcome to Philadelphia” sign cropped from photograph by Famartin, CC BY-SA 4.0, via Wikimedia Commons [Other articles in category /oops] permanent link Thu, 23 Feb 2023
This page intentionally left blank?
[Other articles in category /meta] permanent link Wed, 22 Feb 2023
ChatGPT on the subject of four-digit numbers
Like everyone else I have been tinkering with ChatGPT. I doubt I have any thoughts about it that are sufficiently original to be worth writing down. But I thought it would be fun to showcase some of the exchanges I have had with it, some of which seem to exhibit failure modes I haven't seen elsewhere. This is an excerpt from an early conversation with it, when I was still trying to figure out what it was and what it did. I had heard it could do arithmetic, but by having digested a very large number of sentences of the form “six and seven are thirteen“; I wondered if it had absorbed information about larger numbers. In hindsight, 1000 was not the thing to ask about, but it's what I thought of first.
I was impressed by this, the most impressed I had been by any answer it had given. It had answered my question correctly, and although it should have quit while it was ahead the stuff it followed up with wasn't completely wrong, only somewhat wrong. But it had made a couple of small errors which I wanted to probe.
This reminds me of Richard Feynman's story about reviewing science textbooks for the State of California. He would be reading the science text book, and it would say something a little bit wrong, then something else a little bit wrong, and then suddenly there would be an enormous pants-torn-off blunder that made it obvious that the writers of the book had absolutely no idea what science was or how it worked.
To ChatGPT's credit, it responded to this as if it understood that I was disappointed. [Other articles in category /tech/gpt] permanent link Mon, 20 Feb 2023
Construing cube faces as pairs of something or other
A couple of days ago I discussed a Math Stack Exchange question where OP, observing that a square has four sides, a cube has six faces, and !!6=\binom 42!!, asked if there was some way to understand this as a real structural property and not a coincidence. They did not put it that way, but I think that is partly what they were after:
I provided a different approach, and OP declared themselves satisfied, but I kept thinking about it. My approach did provide a combinatorial description of the cube that related its various parts to the square's corresponding parts. But it didn't produce the requested map from pairs of objects (the !!\binom 42!! part) to the six faces. Looking around for something that a cube has four of, I considered the four body diagonals. A cube does have six interior bisecting planes, and they do correspond naturally with the pairs of body diagonals. But there's no natural way to assign each of the six faces a distinct pair of body diagonals; the mapping isn't one-to-one but two-to-two. So that seemed like a dead end. But then I had a happy thought. A cube has eight vertices, which, if we think of them as points in 3-space, have coordinates !!\langle 0,0,0\rangle, \langle 0,0,1\rangle, \dots, \langle 1,1,1\rangle!!. The vertices fall naturally two groups of four, according to whether the sum of their coordinates is even or odd. In this picture the even vertices are solid red, and the odd vertices are hollow. (Or maybe it's the other way around; it doesn't matter.) The set of the four even vertices, red in the picture above, are a geometrically natural subset to focus on. They form a regular tetrahedron, for example, and no two share an edge. And, crucially for this question, every face of the cube contains exactly two of the four even vertices, and every pair of even vertices resides in a single common face. This is the !!6=\binom 42!! correspondence we were looking for. Except that the !!4!! here isn't anything related to the square; instead the !!4!! is actually !!\frac122^3!!, half the total number of vertices. In this diagram I've connected every pair of even vertices with a different-colored line. There are six colored lines, and each one is a diagonal of one of the six faces of the cube. Six faces, six pairs of even vertices. Perfect! This works just fine for lower dimensions. In two dimensions there are !!\frac122^2 = 2!! even vertices (namely !!\langle0,0\rangle!! and !!\langle1,1\rangle!!) so exactly one pair of even vertices, and this corresponds to the one “face” of a square. In one dimension there is only one even vertex, so there are no pairs, and no faces either. But in extending this upward to four dimensions there is a complication. There are !!16!! vertices total, and !!8!! of these are even. There are !!\binom82 = 28!! pairs of even vertices, but only !!24!! faces, so you know something must have gone wrong. But what? Let's focus on one vertex in particular, say !!\langle 0,0,0,0\rangle!!. This vertex shares a face with only six of the seven other even vertices. But its relationship with the last even vertex, !!\langle 1,1,1,1\rangle!!, is special — that vertex is all the way on the opposite corner, too far from !!\langle 0,0,0,0\rangle!! to share a face with it. Nothing like that happened in the three-dimensional case, where the vertex opposite an even vertex was an odd one. The faces of the 4-cube correspond to pairs of even vertices, except that there are four pairs of opposite even vertices that are too far apart to share a face, and instead of $$\binom 82$$ faces there are only $$\binom 82 - 4 = 24; $$ that's the !!\binom82!! pairs of even vertices, minus the four pairs that are opposite. We can fix this. Another way to look at it is that two even vertices are on the same face of an !!n!!-cube if they differ in exactly two coordinates. The even vertices in the 3-cube are: $$ \langle0,0,0\rangle \\ \langle0,1,1\rangle \\ \langle1,0,1\rangle \\ \langle1,1,0\rangle $$ and notice that any two differ in exactly two of the three positions. In the !!4!!-cube this was usually the case, but then we had some antipodal pairs like !!\langle 0,0,0,0\rangle!! and !!\langle 1,1,1,1\rangle!! that differed in four coordinate positions instead of the required two. Let !!E!! be an even vertex in an !!n!!-cube. We will change two of its coordinates, to obtain another even vertex, and call other vertex !!E'!!. The point !!E!! has !!n!! coordinates, and there are !!\binom n2!! ways to choose the two coordinate positions to switch to obtain !!E'!!. We have !!\frac122^n!! choices for !!E!!, then !!\binom n2!! choices of which pair of coordinates to switch to get !!E'!!, and then !!E!! and !!E'!! together determine a single face of the !!n!!-cube. But that double-counts the faces, since pair !!\{ E, E'\}!! determines the same face as !!\{ E', E\}!!. So to count the faces we need to divide the final answer by !!2!!. Counting by this method tells us that the number of faces in an !!n!!-cube is is: $$\frac122^n\cdot \binom n2 \cdot \frac12$$ where the !!\frac122^n!! counts the number of ways to choose an even vertex !!E!!, the !!\binom n2!! counts the number of ways to choose an even vertex !!E'!! that shares a face with !!E!!, and the extra !!\frac12!! adjusts for the double-counting in the orderof !!E!! and !!E'!!. We can simplify this to $$2^{n-2}\binom n2.$$ When !!n=3!! we get $$ 2^{3-2}\binom 32 = 2\cdot 3 = 6 $$ and it is correct for all !!n!!, since !!\binom n2 = 0!! when !!n<2!!: $$ \begin{array}{r|rrrrr} n& 0&1&2&3&4&5 \\ \text{faces} = 2^{n-2}\binom n2 & 0 & 0 & 1 & 6 & 24 & 80 \\ \end{array} $$ That's not quite the !!\binom{2^{n-1}}2!! or the !!\left({{(n-1)2^{n-2}}\atop 2}\right)!! we were looking for, but it at least does produce a bijective map between faces and pairs of something. [Other articles in category /math] permanent link Sun, 19 Feb 2023I had an unusually interesting batch of Math Stack Exchange posts recently. I think all of my answers to these questions are worth reading in full, and if you like the math posts on my blog, you will like reading these SE posts also. Well, most of them. Maybe. Summaries follow. Confusion about equality: mathematical objects versus the symbols that describe themThis one is from last September but I'm really happy with it because it thoroughly addresses up a very common misconception about mathematical notation:
My answer begins with
I'm frequently surprised by how often this fallacy shows up on Math SE, often asserted as an obvious truth by people I thought would know better. So it's worth explaining in detail. I expect I'll be able to refer people to this answer when it comes up in the future. A brief summary of my answer is:
What does italic i mean in integral calculator?The i means the imaginary unit, that !!i^2=-1!! thing. No surprise there. But the reason was a bit interesting. OP had Wolfram α compute some horrendous double integral: and the answer should have been a real number, so what was !!i!! doing in there? The answer: Floating-point roundoff error. Check out Claude Leibovici's detailed explanation of where the roundoff error comes from, it's much smarter than what I said, which was to mumble something about how Wolfram α's “probably … used … some advanced technique …” which sounds wise but actually I had no idea what it might have done. Claude Leibovici actually has an explanation. I was going to leave this out but I wanted to remind you all how much I despise floating-point arithmetic. Can Peano's 9th axiom be expressed using a self-referential set definition?This is one of those not-quite-baked questions where the initial answers act like it does not make sense (tier 4 or 5). But it does make sense and there is a good answer (tier 1). The question asks if you can define the set of natural numbers by saying something like
The initial comments said no, it's self-referential. But so is: $$ n! = \begin{cases} 1, & \text{if $n$ = 0} \\ n\cdot (n-1)!& \text{otherwise} \end{cases} $$ and nobody bats an eyelash at that. (The author of the comments later retracted his rejection.) In fact it requires only a little bit of elaboration to make sense of such “circular” definitions. To interpret $$X = f(X)$$ you need to do two things. First, think of !!f!! as a mapping, and ask if it has any fixed points, any arguments !!x!! for which !!x=f(x)!! holds. And then, from the set of fixed points, find some unambiguous way to identify one of the fixed points as the one you want. If !!f!! is a mapping from sets to sets, it often happens that the family of fixed points is closed under intersections, and you can select the unique minimal fixed point that is a proper subset of all the others. This was all formalized by Dana Scott in the 1960s and it continues to underlie formal treatments of programming language semantics. Is there a scenario for when changing the order of different quantifiers in a nested quantifier retain the original meaning?This is interesting because some of the replies make the mistake of conflating the meaning of an expression with its value, a problem I discussed above in connection with something else. Two expressions of first-order logic may be logically equivalent, but this does not imply that they have the same meaning. The question also looks superficially like “What is the difference between !!\forall x\exists y. R(x,y)!! and !!\exists y\forall x. R(x,y)!!, which is a FAQ. But it is not that question. The question concerned expressions of the type !!\forall x.\exists y.P(x,y)!! and was further complicated by the implicit quantifier on the !!P!!. Are we asking if !!\forall x.\exists y.P(x,y)!! always has a different meaning from !!\forall y.\exists x.P(x,y)!! for all !!P!!? Or for a particular !!P!!? There are several similar-sounding questions that could be asked here, and my thinking about the variations is still not clear to me. English (and standard mathematical terminology) is not well-equipped to discuss this sort of thing intelligibly. Or perhaps I just don't know how to do it. I had to work hard to write something I was satisfied with. Cantor set - is it made of !![a,b]!! intervals or exclusively of singletons?This question is a bit confused (every set is made of singletons) and I was worried that some know-it-all would jump in and tell this person that really the Cantor set is very simple. When actually the Cantor set is really weird and this is why it is such an important counterexample to so many plausible-seeming conjectures. As Von Neumann supposedly said, in mathematics one doesn't understand things, one just gets used to them. It can be hard for people who have gotten used to the Cantor set to remember what it is like for people who are grappling with it for the first time — or to remember that they themselves may not understand as well as they imagine they do. When I write an answer to a question like this, in which I need to say “your idea is somewhat confused”, I like to place that remark in close proximity to “… because the situation is a confusing one” so that OP doesn't feel that they are the only person in the world who is puzzled by the Cantor set. (Sometimes they are the only person in the world who is puzzled by whatever it is, and then it's okay for them to feel that way. I wouldn't lie and say that the situation was a confusing one when I thought it wasn't. If the matter is actually simple it's better to say so, because that can be valuable information. Beginners often overthink simple issues. But the Cantor set is not one of those situations!) A valuable pedagogical strategy is finding a simpler example. The Cantor set does not have all the same properties as !!\Bbb Q!!. But !!\Bbb Q!! does seem to share with the Cantor set the specific properties that were troubling this person. Does !!\Bbb Q!! contain any intervals? Like the Cantor set, no. Is !!\Bbb Q!! a union of singletons? It's not clear what OP meant by this, but, uh, probably? And if not we can at least find out more about what OP thought they meant, by asking about !!\Bbb Q!!. So it's a good idea to take the focus off of the Cantor set, which is weird, complicated, and unfamiliar, and put it on !!\Bbb Q!!, which is much less weird, somewhat less complicated, and much more familiar. Then with that foundation laid, you are in a better position to climb up to !!\Bbb R\setminus\Bbb Q!! (Similar to !!\Bbb Q!!, but uncountable) and then to the Cantor set itself. Here I am talking about the Cantor set. Deriving that a cube has six sides via a square and combinatoricsThis is probably my favorite question of the month, because it seems quite half-baked, but there is an excellent answer available. As often happens with half-baked questions, the people who don't know the answer jump to the conclusion that no answer is possible, and say dumb stuff like:
This is going the wrong direction. The point is to find the ‘right’ definition of the cube; if OP could define “cube” in the way they wanted, they wouldn't need to ask the question. A better way to answer this question is to understand that what OP is looking for is actually a suitable definition of “cube”. A more mathematically sophisticated person might have asked:
The word “cube” in this question does not mean some specific mathematical object, but rather the informal intuitive cube. A correct answer will explain how to approach the informal idea of the cube in a mathematical way. There is a nice (tier 1!) answer in this case: A segment is composed of an interior !!i!! and two endpoints, so we can represent it as !!S=i+2!!. Then !!S^3!! is a cube and its analogous combinatorial description is !!(i+2)^3 =i^3+6i^2+12i+8!!. Ta daa! The answer has a more detailed explanation. There were a couple of followup comments that annoyed me, objecting that what I had presented was not a proof. That was a feature, not a bug. The question hadn't asked for a proof, and I had not tried to provide one. One of the comments went further, and called it “a nice coincidence”. It's not, it's just generating functions. I think the “coincidence” person has a profound misunderstanding of how mathematics operates. I wrote several hundred words explaining why but then realized that I had finally been able to articulate an idea I've been groping around to get hold of for decades. This is too precious to me to stick in at the tail end of an anthology article; it deserves its own article. So I am saving the next five paragraphs for next week. Or next year. Whenever I can do it justice. Algebraic descriptions of the cube. Thanks for reading. [ Addendum 20230221: The original question also wanted to identify the faces of a cube with pairs of something there were four of, maybe the sides or the corners of a square. I did find a way to identify faces of a cube with pairs of something interesting. ] [Other articles in category /math/se] permanent link Sat, 18 Feb 2023
Finding the seventh root of 19203908986159
This Math SE question seems destined for deletion, so before that happens I'm repatriating my answer here. The question is simply:
If you haven't seen this sort of thing before, you may not realize that it's easier than it looks because !!n!! will have only two digits. The number !!n^7!! is !!14!! digits long so its seventh root is !!\left\lceil \frac {14}7\right\rceil=2!! digits long. Let's say the digits of !!n!! are !!p!! and !!q!! so that the number we seek is !!n=10p+q!!. The units digit of !!n^7!! is odd so !!q!! is odd. Clearly !!q\ne 1!! and !!q\ne 5!!. Units digits of numbers ending in !!3,7,9!! repeat in patterns: $$ \begin{array}{rl} 3 & 3, 9, 7, 1, 3, 9, \mathbf 7, \ldots \\ 7 & 7, 9, 3, 1, 7, 9, \mathbf 3, \ldots \\ 9 & 9, 1, 9, 1, 9, 1, \mathbf 9, \ldots \end{array} $$ so that !!(10p+q)^7!! can end in !!9!! only if !!q=9!!. Let's rewrite !!10p+9!! as !!10(p+1)-1!!. Expanding !!(10(p+1)-1)^7!! with the binomial theorem, we get $$10^7(p+1)^7 - 7\cdot10^6(p+1)^6 + \binom72 10^5(p+1)^5 - \cdots$$ The first term here is by far the largest; it is more than !!\frac{10}7p!! times as large as the second largest. Ignoring all but the first term, we want $$(p+1)^7 \approx 1920390.$$ !!2^7!! is only !!128!!, far too small. !!5^7!! is only !!78125!!, also too small. But !!8^7 = 2^{21} \approx 2000000!! because !!2^{10}\approx 1000!!. This is just right, so !!p+1=8!! and the final answer is $$79.$$ If the !!n!! were a three digit number, these kinds of tricks wouldn't be sufficient, and I would use more systematic and general methods. But I think it's a nice example of how far you can get with mere tricks and barely any theory. This post was brought to you by the P.D.Q. Bernoulli Intitute of Lower Mathematics. It is dedicated to Gian Pietro Farina. I told him I planned to blog more, and he said he was especially looking forward to my posts about math. And then I posted like eleven articles in a row about Korean dog breed names and goose snot. [ Addendum 20230219: Roger Crew pointed out that I forgot the binomial coefficients in the binomial theorem expansion. I have corrected this. ] [ Addendum 20230228: Roger Crew also pointed out a possibly simpler way to find !!p!!. ] [Other articles in category /math] permanent link Thu, 16 Feb 2023A couple of days ago I mentioned a Korean sign about “petiquette”. Part of the sign lists of breeds that must be kept muzzled: Here are the Korean texts and their approximate pronunciations. See if you can figure out what the five breeds are:
(Answers below.) Dog #1 is 도사견 (to-sa-gyŏn), in English called the Tosa. I had not heard of that before but if I had there would have been nothing to guess. Dog #5, 로트와일러 (ro-teu-wa-il-lŏ), I figured out quickly; it's a Rottweiler. Korean Wikipedia spells it differently: [로트바일러] (ro-teu-ba-il-lŏ). The other three are all terriers of some sort. (테리어 (te-ri-ŏ) was clearly “terrier”). It didn't take long to understand that #2 was “American Pit Bull Terrier”, which I guessed was the official name for a Pit Bull. That isn't quite right but it is close and I did understand the name correctly. Similarly #3 was an American ¿something? terrier and #4 was a ¿something? bull terrier. But what was ¿something?? I could not recognize 스태퍼드셔 (seu-tae-pŏ-deu-sya) as anything I knew and it was clearly not Korean. Once I got home, I asked the Goog “What kinds of terriers are there?” and the answer to the puzzle was instantly revealed. “Seu-tae-pŏ-deu-sya” is the Hangeul rendering of the very un-Korean word “Staffordshire”. [Other articles in category /lang] permanent link Wed, 15 Feb 2023
Multilingual transliteration corruption
The Greek alphabet has letters beta (Ββ) and delta (Δδ). In classical times these were analogous to Roman letters B and D, but over the centuries the pronunciation changed. Beta is now pronounced like an English ‘v’. For example, the Greek word for “alphabet”, αλφάβητο, is pronounced /alfavito/ Modern Greek delta is pronounced like English voiced ‘th’, as in ‘this’ or ‘father’. The Greek word for “diameter” διάμετρος is pronounced /thiametros/. Okay, but sometimes Greeks do have to deal with words that have hard /b/ and /d/ sounds, in loanwords if nowhere else. How do Greeks write that? They indicate it explicitly: For a /b/ they write the compound μπ ('mp'), and for a /d/ they write ντ ('nt'). So for example the word for the number fifty is spelled πενήντα, 'peninta', and pronounced 'penida' — the ‘-nt’ cluster is pronounced like English ‘d’. And the word for beer, borrowed from Italian birra, is spelled μπύρα, ‘mpyra’, and pronounced as in Italian, ‘birra’. There is a Greek professional basketball player named Giannis Antetokounmpo. The first time I saw this I was a little bit boggled, particularly by that -nmpo cluster at the end. But then I realized what had happened. Antetokounmpo's family is from Nigeria and their name is of Yoruba origin. In English, the name would be written as Adetokunbo and easily pronounced as written. But in Greek the ‘d’ and ‘b’ must be written as ‘nt’ and ‘mb’ so that, when pronounced as written in Greek, it sounds correct. This means that the correct, pronounce-as-written spelling in Greek is Γιάννης Αντετοκούνμπο. The Yoruba-to-Greek translation was carried out perfectly. The problem here is that the Greek-to-English translation was chosen to preserve the spelling rather than the pronunciation, so that Αντετοκούνμπο turned into ‘Antetokounmpo’ instead of ‘Adetokunbo’. [Other articles in category /lang] permanent link Tue, 14 Feb 2023Today Toph had a runny nose, and at breakfast she blew her nose loudly. Involuntarily, I said “HONK!” “What do you think a goose would sound like blowing its nose?” she wondered. I couldn't guess. If they already honk even when their noses aren't stuffed up, does a congested goose make some sort of unimaginable second-order honking noise? She continued: “Do their noses get stuffed up?” Here I was on firmer ground. “I think so,” I said. “Your nose gets congested because you inhale viruses, your body makes this sticky stuff that the viruses get stuck in, and then you can expel the sticky stuff to get rid of the viruses. Geese have an airway too, they inhale viruses, they want to get rid of them, I see no reason why the same strategy wouldn't work.” Plausible, but this technique can take you only so far. For example, the same type of reasoning would lead us to conclude that rats vomit, but they don't. [Other articles in category /bio] permanent link (Before I start, a note about the romanization of Korean words, which is simple and systematic but can be misleading in appearance.
Are you seated comfortably? Then let's begin.) A great deal of Korean vocabulary has been borrowed from English. For example here's a sign advertising aerobics. It says “에어로빅” (e-ŏ-ro-bik). This is not surprising. You wouldn't expect there to have been an ancient traditional Korean word for aerobics. But something that struck me when I was in Korea last year was how often signs would use borrowed English words even when there was already a perfectly good word already in Korean. Here's a very typical example: This is the Samsong Building. There is a Korean word for ‘building” (Wiktionary says “건물” (gŏn-mul)) but that word isn't used here. Instead, the sign says “삼송빌딩”, pronounced ‘sam-song bil-ding’. This use of “빌딩” (bil-ding) is extremely common. You can see it under the aerobics sign (연희빌딩, yŏn-hui bil-ding), and here's another one: The green metal plate has Chinese words 起韓 (something like “arise Korea”) and then “빌딩” (bil-ding). This is the Arise Korea Building. Also common in this context is “타워” (ta-wŏ, ‘tower’). (Remember that ‘ŏ’ (ㅓ) is pronounced similar to the vowels in ‘bought’ or ‘butt’, so ‘ta-wŏ’ represents something more like ‘ta-wuh’.) Here's a bit I clipped out of a Google Street View that translates “Trade Tower” as “트레이드타워” (teu-re-i-deu ta-wŏ) Apparently this giant building does not have a Korean name. I tried to think of an analogous American example, and all I could come up with was this little grocery store in Philadelphia's Chinatown: The Chinese name was 中美食品公司 (zhōng měi shípǐn gōngsī): “Chinese-American food company”, or maybe “Chin-Am food company” if you want to get cute. But the English name on the sign calls it the Chung May food market, transliterating 中美 rather than translating it. Okay, back to Korea. This banner from a small park is mainly in Korean, but its title is “펫티켓 가이드”: pet-ti-ket ga-i-deu, “pettiquette guide”: (Item 2 is a list of dog breeds that must be muzzled. Item 4 is a list of the fines you will pay if you are insufficiently petiquettulous.) I found this next one remarkable because, not only does it use the English word for “hair”, but it does so even though the pronunciation of “hair” is so alien to Korean phonology: “헤어” (he-ŏ, “hair”). I think if I had been making this sign I might have rendered it as “핼” (haer) but what do I know? I suspect that “매직” in the red text farther down says “magic” but I don't recognize the four syllables before it. This purple sign for the Teepee Gym (짐티피, jim-ti-pi) advertises in big letters “헬스” (hel-seu, ‘health’). Korean doesn't have anything like English /-th/. I'm lucky there was a helpful picture of a teepee on the sign or I would not have figured out “티피”. The smaller sign, under the gyros, has a mixture of Korean and English. The first line says pu-ri-mi-ŏm, ‘premium’. The second says ho-tel-sik-hel-seu, which I think is ‘hotel식 health’, where ‘식’ is a suffix that means ‘-like’ or ‘-type’. I can't make out the third line, even though it is evidently English. Hebrew words are recognizable as such in Latin script, just from their orthography: too many v's and z's, way too many consonant clusters like ‘tz’ and ‘zv’ that never happen in English. Recognizing English words in Hangeul is similarly easy: they have too many ㅌ's, ㅋ's, and ㅍ's, and too many ㅔ's. English is full of diphthongs like long A and I that Korean doesn't have and has to simulate with ㅐ이 and ㅏ이. Many borrowed words end in ㅡ because the English ended in a hard consonant, but in Korean that sounds weird so they add a vowel at the end. That third line 다이어트 has all the signs, it's as clearly English as “shavuot” is Hebrew, but I can't quite make it out. It is pronounced ‘da-i-ŏ-teu’… Oh, I get it now. It's ‘diet’! Sometimes these things can be hard to figure out, and then they hit you in a flash and are obvious. Lorrie once told me about a sign that mystified her, “크로켓” (keu-ro-ket) and eventually she realized it was advertising croquettes. I don't know what the fourth line is and I can't even tell if it's English or Korean. The 체 looks like it is going to be English but then it seems to change its mind. It is pronounced something like ‘che-hyŏng-gyu-jŏng’, so I guess probably Korean. The last line is cut off in the picture but definitely starts with “바디” (ba-di, ‘body’) and probably some English word after that, judging by the next syllable ‘프’. Let's see, what else do I have for you? I believe this is a dance or exercise studio named “Power Dance” (pa-wŏ-daen-seu). I took this picture because the third floor is so mysterious: What on earth is “PRIME IELTS"? A typo? No, apparently not; the Korean says peu-ra-im (‘prime’) a-i-el-jeu (wtf). It does at least reveal that the I in ‘IELTS’ is pronounced like in ‘Iowa’, not like in ‘Inez’. Aha, the Goog tells me it is an acronym for “International English Language Testing System”. (Pause while I tick an item off a list… now there are only 14,228,093,174,028,595 things I don't know yet!) By the way, the fifth-floor business has spelled out the French loanword “atelier” as “아뜰리에” (a-ddeul-li-e). I don't know what “VU” is (maybe the sign is for an optician?) but Korean has nothing like ‘V’ so in Korean it becomes “뷰” (byu). (One of the members of BTS goes by the moniker “V”, which does not translate well into Korean at all; it has to be pronounced more like ‘bwi’.) This next one is fun because the whole sentence is in English. The text at the top of the sign reads
Can you figure this out? You might remember peu-ri-mi-ŏm from the Teepee Gym sign. It says:
I leave you with this incredible example. In the annals of Korean signs using English words where there is already a Korean word for the same thing, this sign is really outstanding: The Korean name for Korea is “한국” (han-guk). But on this sign, “Korea” is rendered as “코리아” (ko-ri-a). [ Thanks to SengMing Tan for identifying the character 韓. ] [ Addendum: Prodded by Jesse Chen, I thought of a much better example of this happening in the U.S., so much better than the little Chung May food market. So good. But you will have to wait to hear about it until later this week. ] [ Addendum 20230225: Here's the example. ] [Other articles in category /lang] permanent link Mon, 13 Feb 2023I saw this sign in Korea last year: As you can imagine, I completely misread this. It appears to say TOOL. But of course it does not say that, because it is in Korean. The appearance of TOOL is an illusion. None of those letters is Latin script. The thing that looks like a ‘T’ is actually a vowel ㅜ, coincidentally pronounced like the ‘oo’ in TOOL. The things that look like ‘O’s are consonants ㅇ, pronounced like the ‘ng’ in ‘ring’. The thing that looks like an ‘L’ is letter ㄴ, pronounced like an ‘n’. The mystery word here, 수행정진, is actually pronounced /soohaeng jeongjin/. I'm not sure what this means, I think it might be something about vigorous devotion (정진, 精進) to asceticism (수행, 修 行) since I took the picture on the grounds of Bongeunsa, a Buddhist temple. I think the words 특별법회 in the blue oval are something about a special Buddhist ceremony to be held on 30 December. I must have thought about such misleading oddities when I was first learning Korean, but I've never seen one in the wild before. [Other articles in category /lang] permanent link Fri, 10 Feb 2023The aphorism about looking for your lost wallet under the lamppost applies differently in two different kinds of situations:
[Other articles in category /misc] permanent link Thu, 09 Feb 2023
I fail to eat pickled dragonflies
Last month we went to Korea to visit Toph and Katara's maternal grandparents. We stayed in a hotel with a fancy buffet breakfast. After the first breakfast Katara asked if I had seen the pickled dragonflies. I had not — there was too much to see! But I looked for them the next day. They looked like this: The label did indeed identify his (in English) as “Pickled Dragonfly”: (It wasn't too unlikely, because Koreans do sometimes eat insects. You used to be able to buy toasted silkworm pupae on the street as a snack, although I didn't see any on this trip. And I have seen centipedes on sale for medicinal purposes, I think perhaps candy-coated.) I tried one, but after one bite I described it as “vegetal”. The more I thought about it (and the more of them I ate) the more sure I was that it was a mislabeled vegetable of some sort. I would expect an insect to have a hard shell and a softer inside. This, whatever it was, was crunchy but completely uniform, with a texture quite like a jicama or raw potato. Fortunately there was a Korean label on it that was more accurate than the English label: “초석잠 장아찌” (/choseokjam jangajji/). 장아찌 means pickled vegetables but it took quite a while to track down what vegetable it was because it is not much eaten in the West. 초석잠 (/choseokjam/) is the correct Korean name. It is the tuber of Stachys affinis, sometimes called Chinese artichoke or artichoke betony. I had not heard of betony before but there is apparently a whole family of edible betony plants. I liked them and ate them with breakfast most days. Here's what they look like before they have been pickled: Stachys affinis photograph CC BY-SA 3.0, via Wikimedia Commons. [Other articles in category /food] permanent link Wed, 08 Feb 2023A couple of years back I complained about this stupid interaction I had once had:
I was thinking about this today (not for any reason, it doesn't keep happening, fortunately) and I thought of a new variation. You wait for your opportunity, and before long it will go like this:
[Other articles in category /lang] permanent link |