This program aims at exploring just how unlikely it is for randomly moving particles to cluster together. It is a simple simulation of a collection of 2D ‘particles’ (circles) bouncing around in a 2D enclosure (a ‘box’ of size NxN). The program visualizes the motion of these particles – fascinating to watch in and of itself – and keeps track of the degree of chaos in the box, i.e., the degree to which the particles are spread out over the box. The system’s entropy is estimated as the logarithm of the average distance between the particles. The simulation can be sped up significantly by not displaying the motion for some time; resuming the display then lets you inspect the lowest entropy configuration encountered during the run.

The source code is available on github. If you create a new version and would like to share it with this site, please contact feedback@sunnysideupsoftware.com.