Friday, August 30, 2019

The Harmony of the Spheres


I was in New York recently, and there’s no way I could have visited without taking a trip to the Museum of Mathematics, or MoMath. It was a wonderful museum, and I was very impressed with MoMath’s particular brand of “low floor, high ceiling” math – the kind of math that I love most. A lot of the exhibits on display were plays off of concepts I’d seen or done before, but the central sculpture on floor -1 was completely new, beautiful, and fascinating. It’s called the Harmony of the Spheres, and all I knew is that it had something to do with the mathematics of music. It wasn’t working properly that day, but it was supposed to play notes and light up depending on which sphere you touched.


I was immediately drawn the sculpture, and asked a passing volunteer what it meant. They didn’t know exactly what each node and connection represented, and then it became a puzzle to me and I stopped asking questions, pulled out a notebook, and sat down and stared at it.

The picture doesn’t do it justice – 3D sculptures are pretty hard to flatten into a picture without losing a lot. That didn’t stop me from trying it in a different way, and it came out 90% aesthetic, 10% helpful. The vertices (where two line segments meet) are the large circular nodes in the picture, and the line segments themselves are the connections between the nodes. The lengths of the line segments doesn’t mean anything – this was actually the shortest I could get them and still keep the lines straight.

At the very least, it should give you a vague understanding of about how many nodes there are and how they’re oriented.


I color-coded the circles to be the same as the colors they are in the picture in this set of representations, which should help a lot. This first node, at the center of it all, is the rightmost sphere in the picture, the red one. It’s tiny, compared to the picture, but that’s actually the biggest I could get it without covering up the details on the rest of the drawing.



Then, there’s two pink nodes, connected to each other and the red node.



