Welcome to another Mathologer video. Are you here for your monthly fix of mathematical wonders? Well, I’ve got just the thing for you. Really off-the beaten track: Petr’s perfection-hiding-in-garbage miracle discovered over 100 years ago. Plus a truly miraculous visual explanation of this miracle that not even most experts will be aware of. Plus, a nice coding challenge at the end for all the coding wizzes among you:) Intrigued? I sure hope so! Well then, let’s start by drawing a random pentagon. There 1, 2, 3, 4, 5, a random, boring, screwed up pentagon. Okay pentagon … five sides … 360 degrees divided by 5 that’s 72 degrees. Let’s add 72 degree isosceles ears to the five sides of the pentagon. There. Remember isosceles means that the two gray sides of our triangular ear are the same length. Okay, more ears. There, there, there. Now the tips of our ears form another screwed up pentagon. Slightly less screwy than the one we started with but still pretty boring:) What comes next? Well, more ears of course. But this time let’s use 2 x 72 that’s 144 degree ears. There. Four more. Aaaand… A third boring pentagon:) How long can I go on like this before you switch channels?:) But wait, things are about to get veeery interesting. What’s next? Well, so far we’ve had 1 times 72 degrees, then 2 times 72, and so 3 times 72 = 216 degrees is next. Because this angle is larger than 180 degrees it will register on the inside of the pentagon like this. And there you have it. One more boring, no wait, …. that new pentagon is the opposite of boring! a perfect regular one, all sides and angles are the same. How wonderful is that?:) And, no, this is NOT a coincidence. In fact, this is just the first of a string of closely related miracles. First miracle, this works no matter what screwed up pentagon you start with. Have a look. I made up this little geogebra app that allows you to interactively move around the vertices of the initial pentagon and it shows you how the other pentagons evolve. How easy it is to make up something like this these days is a little miracle in itself:) I link to my app in the description and show you how I built it at the end of the video. Oh, and there, as you can see, if you start with a regular pentagon, all the other pentagons will be regular as well. Okay, what other miracles are there? Well, something interesting happens when you attach the different types of ears in a different order. For example, let’s use this order. First 72, well that’s the same start as before and so we get the same green pentagon in the first step. The second pentagon is different. Now here is miracle no 2. At the end of the next step, we get this… Exactly the same regular pentagon as before:) In fact, the same is true for any ear order:) There, there, there. Next miracle. Everything I said so far, works for any polygon, with any number of sides:) For example, here is a screwy 10-gon infinity sign. What sort of ears are we supposed to use here? Well, 10-gon, 10, 360/10 that’s 36. With pentagons we used the first 3 multiples of 72, 3 is 2 less than 5. Similarly here we’ll use the first 10-2=8 multiples of 36. Here, 1 times 36, 2 times, 3 times, and so on. Let’s attach ears. 36 degree ears. Alright. 72 degree ears. And so on. Ready for the finale? There, a regular 10-gon. And again we can permute the order in which we unleash the different ears and we’ll always end up with exactly the same regular 10-gon. There, there. Okay, what are some natural questions to ask at
Segment 2 (05:00 - 10:00)
this point? Well there are a couple. Mainly, why the hell does this work?:) We’ll get to that shortly. But what about: What does all this look like for the simplest case, the triangles. Well in this simplest case. 360 divided by 3 is 120. And since 3-2 is 1, just attaching 120 degree ears should result in an equilateral triangle. Right? Let’s check. Wonderful:) This special case of our miracle is known as Napoleon’s theorem. Did Napoleon discover this? Actually nobody knows how this result ended up being called Napoleon’s theorem. Definitely the people in the know very much doubt that Napoleon had anything to do with its discovery. In fact, the first documented mention of this special case of our miracle was by the mathematician William Rutherford in 1826 who sadly did not share with the rest of the world where he learned about this theorem. The discovery of the full-blown miracle is due to the Czech mathematician Karel Petr who reported on it in a paper published in 1905. O jedne vete pro mnoho_uhelniky rovinne. I probably butchered that one:) Anyway it translates to “On a theorem for plane polygons. ” How’s that for an anti-click bait title. For almost 100 years, this remarkable paper appears to have gone largely unnoticed. Having said that, around 1940 our miracle was rediscovered independently by the American mathematician Jessy Douglas, one of the first Fields medallists, and the German-born British Australian mathematician Bernhard Neumann and was subsequently named after these two mathematicians. The original discoverer was only widely recognized fairly recently and our miracle is now usually referred to as the Petr-Douglas-Neumann theorem. So, why didn’t anybody take notice of this spectacular result when it was first published? Well, not many mathematicians read Czech maths journals:) But then, Petr actually did republish his result in German in 1908. (Ein Satz über Vielecke) I definitely nailed the pronunciation of that one, and you know why, right?:) Well, German was one of main languages for communicating mathematical discoveries at the time. So, why do you think nobody took notice? I’ve got my own theory, but what do YOU think the reason might be?:) Leave your thoughts in the comments:) On with the big question: Why the hell does this work?:) Well, let me take you on a little journey of discovery to chase down the answer to this question. Lots more miracles and beautiful mathematics to look forward to. Promise:) Okay, so let’s dig a little bit deeper. Just now I glossed over a problem with the ears. Did you notice anything fishy? Well, time to fess up and get this problem sorted out. Turns out there is a problem with me saying: attach 72 degree ears. Why is there a problem? Just put the ears on the outside when they are less than 180 degrees and have them register on the inside if they are greater than 180 degrees. To highlight the problem, let’s have another look at our infinity shaped 10-gon. This time let’s attach the 36 degree ears one by one. There, 1, 2, 3, 4. Can you see the problem now? With ear 5 it’s no longer clear what’s inside or outside, on which side of the segment we should attach the next ear. What we did before was this: 5, 6, 7, 8, 9, and 10. That’s fine, but if we’d started at the bottom, going for the outside, we would have attached the first ear here… 2, 3, 4, and so on. Very different from what we got before. There compare. Now, for Petr’s miracle to pan out, either way of attaching ears will work, we just have to be consistent. But, how are we supposed to be consistent throughout the whole construction? After all, there are a number of polygons that need to be decorated with ears, not just one:) Well, to start, what we do is to go for a run around the polygon. For this we first pick a direction in which we’ll travel. And then we start running. As we run, we attach the ears one after the other, and we always attach the ears to our left, with the proviso that angles greater than 180 degrees register to our right. Okay, let’s go again. Ear 1. I just attached this to my left. Ear 2. Now at this point we already know two points of
Segment 3 (10:00 - 15:00)
the second green polygon and I think you can guess in which direction we’ll be traversing the green polygon. Right? This one, of course. Okay, keep moving along the blue curve and keep attaching ears. Got it? Pretty easy. But not quite finished yet. Let’s quickly spool back to the beginning. So the direction of running along the second green polygon is forced on us by our initial choice of direction on the blue polygon. But once the green direction is pinned down, we also know how to add ears to that third polygon, and so on. Have a look. Aha!:) And so once we’ve chosen a direction of travel on the original polygon, the directions other polygons is also clear. All good? Alright! Wonderful. To keep things uncluttered I’ll just mark the directions on the first polygon and last polygon. Okay, and what would this diagram look like if, to start with, we travelled in the opposite direction? Let’s have a look. As different as day and night:) In particular, both the directions on the starting and finishing polygons have flipped. Also, have a close look at the final 10-gons in both scenarios. The final regular polygons are different in size and orientation! However, they do have something in common. Can you guess? Yes, they have the same center. Curious: not the same, but sharing the same center. Why is that? We’ll get to that too:) There is another ear oddity that we need to address:) Remember, to find the angle of the smallest ear for the 10-gon, we divide 360 by 10, and that’s 36. And to get to the regular 10-gon, we use the first 8 multiples of 36. There, 1, 2, 3, 4, 5, 6, 7, 8. Right. But why stop here? Why not also use the 9th angle? Doesn’t that seem like a really natural thing to do? Well, let’s see what happens if we also do use this last angle. Isn’t that interesting? All the tips of the ears end up in the middle of the regular 10-gon:). What about our pentagon example? Well, here the next angle is 4 times 72 = 288 degrees. And if we add 288 degree ears … we also end up in the center of the regular pentagon. Same thing. In fact, similar to what we noticed before, if we unleash those four types of ears in any order whatsoever, we’ll always end up in the same point. Have a look. There different order. Let’s quickly go through the individual steps. Initial orientation. 288 degree ears. 72 degree ears. 216 degree ears. 144 degree ears. Same point. Also, similar to what we already observed previously, removing the last angle, and just shuffling the order of the remaining three angles will always, can you guess what comes next?:) Yes, no matter in what order we apply the remaining angles, we’ll always end up with the same red pentagram. And so, by adjusting my choice of ears in the intro, I could have made things more mysterious by having all my pentagons morph into devilish pentagrams:) So, there are these special polygons that collapse to a point when certain ears are slapped on. These special polygons turn out to be very important for figuring out the WHY the hell does this work? Let’s have a closer look. In the case of pentagons, we are dealing with four different ear angles and it’s easy to see that for every one of these angles there is exactly one special type
Segment 4 (15:00 - 20:00)
of oriented pentagon that collapses to the point in the middle when we attach the corresponding ears. Right, for 72 degrees… the oriented regular pentagon on the right will collapse to the middle when we attach 72 degree ears:) For 288 degrees, the angle that complements 72 degrees the same regular pentagon with the direction of travel reversed will collapse to the middle when we attach 288 degree ears. Similarly for 144 degrees and its complementary angle 216 degrees. In fact, for 72 degrees it’s pretty obvious that the only pentagons that will collapse to a point when we attach 72 degree ears is this particular oriented pentagon rotated and scaled in all possible ways. And similarly for all the other angles. So four different types of special pentagons. Cool.:) Oh, before I forget, one more easy but important insight. If you put other ears on one of the special pentagons, you always end up with a special pentagon of the same type. For example, let’s put some different ears on in this case. There, there, there. Another one of the special pentagons of the same type that we started with:) And this works for any type ear for all these special pentagons. Right? Attach any kind of ear and, either all the tips will end up in the middle or the tips will form a special pentagon of the same type as the one we started with. Right:) That’s all very interesting, isn’t it? And doesn’t it feel like the real explanation is just hiding around the corner? How did we start again? Well, we added these ears in any order and were left with this special type pentagon. On the other hand, when we used these three ears we ended up with this special type. Also, as we were applying the ears, the intermediate pentagons appeared to get closer and closer to the final type, they somehow smoothed out. Have you got a theory for what might be happening here? I am sure quite a few of you will be on the right track by now. Anyway, let me show you what’s really going on. Hmm, all clear? No? Well, in a nutshell, what this set of diagrams illustrates is an example of a very surprising fact: under the hood every pentagon, no matter how screwed up, is the sum of four special pentagons, one of each of the four types. And then, slapping on three of our special ears wipes out three of these special summands and leaves us with the remaining fourth special summand. That was a bit fast and also a bit wrong but that’s the amazing gist of it. The ears wipe out three of the four invisible super nice components of a pentagon and what remains is then of course supernice itself. Amazing, right?:) Before we go into the details, let me thank John Harnad for lobbying for a Mathologer video about Petr’s miracle. And I’d also like to mention where I learned this nice one-glance way of making sense of the miracle. There Eigenpolygon decomposition of Polygons, a Microsoft technical memo authored by none other than Alvy Ray Smith, one of the legendary founders of Pixar. Remember Toy Story? That Pixar. Maths sure can take you strange places:) Also, remember me in Toy Story? No? Me neither, I don’t remember appearing in Toy Story. But turns out my new best friend ChatGPT does:) Anyway, let’s get back to our magical set of diagrams. Okay so these four special pentagons are all centered at the origin. They are also supposed to be of the four different types. But then where are the arrows that indicate the directions of travel?:) Well, let’s zoom in a bit for the moment and put in those arrows. There the two regular pentagons running in opposite directions. And the regular pentagrams also Actually the arrows are not really needed, as the direction of travel is built into the coloring of the vertices. It’s always red, black, orange, blue, green, and back to red:) Okay, let’s zoom out again. Now I said that our screwy pentagon is the sum of the four special pentagons. In what sense?:) Well, just take the x and y coordinates of the four red vertices at the bottom, add them up, and you get the x and y coordinates of the red vertex of our screwy pentagon at the top. Neat:) Weeeeell, not quite, there is also the diagram at the bottom left that
Segment 5 (20:00 - 25:00)
we have not talked about yet. This diagram also shows a pentagon, but a really weird one:) A “degenerate” infinitely small pentagon all of whose vertices coincide with this one point. What? A pentagon all of whose vertices are the same? Well, mathematicians are weird, get used to it:) Anyway, important, in this strange degenerate pentagon the different vertices all have the same coordinates:) Now, also add these coordinates to the other red coordinates at the bottom and this really gives the coordinates of the red vertex at the top. The same is true for the black vertices, the orange ones, the blue ones, and the green ones. Faantastic:) Also, it should be clear that the direction of travel around the top pentagon is the usual one. There, that’s the direction of travel:) In fact, just in case you ever want to reconstruct the direction of travel in anything that follows, it’s always red to black, and so on, as up there. Okay, let’s slap some ears on all the pentagons:) 72 degrees first. What happened?:) Well, on the left, how do you put ears on that degenerate infinitely small pentagon?:) Well, it’s also infinitely small ears and so all the tips of these ears will end up at the same point as all the five vertices. Weird, but makes sense right? Okay, then on the right, all tips of those ears end up at the origin. Okay, so, clearly, some zapping in action here. Hmhm:) And then, what are the new pentagons?:) Well, as we are travelling around the original pentagons starting at red we are creating and coloring the ears one by one like this. Red black, orange, blue, green. Alright:) So, there are the new pentagons, all colored in. Aha! See that new degenerate monster that just spawned on the right?:) And, well it’s not obvious, but it turns out that, as before, the red x and y coordinates at the bottom add to the red coordinates at the top, the black ones at the bottom add to top, and so on:) And, notice, the new pentagon at the top really looks more regular than the one we started with. Right?:) This is a consequence of the fact that the special type pentagon on the far right is now degenerate and no longer contributes to the sum. Makes sense doesn’t it? Its x and y coordinates are both equal to zero, so no contribution. And now it’s all plain sailing from here. Slap on the 144 degree ears and the picture in front of us changes like this. Attach the ears, connect the tips, color. 3 times 72, 216 degrees is next. Add the ears, connect the tips, color. And that’s it, all but one of the special pentagons have been “degenerated”:) and the only thing remaining is a regular pentagon. Super duper neat isn’t it?:) But wait, for some more icing on the cake, let’s also slap on the last type of ears:) Attach the ears. nothing to connect, so just color. And so that degenerate point at the bottom left all along coincides with that special point that we end up with at the top. And so that degenerate point at the bottom left that we’ve been staring at all along, coincides with that special point that we end up with at the top. Neat how it all comes together, isn’t it:) Here are two little challenges for you: First, how does all this show that the degenerate point is the centroid, the center of mass of all the pentagons that we come across at the top?:) And when I say pentagon, here I just mean the vertices, the center of mass of the vertices. So the center of mass of these five points, and of these five, and of these five points. So nice:) Second challenge: What would we end up with if, instead of slapping on rounds of 72, 144, 216 degree ears once each, I used one round of 72, two rounds of 144 and three rounds of 216? Should be easy to figure out at this point:) Leave your thoughts in the comments. Very cool how the different pentagons at the top split into their components and how, when
Segment 6 (25:00 - 30:00)
you get close to one of the special pentagons, its corresponding component dominates the other ones. Absolute magic:) Seeing is believing. Seeing is believing, yes, but of course what I have not explained yet is why: 1) every pentagon is an amazing sum like this and 2) why slapping on our ears and transitioning from one pentagon to the next preserves the sum property. I should really say something about all that shouldn’t I?:) After all this is Mathologer:) Okay, so why is every pentagon a sum of those special ones? This may seem very surprising at first glance but it actually isn’t, once you think about it for a bit:) Right, what ARE we playing with at the bottom? Well, for every one of these special pentagons… we can turn and scale in all possible ways, that gives 2 times 4 degrees of freedom. In addition, the x and y coordinates of the special point at the bottom left gives another two degrees of freedom. So, in total we’ve got 8+2 =10 degrees of freedom to adjust things at the bottom. On the other hand, the x and y coordinates of the 5 vertices of the pentagon at the top also correspond to 2 times 5 = 10 degrees of freedom:) And so, if we adjust those 10 variables at the bottom and add up, we’ll definitely create a lot of different pentagons at the top. And since we are dealing with 10 degrees of freedom both at the top and at the bottom, it’s definitely conceivable that we get all pentagons this way. In fact, there is a superslick way of mathifying all this using complex numbers, even Petr already used this trick in his original paper. For this you interpret the coordinate pairs of all points in sight as one complex number each, liiiike this: So the x- and y-coordinates become the real and imaginary parts of the complex numbers and every pentagon turns into a list of five complex numbers. But then the pentagons at the bottom can be written as these extra special pentagons multiplied by some complex numbers. Remember multiplying by complex numbers rotates and scales. And then the task of writing a pentagon as one of our special sums simply amounts to solving a system of linear equations. That this system always has a unique solution is easily checked, for example by calculating the determinant of the 5x5 matrix on the left. As I said, I’ll skip the details but that’s actually how I calculated things to produce most of the diagrams and animations in this video. It’s all complex numbers. Weird hmm? If you are interested in the details check out the linked files in the description of this video. Now the other question is why slapping on ears preserves the sum property.:) Right, we start with things at the bottom adding to things at the top. And then after slapping on ears the same is true in the new picture we end up with. How can we prove that this always works? On close inspection this boils down to proving that if you add two similar triangles … so add coordinates vertex by vertex, red plus red, black plus black and brown plus brown, the triangle you end up with is similar to the two you started with. That’s a very cute fact in itself and I’d like to challenge you to find a proof yourself and share your proof with the rest of us in the comments:) Anyway once you know that this is true you can then jump back into this picture… and convince yourself that all the corresponding similar ears at the bottom add to the one at the top. And, on the nitty gritty side of things, calculating the new pentagon from the old one is then a matter of simple matrix multiplication. Anyway, all real quick and I don’t expect you to get all of this straightaway. I just hope you get the gist, the flavour of it all. And those of you who know a little bit more and are really keen should have no trouble fleshing things out into a full proof, first for pentagons and then for all polygons:) Also, if you DO know a little bit more maths, by now it should be clear that everything I’ve been talking about can also be nicely expressed in the language of linear algebra:) In particular, slapping on any choice of ears is a linear operator that has all of our special type pentagons as complex “eigenvectors”. And the fact that any pentagon is a linear combination of such eigenvectors then also follows straightaway from the fact that the eigenvalues of those eigenvectors are different. Another catch phrase for what we doing here is discrete Fourier transformation of planar polygons. Anyway, that’s exactly the language used in that nice
Segment 7 (30:00 - 30:00)
report by Pixar founder Alvy Ray Smith that I mentioned before. I also link to this report in the comments. If you are a coding ace looking for a challenge, Petr’s miracle is a rich source of spectacular visualisations that are waiting to be realised by someone:) If you come up with something good in this respect, please share it with the rest of us in the comments. I’ll also list some specific challenges in the description of this video. There will also be a prize for my favourite visualisation submitted by one of you. Finally, can anybody here think of some good applications for Petr’s miracle? There must be some. For example, how about we try to approximate a smooth closed curve by polygons and use Petr to turn the curve into a circle using some limiting process. Is there a good way of doing this? Anyway, good enough for today. Until next time.