Ehrenfest's Lottery

Plays Ehrenfest’s lottery to model the random mixing and evaluate the entropy
743 Downloads
Updated 2 Jul 2009

View License

This MATLAB program (urngame.m) reads in a distribution of marbles amongst a collection of two or more urns, and then plays Ehrenfest’s Lottery to randomly mix marbles amongst the urns following a diffusion like process. The entropy of the marble distributions are evaluated as the game is played out demonstrating entropy maximization as equilibrium is approached as dictated by the Second Law of Thermodynamics. This lottery and its thermodynamic implications are described in more detail in an article recently submitted to Chemical Engineering Education.

Cite As

Hank Ashbaugh (2024). Ehrenfest's Lottery (https://www.mathworks.com/matlabcentral/fileexchange/24626-ehrenfest-s-lottery), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0