Essay
Concentration of Measure
A technical companion to Politics and High Dimensional Probability — two proofs that Gaussian vectors in high dimensions live far from the origin.
I recently wrote a piece about the increasing polarization of the general public and why I believe it has a statistical basis in the sharp uptick in the number of opinions the average person is expected to hold. You can find that post here. I wanted to formalize the math behind the intuition here on the blog where LaTeX is first-class.
There’s certain holes in my reasoning below that I’m still trying to make sense of. The ones I’m aware of I’ve elucidated; the others I hope will come in the form of feedback. Suggestions and corrections are always welcome.
We want to show that most randomly sampled Gaussian vectors in high dimensional spaces aren’t close to the center of the distribution but rather lie some distance away from the center. We also want to show what this distance is. I want to outline two possible approaches and show how they converge to (nearly) the same result:
- Transformations between probability distributions combined with some neat tricks from convex optimization.
- Brute force calculus.
Approach 1
Objective: Show that a randomly sampled vector from an dimensional standard Gaussian will on average be units of distance away from the origin.
Proof: Consider a random vector sampled from a multivariate standard Gaussian.
We define as the identity covariance matrix in and as the zero vector. Each element of is drawn from the univariate standard normal distribution:
Consider the squared length of this vector (length here refers to the L2 norm). We can write out this expression as:
The expected value for this expression is intuitively the average squared length of the random vector drawn from .
By linearity of expectation, we obtain the following:
Recall that each is a univariate standard normal random variable. It is a well-known fact that squaring a Gaussian random variable in dimensions transforms it into a random variable sampled from a chi-squared distribution with degrees of freedom. This gives us the distribution of each term:
The above expression tells us the mean of the univariate chi-squared distribution is just 1 which means each term in the earlier summation equals 1.
Conclusion: The average squared length of a vector in dimensions is then just equal to . Take a second here to work through the argument above and convince yourself why this is true.
But we’re not done yet. Our objective was to determine the average length, not the average squared length. It might be tempting to just take the square root of the answer above. But remember that the square root is a non-linear concave function so linearity of expectation doesn’t apply.
Luckily we can turn to Jensen’s inequality which tells us that for a concave function and a random variable :
In the context of our problem, we can plug in the square root function as and the chi-squared random variable as to get:
The term on the left is what we want (the expected value of the length) whereas the term on the right is what we would get if we naively took the square root of the mean of the chi-squared random variable.
The inequality above tells us that the term on the right is an upper bound on our actual desired value on the left. But we can do better than just an upper bound.
The expected value of a random variable can be found by integrating the function over the probability density function of the random variable over the domain of .
Let’s plug our expression in. The expression we want to evaluate is:
is the square root function and is the PDF of the chi-squared distribution with degrees of freedom.
where is the gamma function.
Recall that the gamma function is the generalization of the factorial to complex numbers. While this integral doesn’t have a simple closed form solution, we can leverage numerical integration methods to evaluate it at specific values of and compare it to our naive solution of . Here’s what that graph looks like plotted across a range of dimensions (x-axis).

