# Difficulty in understanding the derivation of “average height of Earth's atmosphere”

The derivation follows. Starting from the basic barometric formula $p(x)$ where $x$ is the height and $m$ - mass of one "air molecule" $$p=p_0\exp\left(-\frac{mgx}{kT}\right)$$ and using the fact that $$p=\frac{NkT}{V}$$ assuming constant temperature, we obtain $$\frac{NkT}{V}=\frac{N_0kT}{V}\exp\left(-\frac{mgx}{kT}\right)\Rightarrow N=N_0\exp\left(-\frac{mgx}{kT}\right)\Rightarrow \frac{N}{N_0}=\exp\left(-\frac{mgx}{kT}\right)$$ Average height of the atmosphere is really just the height at which the number of molecules as a function of height achievs its average. Average height is calculated by using the expected value formula $$\overline x=\int_0^{\infty}xf(x)dx$$ where $f(x)$ is supposed to be a probability density function of height which is actually the probability density function of the number of molecules. Since we know that $$\frac{N}{N_0}=\exp\left(-\frac{mgx}{kT}\right)~~~~~~~~~~~~~~~~(1)$$ in order to obtain the PDF we need to multiply the expression with some constant $A$ so that $$A\int_0^{\infty}\exp\left(-\frac{mgx}{kT}\right)=1\Rightarrow A=\frac{1}{\int_0^{\infty}\exp\left(-\frac{mgx}{kT}\right)}$$

By plugging all of this into the equation for average height we obtain $$\overline x=\int_0^{\infty}\frac{x\exp \left(-\frac{mgx}{kT}\right)}{\int_0^{\infty}\exp\left(-\frac{mgx}{kT}\right)}dx$$ since $f(x)=A\exp\left(-\frac{mgx}{kT}\right)$. The expression evaluates to $\overline x=kT/mg$

My questions:

1. In the derivation we start from $$\frac{N}{N_0}=\exp\left(-\frac{mgx}{kT}\right)~~~~~~~~~~~~~(1)$$ The author of the derivation then uses this as a probability to my understanding in the sense of desired no. of outcomes/total no. of outcomes to obtain $A$ and the final pdf. However what is the justification of this? How can we treat a non-random quantity such as number of molecules like it is random?

2. Even if we accept the treatment of number of molecules as a random quantity, the derivation of the pdf seems wrong. Since the equation for the pdf - $f(x)$ is $f(x)=Ag(x)$ where $g(x)=(1)$ the pdf then has the form of $$f(x)=Ag(x)=A\frac{N(x)}{N_0}$$ whereas it should have the form of $$f(x)=\frac{A}{N_0}\frac{dN(x)}{dx}$$

3. Even if we accept that the obtained pdf is correct, what is the interpretation of probability density function of height and why it equals the probability density function of number of molecules ?

4. Finally, assuming that the derivation is correct, what is the interpretation of $$\int_a^b A\exp\left(-\frac{mgx}{kT}\right)dx$$ It should be a probability of some sort but I can't make sense of it since the quantity we are dealing with is not random.

• It's not a probability density calculation, and the calculation is not statistical. It is a calculation to determine the center of mass of the atmosphere. Do you remember how to calculate center of mass for a distributed mass density? – Chet Miller Aug 31 '17 at 12:02
• Where does the author say that the number of molecules (per unit volume) is random? – sammy gerbil Aug 31 '17 at 12:04
• @ChesterMiller Thanks. Does that mean that $N_0$ in the calculation should represent the total number of molecules in the air column? Because it represents only the number of molecules at $x=0$ and that doesn't give correct weights for the calculation of center of mass. – ahra Aug 31 '17 at 13:30
• You should be using the molar density $\frac{p}{RT}$ or the mass density $\rho=\frac{pM}{RT}$, so $\rho=\rho_0e^{-\frac{Mgx}{RT}}$The center of mass is $\frac{\int_0^{\infty}{x\rho dx}}{\int_0^{\infty}{\rho dx}}$ – Chet Miller Aug 31 '17 at 14:04

Q2 I find your use of A and g(x) hard to follow, but I'd define the probability density function f(x) as $$f(x) =\frac{\text{No. of molecules per unit}\ x\ \text{at height}\ x}{\text{Total number of molecules}}$$ in which case $$f(x)=\frac{mg}{kT}\ exp \left(-\frac{mgx}{kT}\right)$$
This follows from your eq 1, and because $$\int_{0}^{\infty} N_{total}\ f(x)\ dx =N_{total}.$$ Apologia: The following does not (yet) address your specific questions, but I think it does give insight, and you may not be aware of it…
$\overline{x}$ is the height of atmosphere that, if the atmosphere had the same density throughout as at ground level, would give the same pressure at ground level as an actual atmosphere.
Thus for a column of air of area A, equating forces at ground level $$A\overline{x} \rho g = p A.$$ But $pV = NkT$ so $$p=\frac{N}{V} kT =\frac{Nm}{V} \frac{kT}{m} = \frac{\rho kT}{m}.$$ Eliminating p we get $$\overline{x}=\frac{kT}{mg}.$$ Note that this result seems to be independent of any particular distribution, though, of course, the same laws that give us $\overline{x}$ give us the distribution!