Then, there’s three purple nodes, connected in a line (because the ones on the ends aren't connected to each other). The ones on the ends are connected to the pink nodes on that edge, and the one in the middle is connected to both.



Next is four blue nodes, connected in a line, with a similar “reverse pyramid” set of connections to the purple nodes.



You might be noticing now that I arranged them in a square, and the purple ones in an equilateral triangle, and so the next set must be:



Five cyan nodes, arranged in a pentagon.



And then six green nodes, arranged in a hexagon. At this point, if we ignore all the other nodes, this is a pretty simple construction. It looks like this.



But now (instead of a heptagon) another hexagon of yellow nodes come in, and it complicates things. They are not only linked in a line, like the previous set was – the ends are linked together.



I couldn’t draw it as a regular hexagon – that would mean the rest of it would have to be curved, but don’t read into that. This 2D picture is pretty, but consequences like this irregular hexagon originate from the squishing of 3D to 2D, not from any interesting or intrinsic properties.

Speaking of messy squishing, look at what the simplified version looks like now.



But all that’s left is a triangle of three orange nodes,



And one final red node.



And here’s the simplified version, in case it’s easier to read. It gets pretty messy at the end.



So, we’ve got this weird set of nodes and connections, there’s some sort of color coding involved, and no one knows what it’s supposed to mean. It’s supposed to be tied to music somehow, but there’s nothing fundamental about music that points to this strange structure. What’s even the point of all this?

After about an hour of scribbling and walking repeatedly around the sculpture to get different angles, I figured it out. This sculpture is a complete mapping of three-part harmony! Warning, there’s a teensy bit of music theory up ahead, but I tried to keep it very simple.

Let me explain how it works. Imagine you hit a piano with three fingers, each pressing down a key. There’s a couple of possibilities of what that would sound like, right? They could be playing a major chord, a very discordant set of notes, or even all the same note.

With that in mind, here’s the kicker: each node on this sculpture is a possible arrangement of your three fingers.

But wait a minute, I hear your fictional voice say, there’s a ton of keys on the piano, and many more combinations of three! There’s so few nodes on that picture! And you’re right: for this sculpture, we’re only concerned about the intervals, not the notes themselves. If your fingers fall on three consecutive keys on the right side of the piano, and then three consecutive keys on the left side, those are the same for our purposes. It’s the same with relation to itself, you just picked it up and moved it with relation to the piano, and that doesn’t matter. Changes in octave also don’t matter. A piano has the same twelve notes repeated over and over – the pitches are different, but we consider a high C and a low C and a middle C all the same.

The obvious next question is “what do two connected nodes mean?” followed shortly by “what do the colors mean?” This sculpture is ingeniously designed to answer just those questions. The connections connect two “adjacent” nodes in harmony – it means that one finger changes its note by a half-step. If you’re mashing down three notes, and one finger decides to move to the next key either above or below it, you just traveled from one node to another by using one of the connections.

Well, which nodes are which? Let’s start with the very first node I introduced. The red node, at the rightmost side of the photo, the bottom of the diagram. This node is unison – all three fingers are on the same key. Let’s call it E, for convenience.

If you want to go to one of the pink nodes, it doesn’t matter which one of your fingers you move. It does matter, however, whether you choose to go up or down with it. Let’s say that the right pink node is going down, and the left pink node is going up. That means the right pink node is “two fingers on one key, one finger on the key just below it” and the left one is “two fingers on one key, one finger on the key just above it”. So far so good.



Now, let’s try to get to one of the purple nodes. If you have two fingers on E and one on F (putting you on the left pink node), and you move one of your E fingers up to F, you actually move over to the other pink node, because now you have two on F and one on E. No, to move to a purple node, you have to get farther away. You can move the F up to F#, which gets you to the left purple node, or one of your E fingers down to D#, which gets you to the center purple node, with one finger on each of three consecutive keys. Those are the only places you can go from this node, outside of moving the F back down to E and returning to the red node. The right purple node can only be reached through the right pink node, as you can see on the drawing and the sculpture!


I’m not going to go through all of the nodes, but you should be starting to see how clever this sculpture is! The color-coding is a measure of how far away from unison and each other the notes are getting. Pink means that one step was taken away from unison, purple means that two steps were taken, etc.

And eventually, because there are only twelve notes, any note that’s getting higher or lower comes back to unison! Look at this progression, of keeping two fingers on the same note, and increasing the note on the other one continuously – it comes back around!



The last, furthest away node, also colored red in the sculpture, is the farthest any three notes can get from each other before they start coming back. It’s the intervals for an augmented chord – a full four semitones between each of the three notes! That node is connected to two orange nodes – those are what we know as major and minor chords!



And that is the story of the beautiful sculpture at the Museum of Mathematics and how much fun I had figuring out how it worked!


Saturday, March 23, 2019

Rose VIII: Those Pesky Even Rules

Now, it’s time to tackle those annoying even rules. Unlike the odd rules, they don’t play nice. I wasn’t able to find proofs or perfect colorings like I could with the other rules – it took a long, inelegant, case-by-case proof to show that ¾ coloring isn’t possible for the “four colored points in a row” case. It's summarized in this earlier post in flowchart form, if you're intensely curious. Here, I'm only going to explain how and why the standard technique doesn’t work.

Throughout these problems, our technique for coloring as much as possible has always been this: color as many as you can along one axis, leave one point uncolored, color as many as you can again, repeat. Then, do the same thing on the next row, but start a few points over, so you don’t have two uncolored points in a row in the other direction. That’s the technique that can never work for an even isometric rule.


The best way to explain this is to try it. Let’s say we pick some stagger, and we plan to repeat that stagger to get the best coloring for an even rule “n colored points in a row”. Now, the number of spaces you stagger it by must be relatively prime to n. Look at the example below, where the rule is n=4 (“4 colored points in a row is not allowed”) and the stagger is 2.


The stagger will never put an uncolored point in rows 1 and 3, so we have to use a stagger of 1 or 3, because they’re relatively prime to 4. But that doesn’t work either. Look at this same picture another way. A stagger of 2 in that direction is a stagger of 3 in this direction, and this direction works.


When you pick a stagger for the next line, you’re actually picking a stagger pair. The stagger in the two directions will always have a difference of 1, just due to the geometry of the isometric grid. And these two numbers have to be relatively prime to your n. And of course, of two consecutive numbers, one must be even, so you can never have a repeating stagger for an even rule. Odd rules work just fine, because they can be prime, and even if they aren’t, the stagger pair 1 and 2 will always be relatively prime with an odd number (which, non-coincidentally, was the stagger pair I used for the proof last time).

That’s a pretty important finding. The geometry of the grid prevents us from using that technique for even rules. As for other techniques, like varying the stagger per line, I haven’t had much success. I proved that a ¾ coloring isn’t possible with a rule of n = 4, but that doesn’t tell us that we can’t get very close to it.

So we’re left with the task of finding a decent lower bound for the even rules. The consistent bounds I found were just the optimal solutions for the n-1 rule case: the provably optimal solution to “five points in a row” is pretty good for “six points in a row”. I also tried a few interesting ideas, taking suboptimal staggers like the one above and leaving some extra points uncolored to make them follow the rules, and those squeezed out tiny improvements over the earlier bounds. The “four colored points” rule has the lower bound of 2/3 borrowed from the “three colored points” rule, but there’s a configuration with three rows of ¾ and one row of ½, which is 11/16 colored, making it a little better than our bound.


This is a really interesting coloring. Notice how there's a colored-colored-uncolored-uncolored pattern in every fourth diagonal, and in the rows it's a colored-uncolored-colored-uncolored pattern, which come together to satisfy the condition everywhere. There's definitely some good problem ore here, no matter how much tedious work it's buried behind.

But for now, here are my final conclusions on the Isometric Rose problems. Odd rules can be proven to have an optimal coloring given by a (1,2) stagger, with (n - 1)/n % of the space colored. Even rules may not have optimal colorings, and have weak lower bounds of (n - 2)/(n – 1) % of the space colored. Until next time, when I will hopefully have a new problem to talk about!

Friday, January 4, 2019

Rose VII: Odd Isometric Rules


Last time, we proved that the “four colored points in a row” rule can never reach the optimal ¾ coloring in isometric space. Yet somehow, the odd rules are optimal like clockwork.

We’ve got two main directions to go in, at this point. We can look at the simpler odd rules and try to prove that every odd rule has an optimal coloring, or we could look at the complicated even rules and try to find out why they don’t work as well, and try to figure out efficient colorings for them. Let’s do the former in this post.

Warning, there’s a dry-ish proof coming. It’s not thaaaat difficult to follow, but admittedly that’s coming from the guy who wrote it. I’ll try to be extra precise and descriptive, and will illustrate the steps as much as possible.

Wednesday, January 2, 2019

Rose VI: Even and Odd Rules in Isometric Space


Last time, we proved that 1/3 colored was the best you could do on an isometric grid, if your rule was “two colored points in a row are not allowed”. And that’s pretty interesting – it’s already very different from the squares we’re used to. So, let’s so how different other rules are.

The next logical rule to try is “three colored points in a row are not allowed”, so let’s jump in and try our old staircase technique on it. (The colored points are a light yellow, so it’s a little easier to see them.)



I just shifted each row over by one relative to the previous row, and it just works. Our technique didn’t work on the first rule we tried, but somehow it works on this one. We get a nice 2/3 coloring, and it’s very easy to prove it’s the most optimal coloring – 2/3 is the highest percent of any row you can color, so it’s the upper bound for how much of the space can be colored.

So the question here is – when does our shifting technique work, and when do we need to use some other technique / cleverness to get the optimal coloring? Let’s try the next rule, “four colored points in a row are not allowed”.


And as you can see, it just doesn’t work. I tried staggering the next row by different amounts, but they all don’t line up in one of the three directions. It’s interesting that both colorings are perfect in two of the three directions – looking at the patterns left to right and along one diagonal, they’re perfectly three-colored-one-uncolored in a row. But along the other diagonal, there’s one row of alternating colored-uncolored, and then a row of all colored (which breaks the rule).

This doesn’t necessarily mean that the rule doesn’t have a coloring that is ¾ colored, it just means that we haven’t found it. Before we delve too deep into this rule, let’s look at the next rule – some context of surrounding, similar problems often gives strong insight into a tough nut to crack.


And just like that, the next rule has a provably optimal coloring. All the diagonals work out, and you can kind of see that this is the isometric analogue to a square staircase.

So, a pattern is starting to emerge here. Rules with an odd number of colored points in a row seem to work out nicely, and rules with an even number of points don’t. I did a few more, to make sure the pattern held.

Let’s zoom back in on the “four colored points” rule case. The next logical thing I can think of to try is to try staggering the ¾ row in other ways. If ¾ colored is possible, it’s made of ¾ colored rows, so maybe we can stagger those rows in the right way to find a coloring. This turned out to be a pretty messy case-by-case proof, which I’ve summarized here.


The basic idea is to build up every possible way to stagger the pattern of three-colored-one-uncolored in rows to make the diagonals work out. Anytime a case leads to a situation where you can’t use the three-colored-one-uncolored pattern, you know that that case can’t ever produce a ¾ colored coloring.

I wrote out the first line, and then there are four different ways to stagger the next line, but the later two are just the first two flipped, so there’s two ways this pattern can start. Then, we break each of those into two cases, based on the existence of a particular colored point in the third row. As you can see, if that point, indicated by a red triangle, is in the final pattern, it means that there must be two uncolored points in the fourth row, so neither of those cases can achieve ¾ coloring. If those red points are uncolored, it turns out both of those cases also have two out of four points in the fourth row uncolored.

And so, with this very messy proof, we’ve proved that the optimal coloring of an isometric space with the rule “four colored points in a row is not allowed” can’t ever reach the theoretical maximum of ¾! More on that next time!