How colliding blocks act like a beam of light...to compute pi.
3Blue1BrownYou 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.向かい合った2枚の鏡があるときに感じる、あの感覚を知っていますか。無限に続く部屋のトンネルがあるような錯覚を起こします。
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.多くの人が気づいていないかもしれないのは、こうした錯覚の背後にある考え方が、数学の本格的な問題を解くのに驚くほど役立つということです。
We've already seen two videos describing the block collision puzzle with its wonderfully surprising answer.ブロック衝突パズルについて、その驚くほど意外な答えを説明する動画をすでに2本見てきました。
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,具体的には、2次元平面のx座標を、壁から最初のブロックの左端までの距離とし、これを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.そしてy座標を、壁から2番目のブロックの右端までの距離とし、これを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.このように、直線 y = x は2つのブロックがぶつかり合う場所を示しています。なぜならこれは d1 が 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,2つのブロックの距離が変化するにつれて、配位空間の2次元の点が動き回り、
with positions that always fully encode the information of those two distances.その位置は常にその2つの距離の情報を完全に表しています。
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.下の方を見ると、d2 が小さいブロックの幅と同じになる直線で区切られていることに気づくかもしれませんが、考えてみれば、これこそ小さいブロックが壁にぶつかることを意味します。
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.この点が2本の境界線の間を跳ね返る様子は、2枚の鏡の間を跳ね返る光線に少し似ています。
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 of a 45 degree angled mirror, this x equals y line, in such a way that it ends up going straight down,右から来た光線は、45度の角度の鏡、この x = y の直線で反射して、真っ直ぐ下向きになるような形で跳ね返り、
which would mean that only the second block is moving.それは2番目のブロックだけが動いていることを意味します。
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.これは、2番目のブロックが1番目と同じ質量を持ち、クロッケーのボールのようにその運動量をすべて受け取るという最も単純な場合には実際に起こります。
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 into the left a bit.少し左寄りの下向きになるでしょう。
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,実際、そのときにまさに行ったことに動機づけられて、x が d1 に等しくなるのではなく、
but is equal to the square root of the first mass m1 times d1.最初の質量 m1 の平方根に 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.これは空間を水平方向に引き伸ばす効果があり、大きなブロックの位置の変化が、x座標自体のより大きな変化につながります。
And likewise, let's write the y coordinate as square root of m2 times d2.同様に、y座標をm2の平方根かけるd2として書きましょう。
Even though in this particular case the second mass is one, so it doesn't make a difference, but let's keep things symmetric.この特定の場合、2つ目の質量は1なので違いは生じませんが、対称性を保つためにそうしておきましょう。
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 of 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.その2次元分の可能な方向が、ブロックの両方の速度を符号化しているのです。
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.この小さなベクトルのx成分はxの変化率であり、同様に、そのy成分はyの変化率です。
But what is that rate of change for the x coordinate?しかし、x座標に対するその変化率とは何でしょうか?
Well, x is the square root of m1 times d1, and the mass doesn't change, so it depends only on how d1 changes.さて、xはm1の平方根かけるd1であり、質量は変わらないので、それはd1がどのように変化するかにのみ依存します。
And what's the rate at which d1 changes?そして、d1が変化する割合は何でしょうか?
Well, that's the velocity of the big block.さて、それは大きなブロックの速度です。
Let's go ahead and call that v1.それをv1と呼ぶことにしましょう。
Likewise, the rate of change for y is going to be the square root of m2 times v2.同様に、y の変化率は m2 の平方根に 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.つまり m1 かける v1 の二乗に m2 かける v2 の二乗を加えたものの平方根です。
This inner expression should look awfully familiar.この内側の式はとても見覚えがあるはずです。
It's exactly twice the kinetic energy of our system.それはまさに私たちの系の運動エネルギーの2倍です。
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.なぜこれが重要かは一見明らかではないかもしれませんが、とりわけ次のステップにとって重要です。そこでは運動量保存則により、これら2本の境界線が鏡のように振る舞うことが示されます。
First, let's understand this line d1 equals d2 a little bit better.まず、この d1 イコール d2 という直線をもう少しよく理解しましょう。
In our new coordinates, it's no longer that nice 45 degree x equals y line.私たちの新しい座標では、それはもはやあのきれいな45度の x イコール y の直線ではありません。
Instead, if we do a little algebraic manipulation here, we can see that that line is x over square root m1 equals y over square root m2.代わりに、ここで少し代数的な操作をすると、その直線は x 割るルート m1 イコール y 割るルート m2 であることが分かります。
Rearranging a little bit more, we see that's a line with a slope of square root m2 over m1.もう少し整理すると、それは傾きがルート m2 割る 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それによれば、m1 かける v1 たす m2 かける v2 という値は
is the same both before and after the collision.衝突の前後で同じであるということです。
Now notice, this looks like a dot product between two column vectors m1 m2 and v1 v2.さて注目してください、これは2つの列ベクトル m1 m2 と v1 v2 の間の内積のように見えます。
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.x と 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.2番目のベクトルは、私たちが見てきた図の中の点の変化率ベクトルにすぎないことに注目してください。
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.なぜなら、傾きが√m2割る√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 the length of the projection of the second one onto that first,2つのベクトルの内積は、1つ目の長さに、2つ目のベクトルの1つ目への射影の長さを掛けたものに等しく、
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.これはよく、2つのベクトルの長さの積と、それらの間の角度の余弦の積として書かれるのを見かけます。
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.同様に、小さなブロックが壁で跳ね返るときは、y座標だけが変わるので、私たちの小さなベクトルはx方向について反射されます。
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,これが続くと、光のビームにとっての錯覚は、2枚の角度のついた鏡の間で何度も跳ね返るのではなく、
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 clear review, 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.私たちはまず、衝突するブロックのための配置空間を描くことから始めました。そこではx座標とy座標が壁からの2つの距離を表していました。
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.これは2枚の鏡の間で光が跳ね返るように見えましたが、この例えを正しく機能させるために、座標を質量の平方根でスケーリングし直す必要がありました。
This made it so that the slope of one of our lines was square root of m2 divided by square root of m1,これにより、私たちの直線の1つの傾きが、m2の平方根を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,このような2枚の鏡の間で何回バウンスが起こるかを調べるために、
think of the illusion of the beam going straight through a sequence of looking glass universes separated by a semicircular 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.答えは結局、この角度の値が180度、すなわちパイラジアンの中に何回収まるかということになります。
From here, to understand why exactly the digits of pi show up when the mass ratio is a power of 100, it's exactly what we did in the last video, so I won't repeat myself here.ここから先、質量比が100の累乗のときに、なぜちょうどパイの数字が現れるのかを理解するには、前回の動画でやったことと全く同じなので、ここでは繰り返しません。
And finally, as we reflect now on how absurd the initial appearance of pi seemed, and on the two solutions we've now seen,そして最後に、最初にパイが現れたことがいかに不合理に見えたか、そして私たちが今見てきた2つの解法について振り返ってみると、
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 eighty IQ points.視点の変化はIQ80ポイントに値する。