In an elastic collision, the kinetic energy and momentum are conserved.
This small fragment in Javascript simulates a system of balls of different sizes and masses.
Live: https://joembedded.github.io/Elastic-Collisions/
The parameters (number and size of the balls, elasticity of the collisions, etc.) can easily be changed in the code.