Boltzmann Entropy Simulator

// Statistical mechanics via dice — microstates, macrostates, emergent probability

How it works: Each coloured die represents one distinguishable gas particle, labelled with a unique Serial Number (P1, P2, etc.). To simulate kinetic motion over time, each "Roll" randomly selects just one particle. That particle then "throws" its k-sided die to decide which region it moves to. A single microstate is defined by the specific list of locations for every particle — e.g. P1 → Region 2, P2 → Region 1, P3 → Region 2.
A macrostate (often called a configuration on exams) is the total number of particles in each region (e.g., 3 in Region 1, 1 in Region 2). A microstate is the specific arrangement of exactly WHICH unique particles are where. Because particles are unique, many different microstates result in the exact same macrostate. Ω = n! / (n1! n2! … nk!) = number of microstates for a given macrostate. Theoretical probability P = Ω / kn. Entropy S = kB ln Ω, where kB = 1.38 × 10−23 J K−1.
⚖ Fundamental Postulate of Statistical Mechanics: Because each die roll is independent and the die is fair, every specific microstate is equally likely to occur with probability 1/kn. The most probable macrostate is simply the one with the greatest number of microstates (Ω).
Configuration
Defines the number of available states for each individual particle.
Used to calculate Ω via the multinomial coefficient. Each particle is unique (Serial Number).
One unit of time: Randomly selects ONE particle and moves it to a random region.
Returns all particles to Region 1 — perfectly ordered state, Ω = 1, S = 0.
Rolling…
Dice Roll
Each die = one distinguishable particle. P1, P2… are unique Serial Numbers. Moving a particle to a new region changes the macrostate. Swapping two particles between regions creates a NEW microstate, but keeps the macrostate (configuration) exactly the same.
Particle Locations
Session Statistics
Total Rolls 0
Total microstates in system (kn) — denominator of P
Current Macrostate / Configuration (n1, …, nk)
Ω for current macrostate — numerator of P 1
Entropy S = kB ln Ω 0 J K−1
Smax (most probable macrostate)
S / Smax × 100%
Note: kB = 1.38 × 10−23 J K−1 is the Boltzmann Constant — distinct from k (the number of regions).
Thermal Equilibrium is approached when the system fluctuates near 100% of Smax. That macrostate has the highest Ω — the most possible microstates — so the system spends the most time there by pure probability, not by any directed force.
Macrostate / Configuration (n1, n2, …, nk) Ω (number of possible microstates) Theoretical P = Ω / kn Observed P Difference Frequency
Theoretical P (green) Observed P (red) ◀ = current configuration  |  sorted by arrangement (symmetric)