How colliding blocks act like a beam of light...to compute pi.
14:40

How colliding blocks act like a beam of light...to compute pi.

3Blue1Brown 03.02.2019 1 373 959 просмотров 43 812 лайков

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI
Описание видео
The third and final part of the block collision sequence. Help fund future projects: https://www.patreon.com/3blue1brown An equally valuable form of support is to simply share some of the videos. Special thanks to these supporters: http://3b1b.co/clacks-thanks Home page: https://www.3blue1brown.com Error correction: I wrote the answer as floor(pi/theta), when really it should be ceiling(pi/theta) - 1 t account for values of theta perfectly dividing pi. For example, the case of equal masses gives an angle of pi/4, and 3 total clacks. This beautiful result, and the solution shown here, are due to Gregory Galperin: https://www.maths.tcd.ie/~lebed/Galperin.%20Playing%20pool%20with%20pi.pdf And here's a lovely interactive built by GitHub user prajwalsouza after watching this video: https://prajwalsouza.github.io/Experiments/Colliding-Blocks.html Speaking of looking glass universes... https://www.youtube.com/user/LookingGlassUniverse NY Times blog post about this problem: https://wordplay.blogs.nytimes.com/2014/03/10/pi/ The plushie pi shown at the video's start: https://www.3blue1brown.com/store If you want to contribute translated subtitles or to help review those that have already been made by others and need approval, you can click the gear icon in the video and go to subtitles/cc, then "add subtitles/cc". I really appreciate those who do this, as it helps make the lessons accessible to more people. Music by Vincent Rubinetti. Download the music on Bandcamp: https://vincerubinetti.bandcamp.com/album/the-music-of-3blue1brown Stream the music on Spotify: https://open.spotify.com/album/1dVyjwS8FBqXhRunaG5W5u Thanks to these viewers for their contributions to translations Hebrew: Omer Tuchfeld ------------------ 3blue1brown is a channel about animating math, in all senses of the word animate. And you know the drill with YouTube, if you want to stay posted on new videos, subscribe: http://3b1b.co/subscribe Various social media stuffs: Website: https://www.3blue1brown.com Twitter: https://twitter.com/3blue1brown Reddit: https://www.reddit.com/r/3blue1brown Instagram: https://www.instagram.com/3blue1brown_animations/ Patreon: https://patreon.com/3blue1brown Facebook: https://www.facebook.com/3blue1brown

Оглавление (3 сегментов)

Intro

You know that feeling you get when you have two mirrors facing each other, and it gives the illusion of there being an infinite tunnel of rooms. Or, if they're at an angle with each other, it makes you feel like you're a part of a strange kaleidoscopic world with many copies of yourself, all separated by angled pieces of glass. What many people may not realize is that the idea underlying these illusions can be surprisingly helpful for solving serious problems in math.

Explanation

We've already seen two videos describing the block-collision puzzle, with its wonderfully surprising answer. Big block comes in from the right, lots of clacks, the total number of clacks looks like pi, and we want to know why. Here, we see one more perspective explaining what's going on, where if the connection to pi wasn't surprising enough, we add one more unexpected connection to optics. But we're doing more than just answering the same question twice. This alternate solution gives a much richer understanding of the whole setup, and it makes it easier to answer other questions. And fun side note, it happens to be core to how I coded the accurate simulations of these blocks without requiring absurdly small time steps and huge computation time. The solution from the last video involved a coordinate plane, where each point encodes a pair of velocities. Here, we'll do something similar, but the points of our plane are going to encode the pair of positions of both blocks. Again, the idea is that by representing the state of a changing system with individual points in some space, problems in dynamics turn into problems in geometry, which hopefully are more solvable. Specifically, let the x-coordinate of a 2D plane represent the distance from the wall to the left edge of the first block, what I'll call d1, and let the y-coordinate represent the distance from the wall to the right edge of the second block, what we'll call d2. That way, the line y equals x shows us where the two blocks clack into each other, since this happens whenever d1 is equal to d2. Here's what it looks like for our scenario to play out. As the two distances of our blocks change, the two dimensional points of our configuration space move around, with positions that always fully encode the information of those two distances. You may notice that at the bottom there, it's bounded by a line, where d2 is the same as the small block's width, which, if you think about it, is what it means for the small block to hit the wall. You may be able to guess where we're going with this. The way this point bounces between the two bounding lines is a bit like a beam of light bouncing between two mirrors. The analogy doesn't quite work, though. In the lingo of optics, the angle of incidence doesn't equal the angle of reflection. Just think of the first collision. A beam of light coming in from the right would bounce off a 45 degree angled mirror, this x equals y line, in such a way that it ends up going straight down, which would mean that only the second block is moving. This does happen in the simplest case, where the second block has the same mass as the first, and picks up all of its momentum like a croquet ball. But in the general case, for other mass ratios, that first block keeps much of its momentum, so the trajectory of our point in this configuration space won't be pointed straight down, it'll be down and to the left a bit.

