Problem 2.10

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

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

Reproduce the table in Figure 2.4.
Systems A and B

nA = 200; nB = 100; qTotal = 100;

ntotal = Ω[nA + nB, qTotal]; N[ntotal]

data = Table[{qA, ΩA = Ω[nA, qA], qB = qTotal - qA, ΩB = Ω[nB, qB], ΩA * ΩB, N[ΩA*ΩB / ntotal] }, {qA, 0, qTotal}];

data = Table[{qA, ΩA = N[Ω[nA, qA]], qB = qTotal - qA, ΩB = N[Ω[nB, qB]], ΩA * ΩB, N[ΩA * ΩB/ntotal] }, {qA, 0, qTotal}];

TableForm[data[[Range[10]]], TableHeadings->{None, {"qA", "ΩA", "qB", "ΩB", "Ωtotal", "Probability"}}]

ListPlot[data[[All, {1,6}]], LabelStyle->Larger, AxesLabel -> {"qA", "Probability"}, ImageSize->Scaled[0.8], PlotRange->All]

Most-probable macrostate

The most probable state is qA = 67.

max = MaximalBy[data, #[[6]] &]

Least-probable macrostate

The least probable state is qA = 0.

min = MinimalBy[data, #[[6]] &]