# Boltzmann factor and partition function

I got a problem by finding an proper explanation.

The Boltzmann factor is defined as
$P_j=\frac{1}{Z}e^{-\beta E_j}$
I know, this is a probability distribution. but what exactly does it mean?

Wikipedia says: "The probability Pj that the system occupies microstate j" (link)
But that doesen make sense to me. cos $\sum_i$ is equal to 1.
That would only make sense if i look at ONLY 1 particle and not a system with n particles IMHO.

Then i got this Partition function Z.
It is defined as $Z=\sum_i g_i e^{- \frac{E_i}{k_BT}$
with a factor gi denoting the degeneracy of energy states.

What is gi? i thought it's the number of different states in this energy level. but that's not likely cos in the Maxwell-Boltzmann distribution there's no pauli law...

thanks