Math

And even if it's not immediately clear why this analogy with light would actually be helpful, and trust me, it will be helpful in many ways, run with me here and see if we can fix this for the general case. Seeking analogies in math is very often a good idea. As with the last video, it's helpful to rescale the coordinates. In fact, motivated by precisely what we did then, you might think to rescale the coordinates so that x is not equal to d1, but is equal to the square root of the first mass, m1, times d1. This has the effect of stretching our space horizontally, so changes in our big block's position now result in larger changes to the x-coordinate itself. And likewise, let's write the y-coordinate as square root of m2 times d2, even though in this particular case the second mass is 1, so it doesn't make a difference, but let's keep things symmetric. Maybe this strikes you as making things uglier, and kind of a random thing to do, but as with last time, when we include square roots of masses like this, everything plays more nicely with the laws of conserving energy and momentum. Specifically, the conservation of energy will translate into the fact that our little point in the space is always moving at the same speed, which in our analogy you might think of meaning there's a constant speed of light, and the conservation of momentum will translate to the fact that as our point bounces off the mirrors of our setup, so to speak, the angle of incidence equals the angle of reflection. Doesn't that seem bizarre in kind of a delightful way, that the laws of kinematics should translate to laws of optics like this? To see why it's true, let's roll up our sleeves and work out the actual math. Focus on the velocity vector of our point in the diagram. It shows which direction it's moving and how quickly. Now keep in mind, this is not a physical velocity, like the velocities of the moving blocks. Instead, it's a more abstract rate of change in the context of this configuration space, whose two dimensions worth of possible directions encode both velocities of the block. The x component of this little vector is the rate of change of x, and likewise its y component is the rate of change of y. What is the rate of change for the x-coordinate? x is the square root of m1 times d1, and the mass doesn't change, so it depends only on how d1 changes. What's the rate at which d1 changes? Well, that's the velocity of the big block. Let's call that v1. Likewise, the rate of change for y is going to be the square root of m2 times v2. Now, notice what the magnitude of our little configuration space changing vector is. Using the Pythagorean theorem, it's the square root of the sum of each of these component rates of change squared, which is square root of m1 times v1 squared plus m2 times v2 squared. This inner expression should look awfully familiar, it's exactly twice the kinetic energy of our system. So the speed of our point in the configuration space is some function of the total energy, and that stays constant throughout the whole process. Remember, a core over-idealizing assumption to this is that there's no energy lost to friction or to any of the collisions. All right, so that's pretty cool. With these rescaled coordinates, our little point is always moving with a constant speed. And I know it's not obvious why you would care, but among other things, it's important for the next step, where the conservation of momentum implies that these two bounding lines act like mirrors. First, let's understand this line d1 equals d2 a little bit better. In our new coordinates, it's no longer that nice 45 degree x equals y line. Instead, if we do a little algebraic manipulation here, we can see that line is x over square root m1 equals y over square root m2. Rearranging a little bit more, we see that's a line with a slope of square root m2 over m1. That's a nice expression to tuck away in the back of your mind. After the blocks collide, meaning our point hits this line, the way to figure out how they move is to use the conservation of momentum, which says that the value m1 times v1 plus m2 times v2 is the same both before and after the collision. Now notice, this looks like a dot product between two column vectors, m1m2 and v1v2. Rewriting it slightly for our rescaled coordinates, the same thing could be written as a dot product between a column vector with the square roots of the masses, and one with the rates of change for x and y. I know this probably seems like a complicated way to talk about a comparatively simple momentum equation, but there is a good reason for shifting the language to one of dot products in our new coordinates. Notice that second vector is simply the rate of change vector for the point in our diagram that we've been looking at. The key now is that this square root of the masses vector points in the same direction as our collision line, since the rise over run is square root m2 over square root of m1. Now if you're unfamiliar with the dot product, there is another video on this channel describing it, but real quick let's go over what it means geometrically. The dot product of two vectors equals the length of the first one multiplied by projection of the second one onto that first, where it's considered negative if they point in opposite directions. You often see this written as the product of the lengths of the two vectors, and the cosine of the angle between them. So look back at this conservation of momentum expression, telling us that the dot product between this square root of the masses vector and our little change vector has to be the same, both before and after the collision. Since we just saw that this change vector has a constant magnitude, the only way for this dot product to stay the same is if the angle that it makes with the collision line stays the same. In other words, again using the lingo of optics, the angle of incidence and the angle of reflection off this collision line must be equal. Similarly, when the small block bounces off the wall, our little vector gets reflected about the x direction, since only its y coordinate changes. So our configuration point is bouncing off that horizontal line as if it was a mirror. So step back a moment and think about what this means for our original question of counting block collisions and trying to understand why on earth pi would show up. We can translate it to a completely different question. If you shine a beam of light at a pair of mirrors, meeting each other at some angle, let's say theta, how many times would that light bounce off of the mirrors as a function of that angle? Remember, the mass ratio of our blocks completely determines this angle theta in the analogy. Now I can hear some of you complaining, haven't we just replaced one tricky setup with another? This might make for a cute analogy, but how is it progress? It's true that counting the number of light bounces is hard, but now we have a helpful trick. When the beam of light hits the mirror, instead of thinking of that beam as reflected about the mirror, think of the beam as going straight, while the whole world gets flipped through the mirror. It's as if the beam is passing through a piece of glass into an illusory looking glass universe. Think of actual mirrors here. This wire on the left will represent a laser beam coming into the mirror, and the one on the right will represent its reflection. The illusion is that the beam goes straight through the mirror, as if passing through a window separating us from another room. But notice, crucially, for this illusion to work, the angle of incidence has to equal the angle of reflection. Otherwise, the flipped copy of the reflected beam won't line up with the first part. So all of that work we did, rescaling coordinates and futzing through the momentum equations, was certainly necessary. But now we get to enjoy the fruits of our labor. Watch how this helps us elegantly solve the question of how many mirror bounces there will be, which is also the question of how many block collisions there will be. Every time the beam hits a mirror, don't think of the beam as getting reflected, let it continue straight while the world gets reflected. As this goes on, the illusion to the beam of light is that instead of getting bounced around between two angled mirrors many times, it's passing through a sequence of angled pieces of glass all the same angle apart. Right now I'm showing you all of the reflected copies of the bouncing trajectory, which I think has a very striking beauty to it. But for a clearer view, let's just focus on the original bouncing beam and the illusory straight one. The question of counting bounces turns into a question of how many pieces of glass this illusory beam crosses. How many reflected copies of the world does it pass into? Well, calling the angle between the mirrors theta, the answer here is however many times you can add theta to itself before you get more than halfway around a circle, which is to say before you add up to more than pi total radians. Written as a formula, the answer to this question is the floor of pi divided by theta. So let's review. We started by drawing a configuration space for our colliding blocks where the x and the y coordinates represented the two distances from the wall. This kind of looked like light bouncing between two mirrors, but to make the analogy work properly we needed to rescale the coordinates by the square roots of the masses. This made it so that the slope of one of our lines was square root of m2 divided by square root of m1, so the angle between those bounding lines will be the inverse tangent of that slope. To figure out how many bounces there are between two mirrors like this, think of the illusion of the beam going straight through a sequence of looking glass universes separated by a semi-circular fan of windows. The answer then comes down to how many times the value of this angle fits into 180 degrees, which is pi radians. From here, to understand why exactly the digits of pi show up when the mass ratio is a power of 100, is exactly what we did in the last video, so I won't repeat myself here. And finally, as we reflect now on how absurd the initial appearance of pi seemed, and on the two solutions we've now seen, and on how unexpectedly helpful it can be to represent the state of your system with points in some space, I leave you with this quote from the computer scientist Alan Kay, A change in perspective is worth 80 IQ points.

Другие видео автора — 3Blue1Brown

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник