Microstates map onto macrostates

Rolling a dice gives us 36 microstates, but only 11 macrostates, corresponding to sums of 2 through 12.

Using binomial distribution:

successes = list(range(n+1))
combinations = [comb(n,k) for k in successes]

Entropy: the universe is more likely to move towards more likely states.

There are too many atoms, so we think on logarithmic scales: $$S = k_B\ln \Omega$$kB=1.38×1023J/K,Ωthe number of microstates,Sentropy

The equilibrium probability distribution describing how energy is spread between the two systems is given by:

Peq(EA)ΩA(EA)ΩB(EABEA)

Or in terms of the entropy:

Peq(EA)eSA(EA)/kBeSB(EABEB)/kB