This is the Boltzmann game! It's a classic classroom experiment that's useful in conceptualising thermodynamical evolution and the exponential distribution.
It's quite sad to see it presented here without attribution; the appropriate reference is Michalek and Hanson, 2006 [1]. For the physically inclined, this [2] is a more detailed description of the underlying mechanics.
[1]: https://pubs.acs.org/doi/10.1021/ed083p581 [2]: http://hyad.es/boltzmann