A repository for multiple particles colliding random walks, where 1s and 0s are the same. It simulates the diffusion of binary particles as a stochastic process.
Animated is a 110x110 system with particles and antiparticles mixing over 200 time steps. The code generalizes random walks to any number of particles in any number of dimensions, but rendering an animation only works in 2D. Empty space is expressed through Boolean duality. Since particles and antiparticles are treated similarly, negating inputs negates outputs. A single particle in empty space (or a sea of antiparticles) is equivalent to a bounded random walk.
A system of size
The Rmd files require certain R packages to render the MPRWs, but only the "reshape2" package is needed in order to run the simulation. I recommend exporting to csv files or recoding in another programming language. The benefit of R is rapid prototyping, the downside is that generalization is slow. See the attached preprint research paper "Multiple particles colliding random walks" for a more detailed analysis of colliding random walks.
The most unusual property of colliding random walk simulations is the nonuniform frequency of states. The stationary distribution of a colliding random walks simulation with a single particle (in an antiparticle box) is the uniform distribution. However, this is clearly not the case for colliding random walks.
The plot shows the number of incoming states out of 1000 simulations of a 4x4 system with 12870 possible states. Although 1000 simulations are not nearly enough to cover all states leading into a incoming state, it is clear that some states are preferred more than others. The most incoming state is the checkerboard and its inversion.
Below is a comparison of a 34x34 system with various animations
MPRW.34x34.1000.sims.mp4
MPRW.34x34.1000.sims.smooth.mp4
MPRW.34x34.1000.sims.smooth.colored.outline.mp4
MPRW.34x34.1000.sims.FFT.clamp.120.mp4
The Rmd files contain detailed comments for each and every single function and section as to hypothesis, code intention, and execution.