This applet is part of the post Entropy and Normal Distributions. It provides a physics-based demonstration of the two mathematical facts:
- among all probability distributions on $(0, \infty)$ with mean equal to $\mu$, the exponential distribution $p(x)=\frac{1}{\mu}e^{-x/\mu}$ is the one with the highest-entropy.
- among all probability distributions on $(-\infty, \infty)$ with variance equal to $\sigma^2$, the normal distribution $p(x)=\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{x}{2\sigma^2}}$ is the one with the highest-entropy.
The setup is a model of an ideal gas. A large number of identical, circular particles move within a box, with all collisions being elastic. In such a scenario, how is kinetic energy distributed among the particles? What about momentum?
The second law of thermodynamics states that entropy increases over time.
The energy distribution has mean $T$, where $T$ is the temperature, and because all collisions are elastic, this remains constant. The simulation above shows that this distribution trends towards the one satisfying this constraint with maximal entropy, i.e. an exponential distribution.
Kinetic energy is a particle is equal to $\frac{1}{2}m(v_x^2 + v_y^2)$, so the variances of the x-velocity-distribution and the y-velocity-distribution have a fixed sum. Again, the simulation shows that these distributions trend towards the one with maximal entropy, i.e. a normal distribution.
You can pause/resume, restart the simulation, and change the number of particles or the mean kinetic energy (temperature).