We’ve numerically verified Jensen’s inequality to hold true. The solid green line representing is indeed always below the dotted line representing . But the most interesting observation is that the two lines converge! Which means as we scale the dimensionality of our space, the average length of a vector converges to our naive solution of .
Approach 2
In the previous section we tried to answer the question: “What is the average distance from the origin for a randomly sampled vector in dimensions?”
But we can also formulate an alternate question: “At what distance from the origin does the probability of finding a vector take its maximum value?”
This framing reduces our question to a simple optimization problem. All we need now is an objective function to maximize. So let’s derive that.
We know that working with continuous distributions entails dealing with probability density functions (PDFs) as opposed to discrete distributions where we deal with probability mass functions (PMFs). When I first studied the two I didn’t pay too much attention to why they were named different things. The only difference I cared about was how you read them:
- The y-axis on the graph of a PMF shows probabilities.
- The y-axis on the graph of a PDF does not show probabilities: you need to integrate under the curve if you want that.
This difference is not just convention; the reason for it can be found simply by looking at the two names.
When we measure probabilities on the y-axis of a PMF, what we are really measuring is probability mass. A PDF does not show probabilities on the y-axis because it is not a measure of mass but rather of density. Forget about probabilities for a second and consider density as we apply it to physical quantities. The density of a substance is measured as the mass of that substance per unit volume. To get the mass of a substance, you need to multiply its mass by the volume it occupies. If you extend the volume over an interval, this “multiplication” is just integrating the product of density and volume over that interval. Which is exactly what we do when trying to obtain probability masses from a PDF!
The probability density of a multivariate standard Gaussian in dimensions is given by the following expression:
For any given , we can make a simplifying observation: the value of the PDF depends only on the magnitude of and not on the actual direction of . We know this because the only dependency on in the above expressions comes from the term — this is just the squared magnitude of .
Let be the magnitude of . We can then make the substitution . This gives us:
This gives us exactly what we need: an expression in terms of (the magnitude of the vector which is equivalent to the distance of the vector from the origin). Our objective is going to be to find the value of for which the product of the density and volume functions is maximized.
Now we need an expression for the volume. The first question to answer is what shape are we modeling the volume off?
The volume of the amount of space present at a distance from the origin in an dimensional space can be thought of as the volume of an dimensional hypersphere with radius . To convince yourself of why this might be true, look at the expression for the probability density and our observation about how the density is affected by different ‘s. For ‘s in different directions, as long as they have the same magnitude, the PDF evaluates to the exact same value. If you imagine taking a set of ‘s that are all pointing in different directions but have the same distance from the center, all of them evaluate to the same value when plugged into the PDF. A circle is defined as a collection of points in a plane that are all equidistant from a reference point. We can then think of each unique magnitude of the ‘s as defining a unique contour circle — every along a contour circle has the exact same magnitude and hence the exact same density.
This is slightly less intuitive so let’s start from the two dimensional case and build upwards.
The volume of a sphere in 2D (a circle) is just its surface area: .
The volume of a sphere in 3D (what we think of as a sphere) is given by: .
The generalization of the volume of a hypersphere in dimensions is given by the expression:
One way to intuitively grasp the above expression is that it represents the space in which our probability mass lives. It might be tempting at this point to directly multiply our expression for the volume by the expression for density and optimize the result. But we can’t use the above expression directly. We are interested in finding the distance at which the probability mass is maximized. But this requires us to know the mass concentrated exactly at that distance, not all the mass up to and including that distance. In other words, we don’t want to know how much mass is concentrated inside a hypersphere of radius ; we want to know how much mass is concentrated at an infinitesimally thin shell exactly at the radius .
We can think of this as the product not between density and volume but rather between density and differential volume. This is just the derivative of the above expression with respect to :
Take a second here to understand why we are using the differential volume. We know that probability density is different at different parts of the sphere depending on how far out you are (the value of ). To know the value of the probability mass at any of these distances, we need to know the density per unit volume. The unit volume here can be thought of as an increasingly thin shell at that distance . The limit as this shell approaches 0 is just the definition of the derivative of the volume function!
Let’s compare the two expressions for density and volume.
Density at distance :
Differential volume at distance :
What do you notice about the behavior of each of these functions?
Density is monotonically decreasing — in fact exponentially decaying in proportion to . As gets larger, density starts dropping and the rate at which it drops gets faster as increases.
Differential volume on the other hand is monotonically increasing — in fact polynomially growing in proportion to .
These two insights form the final piece of our intuition for why probabilities behave differently in higher dimensions. In lower dimensions, all we think about are the density curves. But in higher dimensions, volume is just as important because there is just so much more space to occupy.
Think about moving from 1D to 2D to 3D. Each time you move up a dimension, you add an entirely new axis of movement. An axis that is orthogonal to the others and could never have been reached from a combination of the previous ones. A being that can move in 3D space can access infinitely more space than a being restricted to move along two dimensions. Just by adding a single new dimension of movement. That increase in freedom happens every single time you add a dimension, even though we can’t picture anything above three dimensions.
Coming back to our expressions, we see that for higher values of , the growth of differential volume outpaces the exponential decay of density for a longer period of time. Eventually there is always a point where the rate at which density falls starts outpacing the rate at which volume grows but the distance from the origin at which that cross-over happens gets pushed out further and further the higher up you go in the dimensions.
The graphs below showcase this phenomenon. The x-axis are values of moving out farther from the origin. The blue line represents the density function evaluated at those values of , the green line represents the differential volume present at that distance, and the red line represents the product we are interested in. We plot this out for a range of values.

Notice that as increases, the maximum value of the product between density and volume gets pushed out to increasingly higher values of . The maximum is reached when the magnitude of the derivative of the density function (the rate of density decay) exceeds the magnitude of the derivative of the differential volume (the rate of volume growth).
Now all that’s left is to derive a closed form expression for where this maximum lies. To do this, we first write out the product of the differential volume and the density:
where = differential mass at radius .
We then take the derivative of this expression with respect to , set it to 0, and solve for :
A little help from sympy and we’re left with the following critical point for the maximum:
Therefore in dimensions, the annulus containing the most probability mass can be found at a distance of from the origin. Let’s see what this looks like across different dimensions.

The peak of the density × differential volume, representing the maximum value of the probability mass across all possible shell radii, shifts to the right as the dimension increases.
Here’s the visualization that really blows our intuition out of the water: for all these dimensions, the peak of the PDF would still be centered at 0!

All of the PDFs peak at 0 and exponentially decay as increases. This is why simply analyzing PDFs or probability densities in high dimensions can be so misleading — highest density no longer corresponds to greatest mass.
Some appendix thoughts on the two answers of and .
That discrepancy between Approach 1 and 2 bothers me but I can’t seem to formalize the difference. Any suggestions here would be invaluable.
The intuitive argument I’d make is that Approach 1 provides an expected value over the magnitude of whereas Approach 2 provides a single extremum at which the probability mass is maximized. These two aren’t equivalent. The easiest way to see this is in the 1 dimensional case. The expected value suggests that most vectors (points) in the 1D Gaussian would be found at a distance of 1 which is clearly not the peak of the density function. But that is because we are not taking the expectation over the Gaussian random variables themselves but rather just their magnitude. The magnitudes of all points sampled from the Gaussian are positive so it makes sense that their mean isn’t centered at 0 but rather around 1. This also makes sense once you realize that the standard deviation of the standard Gaussian is also (coincidentally?) 1 so we’re really measuring a spread of distance from the origin with the expected value of the magnitude.