Canonical Ensemble Calculator

(Using particle in 1D box example)

When n particles are arranged in k boxes (n ≤ k), the number of microstates depends on the nature of the particles.
For classical particles (distinguishable and can occupy box independently), the total number of microstates is kn.
For bosons (indistingusihable and can occupy the same box without restriction), the number of microstates is C(n + k - 1, n).
For fermions (indistinguishable but at most one particle per box), the number of microstates is C(k, n).
The combination function C(k, n) = k! / (n! (k - n)!).