To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/AnotherRoof/ . The first 200 of you will get 20% off Brilliant’s annual premium subscription.
That fact that you can remove some many of the variables in the beggining transforming the problem and that the solution is basiclly diophantine Equations is just so beautiful
I'm so impressed with how this channel has grown since its first SoME video a year or two back. This stuff is seriously higher quality than a lot of very popular math channels, and with deeper and more interesting theory. Thank you for all this!
Great video! Loved the live action visuals. Your explanation of the Euclidean algorithm avoided a lot of the leaps of faith I made in mine. And simplifying to a lattice is a brilliant way to make the numbers easier. I think your assumption that the logo always hits a wall perfectly doesn't lose any generality, because even if a logo 'crosses' the wall a bit, it will still bounce back on the next frame, making the setup equivalent to a lattice one tile longer. You can confirm this a bit with the simulation I made for my video (which I believe I can't link without my comment being auto-removed by RU-vid). If you use the default settings but set the X speed to 7 so that crossing a wall is more obvious, you can see that a screen width of anywhere between 395 and 401 leads to the exact same path!
Ahh yes, you're absolutely right! I did all my working out before watching yours, and when you did it as "a bounce is on the first frame when it hits the edge or *passes* the edge" I was jealous that you didn't have to make that assumption! And I think you're right that no generality is lost. Link is in the description to this video for those who want to watch, it's great!
When I was a little nerdling (3rd form, if I recall correctly), it was in the days before VCR's, to say nothing of DVD's. But I wondered about this exact problem, thinking in terms of a billiard table with m diamonds on one edge and n on another. Bless my mathematics teacher! She showed me the argument involving modular arithmetic, and taught me the _extended_ Euclidean algorithm. I think I managed then to prove most of the results in your video. I'd credit Mrs Smith for the fact that I'm a (semi-retired, applied) mathematician today.
What I find so interesting about this video is the way you use mathematics to tackle this issue. I expected that someone had dumped the firmware code of an old DVD player (I bet you could probably find an old Apex brand DVD player firmware somewhere online, the Apex players were very interesting products that would play basically anything you put on a disc no matter what format it was in, ignoring region locks and other things they were 'supposed to' not do) and you'd be going through their actual algorithm. That's just how I'd tackle it as a software person.
@@bingxiling9154also because CRT’s have better effective resolution than flat screen displays, so while the jump from VHS to DVD was a bigger jump in quality, the jump from CRT to LCD undid a great deal of that image quality improvement. If you had a top line HD CRT TV, you would have seen a massive improvement when going to DVD from VHS.
Thanks for this. I've always mentally did this with any kind of rectangular grid (e.g. ceiling tiles), (Hi, ADHD!) but I never thought about starting in an arbitrary place, but always at a corner. I knew it always had to end in a corner, but never knew how to predict which of the other three it would be. Now I do!
Before there were DVDs, there was a similar problem. In cheap versions of breakout (balls bouncing against walls) on early home computers (e.g. ZX81/spectrum) the ball moved by an integer number of pixels left/right and an integer up/down. In these versions the ball bounced off the bat with the same angle of reflection as incidence. This meant that sometimes it was not possible to clear a board as there were some bricks that could never be hit with certain ball angles. Oh the problems of youth!
I'm not sure which cheap versions of breakout you are referring to? But in this ZX81 version you could in fact control the angle of reflection by controlling the exact location the ball hit the bat as you can see in this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ZOH4qAqhXvo.html Which I believe was fairly standard behaviour for such games
I always thought that the DVD screensaver would always hit the corner eventually because of what they were designed to do The purpose of a screensaver is that, to save the screen. The animations that play prevent a static image being shown on a display, by constantly refreshes all of the pixels, thus preventing or delaying burn in, where static images that are displayed for long enough would still be seen when that image wasn't displayed. This was a problem on older TVs, and has come back with OLEDs. Some OLED TVs have features that will shift the image by a few pixels every so often to prevent burn in. So for the DVD screensaver to do this job, it should cover the entire screen, which it would require it to hit the top corner pixels. However, I might be wrong on that, and the DVD one specifically, or depending on the implementation may not always hit the corner. Or the animation would start in the same place and direction, so it would always hit, whereas the video wonders about some arbitrary 'DVD like' screensaver. I am also only 10 minutes in when writing this, so if it is addressed later, my bad
The timing of this video is fantastic considering ive just finished a module on elementary number theory in one of my math courses in university, so this is both a lovely way to see it applied, and a nice refresher of the more fundamental ideas. I really love your method of explaining stuff, and it usually complements the more "university" like explanations I usually have, while still being rigorous and in depth enough to not just be a cursory look into the topic that is more common on RU-vid
I've been wondering how to go about solving and lo and behold, this video was recommended to me! What's awesome is that I technically already knew about Bezout's Identity, I just never know how to apply it until now! This video was awesome!! 💯
AH! My Brain! You're talking about graphics with 0,0 at the bottom left. A bunch of time writing software the does graphics makes me think in terms of 0,0 at the upper left with positive y going down any time pixels are in play.
Sorry about that -- you won't believe how many times I changed my mind about this! You can see later in the video my spreadsheet has the coordinates running downwards. In the end, I decided that more people were familiar with the Cartesian Plane and how coordinates work there but I spent a long time deciding! Hope it isn't too distracting and enjoy the video!
I love this, applying ultra maths to some minor trivial nostalgia, to reveal beautiful patterns or simplicity. I wonder if the designers of the screensaver had any idea of this maths - it does seem that x and y were set peculiarly to create a long period.
Just had to pause at 28:16 and point out I don't think I have seen anyone motivate the "discovery" of the Euclidean algorithm (with proof to boot) quite so well. And never once mentioning the scary word "algorithm". Thanks for showing another way to teach this algorithm!
I'm just starting the video, but it is awesome to see that I am not the only crazy person (lol) that wondered about all the variables that influenced the corner alignment of the logo, and if there was an infinite number of guaranteed corner bounces
12:32 The simplest solution with integer k_1, k_2 for this equation is k_1 = 6, k_2 = 1. 12*6 - 51*1 = 72 - 51 = 21. P.S: General solution is k_1 = 17n - 11, k_2 = 4n - 3, where n is a integer.
Sir, what a way to explain. Respect for that and very interesting topics. I also respect the fact that you did most of it manually, even though most people uses manim. Thank you
The reason infinitely many solutions exist to the Diophantine equation: if we are trying to find a and b such that ax+by=c. then we can do the process in the video to get one working solution, then we take the homogenous case. if ax+by=0, then solving is trivial, ax=-by, so find you could use the lcm of x and y, but an example solution (although there are many) could be a=y and b=-x. once you have this solution, notice that you can add it to your original problem without changing anything. if a1 and b1 solve the homogeneous case, then adding any integer multiple of them to the original shouldn't have an effect on the final value, if ax+by=c then ax+by+a1x+b1y=c+0. and simplifying gives (a+a1)x+(b+b1)y=c which is another solution. you can repeat this process by adding in the homogenous case again yeilding another new solution. do this infinitely many times to yeild infinite possible solutions.
10:26 Here's another way to explain this: When on an edge, the logo is bouncing rather than traveling in a direction. In other words, the logo only visits the edge once, but it visits other nodes twice. So, the points not on the edge are doubled. But there are two edges, so that halves the period. (Note that corners are intersections of edges.) So, it's (1+2(n-2)+1)/2 = n-1
gonna add a bit of an extra difficulty to the problem.. assume the anchor point is always at the corner of the DVD logo and not the center. if the logo is at the top left quarter of the screen it is anchored at the top left of the DVD logo and so forth. this means that the size of the logo greatly affects the point on which it bounces off the edge of the screen.
Off the cuff thoughts, method of treatment is like a specific case of fixed step finite difference with specific (periodic) boundary conditions (and initial conditions) for the motion of a rectangular projectile with perfectly elastic collisions. It is essentially a potentially nonergodic system in general. For certain initial conditions and screen aspect ratios you can have highly localized trajectories. If the ratio of the horizontal and vertical speeds have a rational relationship to the aspect ratio I would expect only a local part of the screen to be covered.
This is a nonergodic system in general. And if you want it to repeat exactly in a finite time you want nonergodicity and the right initial condition! This is like saying the Poincare recurrence time is finite! Which requires the resonance between the x and y degrees of freedom you discovered. Occurs in many nonlinear dynamical systems in mathematics, chemistry and physics. Dynamic billiards are well studied: en.wikipedia.org/wiki/Dynamical_billiards (And using the finite difference approach: en.wikipedia.org/wiki/Arithmetic_billiards), blogs.ams.org/visualinsight/2016/11/15/bunimovich-stadium/.
Just started watching, guessing the first step is gonna be to look at the representation where the logo never bounces, it just passes through the screen into a reflected version of itself, and we make a big grid of these reflections.
I wonder if there's a simpler way to solve this using the "infinite trees" problem. If you point a laser through a grid of trees from the origin, you're guaranteed to come arbitrarily close to one of the trees, since any angle can be approximated more and more precise fractions. Then maybe you could make alterations in the proof of that to adjust for the starting position on either the x or y intercept. There's probably some technical reason why these aren't similar problems, but the solution to the tree problem would give insight into the solution of this one, provided we allow a tiny bit of imprecision, maybe the caveat being the measly accuracy of human eyes allowing near-corner-hits with some level of allowed variance.
I think you're right! I briefly looked into this while planning my video, but decided against bringing it up as I didn't like the idea of introducing yet another problem, especially when I try to make the videos for a broadish audience. Thanks for watching!
@6:41 “Mathematicians have a name for this type of structure, by the way; a lattice.” Well, lattice theorists don’t restrict themselves to integer points in the plane or even in any other Euclidean space, so you’re not accessing best terminology. This kind of lattice is better referred to as a Gaussian integer lattice because it’s in a plane, and so the elements of the lattice can be viewed as Gaussian integers (complex numbers with integer real and imaginary parts). In fact, you’re locating your grid so that it’ corner is the zero element of the complex plane, and so it’s better described as a finite initial segment of ‘positive’ cone of the Gaussian integers, and the more general notion is that it’s the ‘positive’ cone of a lattice-ordered group. If you analyze the approach, I expect there are some interesting related results in the theory of lattice-ordered groups with similar arguments, and so that this result you demonstrate will be a special case of such results. Your argument uses periodic extensions that are still contained in the ‘positive’ cone of the Gaussian integers, so that’s where I’d think someone should look if they want to learn the deeper results. …
Having done the mathematics of Countdown, another good math game deep dive could be the 24 Game, where you have 4 numbers and have to reach 24 via the basic 4 operators. It's a classic for kids, so I'd love to see the a big dive into the maths of it all.
I actually coded a clock that bounced like the dvd logo using JS, though due to a bug, I accidently made it hit only the bottom corners and the top center.
My answers at the start is it’s not necessarily going to hit the corner. It will either hit the corner or be a repeating circuit of some sort. Though in practicality I imagine it’s basically always gonna be in corner mode.
I did a school math project on this a few months ago My project was a totally different scope but it was interesting to see how closely our ideas aligned Great video
In certain areas of wireless network research it is common to put devices into a square and let them move about it. One often used model is the "random waypoint model" but this is not a good model as shown in the paper "random waypoint considered harmful". A better model starts at a random point, moving at a random direction at a fixed speed, perfectly reflecting at each wall. Like the subject of the video - assuming a point object. It's easy to show this gives a random distribution in the x coordinate, and a random distribution in the y coordinate. But does it produce a uniform distribution across the square? Clearly not always - if you start on a long diagonal aiming at a corner on that diagonal then you will never leave that diagonal. And some other special cases can be constructed. But does it produce a uniform distribution across the square almost always? If so, or if not, is this a published result? Is this therefore a good model, or should it also be considered harmful?
quick question, do solutions exist for x*k1 + y*k2 = any common divisor of (x,y)? You gave a reason that went like: if gcd(x,y) = d, then we can write the Diophantine equation x*k1 + y*k2 = m as d(x/d * k1 + y/d * k2) = m and so if m isn't a multiple of d then no solutions exist. Can we just use the same argument for any common divisor of x,y? Thus if m is a multiple of any common divisor of x,y then a solution to x*k1 + y*k2 = m exists?
8:16 Another way to solve the bouncing problem is by flipping the position instead of the direction. In this case, you should flip the position around the center of the board. Equivalently, you can flip the board
Playing with an oled screen and Arduino I ended coding something like this, but I didn’t move it more pixels, just increased the refresh speed, when reached certain position it reverses one axis .
In graphics programming the vertical axis almost always increases as you go downwards, rather than upwards like the math convention. This is probably because the horizontal lines of CRT displays are drawn one at a time starting from the top, so the top line is line 0. So what I'm saying is the DVD Logo thinks your graph is upside down
Hello, thanks for watching! I've responded to a previous comment about this but yeah, I went back and forth on which direction to label the y-axis. Initially I had it the graphical direction but eventually settled on the mathematical convention as I thought that was more intuitive for more viewers. Luckily it doesn't matter, but it made some parts tricky as all my early notes had it the other way around!
In a real sense, there's only 1 direction. If the path starts in the negative direction, just flip the whole starting point in X (both position and vector).
I understand that you just went and had fun with this. But the problem isn't nearly as complicated since screens aren't arbitrarily shaped and sized. I actually thought you where going to go towards how they would have guaranteed that the logo covers as much surface as possible. Because as a screensaver in the era of CRT it's main purpose is a burnin countermeasure. And you eventually did show the coprime behaviour near the end really quickly.
I wonder if any DVD firmware programmer SOMEHOW had too much time on their hand and implemented "subpixels" or letting the DVD logo move in "fractional numbers". That would have thrown EVERY researcher of this phenomenon for a loop.
The euclidean algorithm explanation was a bit cumbursome and backwards. Usually people start by saying that using the algorithm, you can find the gcd(a,b), and only then people explain, that in the process we get a solution for an equation. I had to explain all the little facts about polynomials today, and it stood out to me, that number theory and polynomials are awfully similar. Then I remembered about the Rieman hypothesis and it all made sense
15:12 That definition works for natural numbers. However, there's no largest common divisor of 0 and 0 by the usual comparison. There is if we compare by divisibility or in my way. (The latter is like comparing by absolute value except 0 is larger than all other numbers.) These methods of comparison aren't exactly orderings of integer. In them, n and -n are considered the same. So, you'd need to define it as the nonnegative one (or in another similar way)
Would you consider not having background music to make it easier for us with poor hearing? There may be a motivation for having background sound and i would curiosity hear it.
I think the DVD player by "OK" we have actually prevents the logo from ever actually hitting the corner, the closest it ever got was a few centimetres from the corner, with the two bounces within a quarter second from one another.