Hello! In our previous lesson, we introduced the Principle of Maximum Entropy (MaxEnt) as a foundational tool for assigning probabilities to microscopic states. We saw that when we maximize entropy subject to macroscopic constraints, the resulting probability distribution takes on a characteristic exponential form.
Today, we will formalize this result. Our goal is to derive the general structure of this exponential family of distributions with full mathematical rigor. We will then apply this general result to a physical system with a fixed average energy, which will lead us directly to the celebrated Gibbs (or Canonical) distribution. The most crucial part of this lesson will be to uncover the profound physical identity of the Lagrange multiplier introduced in the derivation. This will establish one of the most important "bridge equations" connecting the microscopic world of statistical mechanics to the macroscopic world of thermodynamics.
1. The Exponential Family from Maximum Entropy
In the last lesson, we saw a sketch of the derivation. Now, we will work through it step-by-step. The problem is one of constrained optimization: we wish to find the probability distribution that maximizes the Shannon-Gibbs entropy,
subject to a set of constraints. These constraints represent our macroscopic knowledge about the system. Typically, they are the expectation values of certain functions . The two most fundamental constraints are:
- Normalization: The probabilities must sum to one. .
- Macroscopic Observables: The average value of different quantities is known. for .
Given your background in mathematical physics and classical mechanics, you are well-acquainted with solving such constrained optimization problems using the method of Lagrange multipliers, which extends naturally from functions to functionals.
To see the derivation in detail, let's turn to a set of notes from NYU and a paper by Keith Conrad.
[PDF] Information Theory and Predictability Lecture 6: Maximum Entropy ...
This document provides a concise and rigorous derivation of the exponential family from the MaxEnt principle using Lagrange multipliers.
Please read the section titled "Moment Constraints", starting from the main derivation. This section sets up the augmented functional J and performs the functional variation to find the form of p(x). It also includes a short proof of the uniqueness of the maximum.
Probability distributions and maximum entropy
To see this applied to several different physical and statistical scenarios, this appendix by Keith Conrad provides clear, worked examples.
In Appendix A, "Lagrange Multipliers," please review Example A.2 (Theorem 3.2) and Example A.6 (Theorem 5.12). These show the explicit application of the method to derive the Normal and Maxwell-Boltzmann distributions, which are key members of the exponential family.
As these texts demonstrate, the unique distribution that maximizes entropy subject to constraints on the average values is always of the form:
This is the general form of the exponential family of distributions. A few points are critical:
- The are the Lagrange multipliers, each corresponding to one constraint . Their values are determined by enforcing the constraint equations.
- The quantity is the normalization constant, ensuring . It is called the partition function, and it depends on the values of the Lagrange multipliers:
As we will see, this partition function is not merely a normalization factor; it encodes all the thermodynamic information about the system.
2. The Gibbs Distribution and the Physical Meaning of
Let's now apply this powerful result to a concrete physical system. Consider a system that can exist in a set of discrete microstates , each with a well-defined energy . The system is in thermal contact with a large heat reservoir, which fixes its average energy to a constant value, . This is the quintessential setup for the canonical ensemble.
Our only constraint (beyond normalization) is . This means we have only one function, , and one corresponding Lagrange multiplier, which in physics is universally denoted by .
The general exponential form immediately simplifies to:
This is the Boltzmann or Gibbs distribution. The canonical partition function is .
So far, is just an abstract mathematical parameter. To make this physics, we must connect it to a physical quantity. The following lecture by Leonard Susskind provides a masterful and exceptionally clear derivation that identifies .
Statistical Mechanics Lecture 4
This lecture walks through the entire derivation of the Gibbs distribution and, most importantly, establishes the physical identity of the Lagrange multiplier \beta.
First, watch the setup of the problem, where the entropy is maximized subject to the normalization and energy constraints using Lagrange multipliers. This recaps what we just read but in a lecture format. Please watch from the setup. Next, follow the core differentiation step which yields the exponential form of the probability p_i. This is the pivotal moment in the derivation. Watch from the derivation. The lecture then defines the partition function Z and derives the crucial expression for the average energy U in terms of the derivative of \ln Z. This is our first glimpse of the power contained within Z. Please watch from this segment. Finally, the climax. By calculating the entropy S in terms of U and Z, and then using the thermodynamic definition of temperature, 1/T = dS/dU, Susskind provides a beautiful and direct proof that \beta is the inverse temperature. Watch this part carefully from the identification of beta.
The result of this derivation is one of the most fundamental equations in all of statistical mechanics:
The Lagrange multiplier associated with the energy constraint is nothing other than the inverse temperature (multiplied by to make it dimensionless). This elevates our MaxEnt distribution from a mathematical curiosity to a predictive physical law. High temperature (small ) leads to a broad distribution over many energy states, while low temperature (large ) concentrates the probability in the lowest energy states.
The Gibbs distribution is therefore written as:
3. A Concrete Example: The Loaded Die
To build some intuition for how the constraint value shapes the final distribution, let's consider a non-physical but very illustrative example: a loaded six-sided die.
Imagine we roll a die many times, and while we don't know the probability for each face (), we are told the average outcome is, say, 4.5. This is higher than the 3.5 expected for a fair die. How should we assign the probabilities ?
This is a perfect MaxEnt problem. Our states are the outcomes {1, 2, 3, 4, 5, 6}. The "energy" of each state is just its numerical value, . The constraint is that the average "energy" is fixed: .
The MaxEnt principle tells us the distribution must be of the form . Since the average is higher than the uniform case, we expect the probabilities for 5 and 6 to be boosted, and those for 1 and 2 to be suppressed. This corresponds to a negative value for .
The following video gives a great visual explanation of this process.
The Principle of Maximum Entropy
This video illustrates how adding constraints, like a known average, forces the maximum entropy distribution to change from uniform to a specific exponential form.
Watch the segment from this example, where the narrator explains how knowing the average of a stream of digits changes the MaxEnt distribution.
The image below visualizes this exact principle for our die problem. The x-axis represents the imposed average value (our constraint), and the curves show the resulting MaxEnt probabilities for each of the six faces.

This plot perfectly encapsulates the role of the Lagrange multiplier. It is the parameter we tune to ensure our probability distribution respects the macroscopic constraints we have imposed. For each possible average value we could observe, there is a unique value of and a corresponding unique MaxEnt probability distribution.
Conclusion
In this lesson, we have rigorously established the connection between the Principle of Maximum Entropy and the foundational distributions of statistical mechanics.
Key Takeaways:
- Maximizing entropy subject to constraints on the average values of a set of functions leads uniquely to a probability distribution belonging to the exponential family: .
- For a physical system at a fixed average energy , this procedure yields the Gibbs distribution, .
- The Lagrange multiplier is not merely a mathematical artifact; it has a profound physical meaning as the inverse temperature, . This provides a direct bridge between the microscopic probabilities and macroscopic thermodynamics.
- The normalization constant, known as the partition function , depends on the Lagrange multipliers (and thus on thermodynamic variables like temperature). As we saw, the average energy can be found by differentiating .
In our next lesson, we will delve deeper into the properties of these distributions. We will see that the partition function is even more powerful than it appears. It acts as a "generating function" not just for the average energy, but for all of its statistical moments—the variance (fluctuations), skewness, and so on. This will lead us to the formal definitions of moment-generating and characteristic functions, essential tools for a statistical physicist.