Confusion with Pathria's derivation of the Canonical Ensemble I've some problems understanding Pathria's derivation of the canonical ensemble and the probability of a system being in a certain state.
According to Pathria ( section 3.2 ), we consider an ensemble of $N$ identical systems, labeled as $(1,2....,N)$. These systems, share a total energy $\epsilon$. Let $E_r$ be the energy eigenvalues of the different systems, and $n_r$ be the number of systems with energy $E_r$.
We now have the constraints :
$$\sum_{r}n_r=N$$
$$\sum_r n_rE_r=\epsilon=N\langle U\rangle$$
Here $\langle U\rangle$ is just the average energy of all the systems.
Let us define a state of the ensemble using {$n_r$}. This is basically a collection of $n_r$ that satisfies the above constraints. It represents a possible mode of distribution of the energy $\epsilon$.
Now, our question is, how many ways can we obtain a particular state {$n_r$}. This is the same way of asking, how many ways of reshuffling the systems between different energy states, to obtain the same {$n_r$}.
First we choose $n_1$ systems from $N$, to have energy $E_1$. From the rest, we choose $n_2$ systems to have energy $E_2$ and so on.
$$W_r=\space^{N}C_{n_1}\space^{N-n_1}C_{n_2}\space^{N-n_1-n_2}C_{n_3}......=\frac{N!}{\prod_i n_i !}$$
Since all sets of {$n_r$} are equally likely to occur, the frequency of occurrence should be proportional to $W_r$. Hence the set {$n_r$}, that maximizes $W_r$, would be the most probable state of the ensemble.
Then Pathria maximizes $\ln(W_r)$ subject to the constraints above.
Using this, he is able to derive the following :
$$n_r^*=\langle n_r\rangle = Ce^{-\beta E_r}$$
Using the constraints,
$$N=\sum_r n_r = \sum_r Ce^{-\beta E_r}$$
Hence, $$P(n_r)=\frac{\langle n_r\rangle}{N}=\frac{e^{-\beta E_r}}{\sum_r e^{-\beta E_r}}$$
I have quite a few problems with this derivation. First of all, the degeneracy of the states is not taken into account, in the ensemble.
Second of all, if all the systems are identical, there should be only one way of choosing $n_1$ systems from $N$ systems, and so on. For example, electrons are identical, and so, there is only one way of choosing $m$ electrons from $n$ electrons.
Because of this, the derivation for $\langle n_r\rangle$ should hold only for M-B statistics, where the systems are distinguishable. However, Pathria notes later, that this expression holds for quantum systems, as well as classical systems. Is he referring to the expression for probability, or is he talking about the entire derivation as a whole?
So my main problem is with the expression for $W_r$. What should be the expression for distributing $N$ systems among all the energy states, such that there are $n_k$ systems in the $k$-th energy state. If the systems are distinguishable, then the above relation holds. However, what do we do in case the systems are indistinguishable, like in the case of bosons and fermions. How do we obtain the same general expression for the probability of a system being in a particular state ?
 A: See the answers below

*

*First of all, the degeneracy of the states is not taken into account, in the ensemble If by degeneracy you mean "number of microstates with the same energy," this is  implicitly included in the calculation already. Recall that $r$ refers to a microstate and $E_r$ refers to the energy of that microstate. There may be many microstates $r$ with the same energy $E_r = E$ and will be counted in the summation over $r$. Suppose there are $\Omega(E)$ microstates with the same energy $E$. Then the partition function is
$$ 
   Q = \sum_r e^{-\beta E_r} = \sum_E \Omega(E) e^{-\beta E}
$$
The first summation is the standard definition of the canonical partition function as a sum over states. The second summation groups microstates by energy: there are $\Omega(E)$ microstates and each contributes $e^{-\beta E}$. So we now have the multiplicity of states (degeneracy) appear explicitly.


*Second of all, if all the systems are identical, there should be only one way of choosing $n_1$ systems from  systems, and so on Here is how we are "choosing". Start with the ensemble of all canonical microstates with volume $V$, number of particles $N$, and any possible energy. Next, pick $K$ microstates to obtain a collection whose total energy is some fixed $E$. You are allowed to pick the same microstate as many times you want as long as the total energy is exactly $E$. Then, $n_r$ is the number of times you picked microstate $r$. Here is a dummy demonstration. The ensemble contains microstates with energies 1,2 $\cdots$, and let's say there is only one microstate with the same energy. Collect $3$ states so that the total energy is 6. Here are all possible ways to do that:
$$ 
\begin{array}{ccc}
\#1 & \#2 & \#3 \\\hline
1 & 1 & 4 \\1 & 4 & 1 \\4 & 1 & 1 \\
1 & 2 & 3 \\1 & 3 & 2 \\2 & 1 & 3 \\2 & 3 & 1 \\ 3 & 1 & 2 \\3 & 2 & 1 \\
2 & 2 & 2
\end{array}
$$
On the fist row the microstate with energy $1$ appears twice ($n_1=2$), microstate with energy 4 once ($n_4=1$) and for all others $n_r=0$.  If states are degenerate, for example,energy 1 appears in red or blue, then we would have even more ways to build a collection of 3 states with energy 6, because we would allow permutations between blue 1's and red 1's.
Which brings us to $W(\{n_r\})$: this is multiplicity of $\{n_r\}$. To understand this multiplicity suppose a partition a system with energy 6 into three parts, #1, #2 and #3. The number of ways to assign $n_1=2$ microstates of energy 1 and $n_4=1$ microstate of energy 4 is
$$
   W(n_1=2,n_4=1) = \frac{(n_1+n_4)!}{n_1! n_4!} = 3
$$
These are the first three rows in the above example and correspond to the possible permutations of the list (1,1,4).
The particular statistics enter when we collect the ensemble of microstates. There we have to answer the question: how many microstates are there with the same energy? This is the part of statistical physics that actually requires physics.  Once this question is answered the rest is combinatorial calculus: paint your energies with different colors corresponding to the degeneracy of that energy, then construct the above table allowing all permutations as long as they refer to (i) different numbers or (ii) the same number in different colors. The only permutations not allowed are between numbers that are the same in both value and color.
