| There are a lot of very cool math properties hidden in each of these examples so I want to start a discussion on modeling some of them: For the "memory" example, each particle is moving Uniform(-k, k) at each timestep (where k is some just some fixed distance). So the the distribution of the position of a particle at timestep t is the sum of t identically independent distributions, which will converge to a normal distribution, specifically with Uniform(a, b) having variance (b - a)^2 / 12, you converge to: N(0, t * k^2 / 3) So it turns out these particles end up behaving kind of like brownian motion! (Note I didn't take into account hitting walls. I am not sure how to model that?) For the "velocity" example, empirically you can see that if you just let it run forever the points will just end up bunching at the walls. This makes sense since if there's a positive velocity in either direction it's hard to flip your velocity back into the other direction to get off the wall. By symmetry you expect half to be bunched on one wall and half on the other. A fun question to ask then is if the velocities will accumulate so much in one direction such that it will always stay stuck on one wall after you run it a long enough time. I believe the answer is no! It will always switch directions again due to the fact that the probability that a random walk on a line returning to the origin has probability 1 as you run it forever (google recurrent random walk in 1 or 2 dimensions). This means the velocity (which is doing the random walk) will have to cross 0 and flip signs at some point. So although you will mostly find these particles hugging the walls, they will keep switching sides forever! I think there are a lot of other really cool properties in these fancy visualizations waiting to be discovered. |