# What would be the proper distribution to model the number of particles in a state in canonical ensemble

Suppose my system has $$N$$ particles, and I want to find a distribution for $$n_i$$, the number of particles in the $$\epsilon_i$$ energy state.

What I do know is the boltzmann probability, which tells me the probability of a single particle being in a certain energy state, and is denoted using $$p_i$$. I also know the expected number of particles in a system, given by $$p_iN=\mu$$.

According to some people that I asked, the distribution of particles would follow a binomial distribution, where the number of particles in the state would be a random variable. Hence, it would be given by :

$$p(n_i)={^{N}C_{n_i}}\space p_i^{n_i}(1-p_i)^{N-n_i}$$

Using this I can find the probability of each possible occupation number, through a binomial distribution.

Physically, this is equivalent to picking $$N$$ particles out of the system and counting the number of particles in $$n_i$$, and then repeating this experiment many many times and checking the frequency of each value of $$n_i$$. Because of fluctuations, we can be sure that $$n_i$$ keeps on changing every time I do this trial. It is basically like the distribution of heads in a $$100$$ coin tosses.

However, there is a second distribution that came to my mind. We know that the system can have $$n_i$$ particles, where $$n_i$$ ranges from $$0$$ to $$N$$. So, we consider $$N+1$$ different systems, labelled from $$0$$ to $$N$$, where the label denotes the number of particles in $$\epsilon_i$$ state of this system at a particular timestamp. Now what we do is, we check the probability of each of these systems of being the original system. Since these systems have a fixed number of $$n_i$$ each, we are indirectly getting the distribution of the number of particles $$n_i$$ of the original system.

So, what we check is, the probability of each of these systems, to give us a $$p_i$$ probability of picking up a particle at random, and finding it is in the $$i$$ state. In a sense, this is probability of probabilities.

How do we do that ?

Well, you know the expected number of particles in the energy state is given by $$\mu$$. So, we take each of these systems, and take out $$N$$ particles with replacement, and count the number of particles in that state, and repeat this experiment many many times. Whenever $$\mu$$ out of $$N$$ particles are in the desired state, we consider it a success. We check the frequency of success for each of these $$N+1$$ systems. This would give us a probability distribution of which system is how likely to give us a $$p_i$$ chance of picking up a random particle and finding it in a particular state. This distribution would be given by :

$$p(n_i)={^NC_\mu} \space\space(\frac{n_i}{N})^\mu \space\space (1-\frac{n_i}{N})^{N-\mu}$$

This distribution is not normalized, and looks a lot like the Binomial distribution. However, this takes into account, that for each system, the probability of getting a certain particle to be in a certain state, would be different. Moreover, the physical analogy also makes more sense in this case.

As discussed in my previous question, the boltzmann distribution is more like an estimator of the true probability of finding a particle in a certain state, as written by @Roger Vadim in this answer. So, instead of the distribution of the particles being a perfect boltzmann distribution, should it not be the distribution of different systems based on how likely the probability of getting a single particle in $$i$$ state in that system matches the boltzmann probability of the same.

In other words, shouldn't the second distribution be more accurate ?

I've checked that for large numbers, the two distributions produce more or less the same result, but I wanted to know which one is more accurate.

Tracking links to previous "similar" problems, one finds several over the last four years--some on this site and some on the physics site. Unfortunately, none of them is clearly stated and several mention more than one probability model. So this "Answer" of mine has to be speculative.

Suppose the proportion $$p_i$$ of particles in state $$i$$ is truly $$p_i = 0.4.$$ Then it is certainly possible for as few as 30 of 100 particles to be in state $$i.$$ Such particular potentially misleading results happen with probability about $$0.025;$$ counts as small as $$35$$ occur with probability about $$0.18;$$ and misleading counts above $$40$$ may also occur. [Using R.]

pbinom(30, 100, .4)
0.02478282
pbinom(35, 100, .4)
[1] 0.1794694


It seems possible that the current question (and some of its several predecessors) may really be concerned about the power of formal tests against alternatives as far from the true value $$0.4$$ as $$0.3$$ and $$0.5.$$

Such power values are easily simulated in R as shown below. Power values for tests (at the 5% level of significance) are only about $$55\%$$ against incorrect value $$p_i=0.3$$ and $$46\%$$ against $$p_i=0.5.$$

set.seed(2021)
pv = replicate(10^5, binom.test(rbinom(1,100,.3), 100, p=.4)$$p.val) mean(pv <= .05) [1] 0.54955 pv = replicate(10^5, binom.test(rbinom(1,100,.5), 100, p=.4)$$p.val)
mean(pv <= .05)
[1] 0.46214


So, by using binomial tests, $$N=100$$ observations is not enough to distinguish among $$0.3, 0.4,$$ and $$0.5,$$ using exact binomial tests.

Moreover, if we observe $$35$$ in state $$i$$ out of $$100,$$ one 95% CI for $$p_i$$ a Jeffreys 95% CI for $$p_i$$ is $$(0.26s, 0.446)$$ and an exact binomial 95% CI is $$(0.275, 0.452),$$ both of which include $$0.4.$$

qbeta(c(.025,.975), 35.5, 65.5)
[1] 0.2618456 0.4466968

binom.test(35,100)\$conf.int
[1] 0.2572938 0.4518494
attr(,"conf.level")
[1] 0.95


If the concern is that looking at $$N=100$$ particles may give a false impression about the proportion in energy state $$i,$$ then the concern is well founded.

Even if this speculative answer of mine is not useful, I hope complaints about it might provide a foundation for a cogent statement of the question in statistical language. Also, it would be helpful to know what accuracy of estimation of $$p_i$$ would be required and how many particles it is feasible to observe.