[00:00] In 2019, I put out a video about how two colliding blocks can compute pi. into shorts that I've posted since then, it is the most popular This year, for Pi Day, I want to revisit this topic, [00:16] because there's actually a lot that I never talked about in the original video, and which I suspect no one in the world knew, more specifically, something known as Grover's algorithm for search. [00:33] Also, the whole crowd pleaser is that this is connected to pi, but very technically speaking, that full connection to pi is an unsolved problem. Just to recap, in case you haven't seen it, the setup of that [00:47] At the very beginning, the one on the left is stationary, and we'll think of it as smaller, maybe 1kg, and the block on the right is coming The two blocks bounce off of each other, there's a wall to their left, [01:02] and the puzzle is to figure out how many total collisions would take place, So for example, in the smallest case, where both blocks have the same mass, with each collision all of the momentum gets transferred from one block to the other, [01:17] and including that one clack against the wall, the final count is 3. If that right block is bigger, maybe 100kg, it means it has a lot more momentum when it's coming in, so it takes a lot more collisions to fully redirect that momentum. [01:31] In this case, with a mass ratio of 100 to 1, the total number of collisions is 31. that little block ends up getting really crammed up against the wall, [01:43] and almost all of the collisions happen in this rapid burst right in the middle. In this case, it takes over 300 in total to turn that big block around, [01:55] and after a nice long pause, as if the universe has a strong taste for drama, we see that the exact answer rolls in at 314, a number with eerily familiar digits. [02:07] the kind of nuances you can't fit into a short. in the middle just gets more and more concentrated. have to make a number of idealizing assumptions. [02:23] Physicists would call those perfectly elastic collisions. well hang on, shouldn't that mean we don't hear any sounds? [02:36] partly because I like it, it makes it kind of fun. purely visually just how dense that burst of collisions in the middle is. [02:50] that burst contains almost 3,000 collisions, and the final count comes in at 3,141. Now as that big mass gets even more massive, that little block would have to move [03:03] so quickly during that little burst that a physically accurate analysis should and there's just so many other practical realities that would cause everything But we're going to be ignoring all of that, we'll only be treating this as a pure, [03:20] Because when you do, the big surprise is that as that large mass grows by powers of 100, the total number of collisions always has the same digits as pi. [03:34] you can actually see it in practice for smaller ratios. This footage here for example comes from a group of students at the University of Bonne demonstrating how when the mass ratio is 100 to 1, you really do get 31 collisions. [03:51] he and I and a couple others had to do so at Cambridge. is how well poised it is to be a general problem solving lesson. [04:04] Very often when I present this as a lecture, I like to start by inviting the audience to begin by listing out a few general problem solving principles. I'll highlight a couple that I have written down here. [04:18] you're stuck on a hard problem, and I would consider this a hard problem, it never hurts to just list any equations or theorems that might somehow be relevant. [04:30] two relevant laws that might come to mind, especially if you have a recent physics class somewhere in your history, would be the conservation of energy and the The energy of one of these moving blocks would [04:46] So let's say we call the mass of the big block m1 and call its velocity v1, and likewise the mass of that little block will be m2 and its ever-changing velocity [04:59] Then the total kinetic energy between these two blocks is what you The conservation of energy essentially says this Those two velocities will change, but they have to do so in [05:14] such a way that this whole expression equals the same number. This is all of course assuming that no energy is lost to friction or to the collisions. and the momentum for each block looks even simpler, [05:28] So again, when you plug in the numbers and you compute this expression, you'll get something, and what the conservation of momentum tells us is that whatever that number is, it doesn't change even after the blocks collide with each other. [05:44] that little block collides against the wall, because really what's Technically speaking that should mean the wall starts moving a tiny amount, [05:58] fixed into the earth, and any movement that it has is negligible. When you're trying to figure something out, actually make some figures. [06:12] and sometimes staring at the right diagram can expose a solution. So in this context, where the two values that are changing are v1 and v2, where the x-coordinate encodes this value v1, and the y-coordinate encodes this value v2. [06:32] as the experiment unfolds and the blocks collide with each other, this little point inside our space is going to move around that space as those two [06:45] velocities change, always doing so in such a way that its coordinates tell you what v1 The hope is that as the whole experiment unfolds and we consider how exactly this studying the path of that point can yield insights about the underlying dynamics [07:04] Even though we're just getting warmed up, this really is the key step in our whole problem solving process, and it's a pretty common thing to do throughout physics, where if you have some dynamical situation with multiple numbers that are changing, [07:17] when you package all those numbers together as a single point in a higher dimensional space, studying how that point moves through the space has a way of clarifying the You could call this a state space, and this particular state [07:29] computing parallel that we're going to be building up to. take a moment to think about what this conservation of energy equation [07:42] When you take some number times x squared plus some number times y squared and set it equal to a constant, this is the equation for an ellipse. since that number sitting in front of x is larger than the number sitting in front of y, [07:59] and the size of the ellipse will depend on the total energy of the system. and interestingly, I never told you that velocity. Whether it comes in fast or it comes in slow, you get the same total number [08:14] As our experiment unfolds and that pair of velocities changes, it always does so in such a way that this point inside our state space stays constrained [08:26] If it landed anywhere else, it would mean energy was not conserved. fields tend to reward you when you respect their symmetries. [08:38] And in this case, we already know that pi is going to be somehow relevant to the answer, the circumference of that circle to the radius. So on our hunt for pi, it's tantalizingly close to be working with an ellipse like this, [08:53] more promising if this was instead a circle. what the coordinates of that state space represent. [09:05] The equation for a circle looks like x2 plus y2 equals some constant, without any numbers sitting in front of those variables. If I let x not represent v1, but I let it represent the square root of m1 times v1, [09:18] then x2 gives us something that looks like 2 times the kinetic energy. that y-coordinate also more directly captures the energy of the little block. [09:31] And this equation for the circle, x2 plus y2 equals some constant, now captures the conservation of energy but in this rescaled coordinate system. our problem easier to solve, and in a moment you'll see how this is true. [09:47] Let's take a minute to get a little familiar with what this diagram is really telling us. so we must be somewhere on this left half of the plane, and that little block starts off stationary, meaning the y-coordinate is zero, [10:01] and so we have to start out at the leftmost point of this circle, Now after they collide with each other, what happens? Well, physical intuition tells us that that little block picks up some kind of negative [10:15] and that big block loses some of its momentum, even if you don't know exactly how much. The circle represents all the points that have the same total energy, [10:32] and so you might guess that our point lands somewhere on this arc right here. the conservation of momentum. So in our new coordinates, the momentum of the first block looks like the square root [10:50] of m1 times x, and the momentum of the second looks like the square root of m2 times y. and those masses are just constants anyway. The significance is that this whole equation is a linear equation in x and y, [11:04] so in our diagram it's going to look like some kind of line. More specifically, you can work out it's a line whose slope is the negative square root of the big mass divided by the small mass. [11:16] it's the key quantity that we'll use to get the numerical answer that has digits we get to the quantum computing case. Where this momentum line sits left and right depends [11:32] We know that we start off on this leftmost point of the circle, Every other point on this line is telling us every other pair of velocities that would [11:45] this line intersects the circle at exactly two places, meaning there are only two pairs of velocities out there with this same kinetic energy So after the blocks bounce off of each other, we must hop over to this other point. [12:02] And honestly, that is most of the physical reasoning for this whole problem. unfolds and try to reason through what it implies. and all that does is flip the sign for the y-coordinate. [12:16] doesn't change because nothing has influenced the big block. This has caused a change in the net momentum since some of it went into the wall, so our momentum line has to move over to the right however far it [12:30] And then when the blocks bounce off each other, again we look for the other place where that diagonal line intersects the circle, Little block bounces off the wall and that moves you up, [12:44] blocks bounce against each other, that moves you down and to the right, The experiment can't be done until both blocks are moving to the right, so you have to be in this quadrant here where the x and y coordinates are both positive. [12:58] And also to be done, that little block has to be moving slower than the big block, Inside our new coordinate system, that's a line that has a a line perpendicular to those down and to the right ones we had been drawing. [13:16] meaning when our state space point lands here, the whole experiment is done. With all of that, we've translated a physics question into a pure geometry question, [13:28] Our new puzzle is this. You start at the leftmost point of that circle, with some specific slope. [13:42] And then you move straight up until you intersect the circle, and then down and to the right with that same slope, then straight up, down and to the right, over and over until you end up inside this end zone. [13:56] How many times do you zig and zag throughout this process? If you have a steeper slope, you end up with more total lines. And the one connection we have to the original physics is that [14:11] For example, when the big mass is 100 and the little mass is 1, that square root of the mass ratio looks like 10, so the slope is negative 10. [14:23] And in fact we do get 31 lines, corresponding to the 31 collisions that those blocks have. but it's certainly a lot less surprising that pi is relevant to the answer, and abstracted away from the physics, it is an easier question to solve. [14:38] If you just stare at this diagram and you're the right combination of lucky and clever, Consider all of the points where these lines hit the circle, and consider all of the arcs along the circle in between those points. [14:52] and you might hypothesize that all of these arcs are in fact exactly the same size. the ever useful and ever delightful inscribed angle theorem. [15:05] the setup is to have three points on a circle, which I'll call P1, P2, and P3, and we care about the angle between the line from P1 to P2, It turns out, no matter where you place these points, [15:22] that angle is exactly half of this angle right here, from P1 to the center to P3. It's really quite fun, you can imagine moving around these points however you want, you just have to make sure P2 never goes on that arc between P1 and P3. [15:35] In our little circle puzzle, think about how this might be relevant. and the one arc of the circle connecting their endpoints. that angle is dependent just on the slope of the line, [15:51] and using the inscribed angle theorem, we know that arc along the circle must run Critically, it didn't matter which two lines I happened to highlight here. the right is the same, since the slope was always the same, [16:09] which means all of these little arcs along the circle cover an angle of exactly 2 theta. And here's a way to think about it. As you play this game of bouncing down and to the right, going straight up, [16:23] down and to the right, with each one of your moves you can imagine dropping down one more of these arcs, one more segment of circumference covering 2 theta radians It's not too hard to show that this condition of falling into the end zone, [16:36] a region bound by this line perpendicular to all of our down and to the right lines, happens exactly when you've dropped so many arcs that if you tried to drop one more with the same length of 2 theta, you would necessarily cause some overlap. [16:50] circle as much as you can using pieces of this size. So how many arcs in total have we dropped down? That's the same as asking how many times can you add some little value 2 theta to itself [17:04] up until the point where adding one more would bust you over the total circumference of the circle, and that total circumference covers an angle of 360 degrees, or 2 pi radians. what is the biggest number you could multiply by this angle theta such that it stays [17:22] For example, imagine we were in a situation so clean and beautiful that that little angle theta worked out to be exactly 0.01 as measured in radians. [17:34] The biggest number we could multiply it by would be 314, which gives us 3.14, and if we tried to bump up the number one more, that would be 3.15, And more generally, if that little angle is some small power of 10, [17:49] I mean, this is what digits even mean. When you say pi is equal to 3.141, you can fit in 3,141 thousandths, and adding one more would bust you above pi. [18:05] At this point, maybe you're stepping back and saying, great, I see where this is going. it's going to work out that that little angle is a clean power of 10, that will explain why we see pi. [18:20] This is almost true, but that's just not quite how it works out, let's take a moment to think through the last step. looks like the negative square root of the mass ratio? [18:37] In our example where the mass ratio was 100 to 1, the slope looks like negative 10. It's the rise over run, which is the change in y divided by the change in x as you move along this line. [18:51] The tangent of that angle, opposite over adjacent, is going to look like the change in x divided by the change in y. I'm putting a little negative sign in front of that y because in this diagram, [19:05] The tangent of this angle should be a positive number. just flipping the expression and adding a negative sign. So the tangent of theta is equal to the square root of m2 divided by m1. [19:20] So with a mass ratio of 100 to 1, the tangent of the angle is 0.1. This means that the angle itself would be the arctangent of 0.1. is so pretty and beautiful as being a small power of 10. [19:35] It's instead the arctangent of a small power of 10. arctangent of a small number is almost equal to that number itself. where we're saying what's the biggest whole number that you can multiply by this [19:53] these numbers are so close that they might as well be the same. In the example shown on screen, 3141 keeps you below pi, This idea that the arctangent of a small number is the same as the number [20:11] that number itself, and this is known as a small angle approximation. more than a half hour, you must use at least one small angle approximation. [20:24] nice geometric reason why you would expect this to be true. and you consider a point an angle theta off the horizontal, [20:36] what the tangent of that angle is telling you is the y-coordinate divided by If your angle is really small, then that x-coordinate is basically the radius, it's basically just 1, and that y-coordinate is really close to the arc [20:51] length along the circle between the x-axis and the point we're looking at. And since it's a unit circle, that arc length is the angle, it is theta. this critical value theta we care about is close enough to a power [21:07] of 10 that it explains why our answer would have the same digits as pi. in the circle diagram must have the same digits as pi. And this circle diagram arose from a certain state space describing the colliding blocks. [21:23] Where at a very high level, if you want to say why did pi have anything to do with this, this simply looks like a circle in that state space. are we positive that small angle approximations are enough here? [21:41] a little off by one error because of the deviation here? And for any calculus students among you, the more rigorous way to do this analysis would where you can see that the error between the tangent of theta and theta itself is on the [21:58] So for example, if theta was a number like 1 one hundredth, 1 one hundredth itself, the error term is on the order of 1 one millionth. that error doesn't really accumulate very much. [22:14] But it is possible for the final answer to our question to be an integer whose digits aren't quite the same as pi but off by one if the following was true. If at any point when you're looking at all the digits of pi and you [22:26] next n digits are all nines, then you get this off by one error. Considering how many we know, and therefore how many nines you'd have to see in a row, [22:41] However, rigorously proving that this is true of the digits of pi is beyond the scope of what the current tools of math can prove. So very technically speaking, this fact that colliding blocks with a mass [22:56] ratio that's a power of 100 can compute pi for you is an unsolved problem. something you and I now understand very well. And if you like to pause and ponder, you might enjoy taking a moment [23:11] to think about how there's nothing special about powers of 100. then mass ratios with a power of 4 would count up to something that has the same bits as pi written in binary. [23:25] without highlighting why this puzzle is worth studying at all. about putting this block collision process into practice, [23:37] and suffice to say, you run into practical issues very quickly in the attempt. we just did over-idealized to the point of pointlessness? And there's two justifications I could give you for stripping away the messiness of the [23:51] thought-provoking. it's often helpful to start with the simplest possible variant, and then once your teeth are sunk into that, you often have a first approximation [24:04] of reality, and very often when you want to account for the added details and messiness of the real world, the way that works is to start with the simplistic Here for example, if you want to take into account the energy loss in each collision, [24:19] that might look like having the circle shrink with each one of those clacks. of the real world is that purity can expose hidden connections. [24:31] but the original paper that described this phenomenon by Gregory Galperin presented it in the context of yet another connection, a beautiful analogy between these colliding blocks and the way that a beam of light would bounce between two mirrors [24:46] If you want the details, another one of the videos If you liked this, you will almost certainly enjoy that video. how this whole solution is secretly mirrored inside an algorithm within quantum [25:02] which is why I'm pulling that out into a separate video that we'll do next, When pure mathematicians pull out the messiness of reality from their problems, [25:15] I mean it's a little bit laziness, but it's not just that, It's because distilling a problem into its core essence can expose hidden connections, and it's through those connections that mathematicians make progress. [25:31] A hard problem in one context, where it might seem deeply confusing, sometimes can look clearer in another setting, but the analogy may not be obvious, [25:50] and a lot of the progress of math through history has looked like developing a richer and richer web of hidden connections.