Problem 2.5

Einstein solid with ‘n’ oscillators and ‘q’ energy units:

Ω[n_, q_] := (((q + n - 1)!)/(q! (n-1)!))

We can also enumerate all the microstates.  The Tuples function will list all possible orderings of ‘N’ integers running from 0 to ‘q’.  We then Select[ ] only those that have a total energy of ‘q’.  There are many other ways to do this in Mathematica.

Tuples[Range[0, 4], 3] // TableForm;

enumerate[n_, q_] := Select[Tuples[Range[0, q], n], Total[#] == q &];

a.  N = 3, q = 4

n = 3; q = 4;

microstates = enumerate[n, q];
TableForm[microstates]
{Ω[n, q], Length[microstates]}

b.  N = 3, q = 5

n = 3; q = 5;
microstates = enumerate[n, q];
TableForm[microstates]
{Ω[n, q], Length[microstates]}
Clear[n, q]

c.  N = 3, q = 6

n = 3; q = 6;
microstates = enumerate[n, q];
TableForm[microstates]
{Ω[n, q], Length[microstates]}
Clear[n, q]

d.  N = 4, q = 2

n = 4; q = 2;
microstates = enumerate[n, q];
TableForm[microstates]
{Ω[n, q], Length[microstates]}
Clear[n, q]

e.  N = 4, q = 3

n = 4; q = 3;
microstates = enumerate[n, q];
TableForm[microstates]
{Ω[n, q], Length[microstates]}
Clear[n, q]

f.  N = 1, q = anything

Ω[1, q]

With only 1 oscillator, and a total energy of ‘q’, there is only one microstate:  That oscillator must have energy ‘q’.

g.  N = anything, q = 1.

Ω[n, 1]

FullSimplify[%, Element[n, Integers]]

With only one energy unit, it could be in any of the ‘n’ oscillators.