Variance and Covariance
Variance measures the spread of one random variable. Covariance measures how two random variables fluctuate together.
For a real random variable with mean
the variance is
The standard deviation is
In quantum mechanics, standard deviations become the appearing in uncertainty relations. The operator-specific treatment is Variance and Standard Deviation; this page supplies the probability language underneath it.
Finite Moments
Section titled “Finite Moments”Variance is defined only when the required expectations exist. A random variable can have a well-defined distribution but no finite variance.
For a discrete random variable with values and probabilities ,
For a continuous random variable with density ,
when the integrals converge in the required sense.
Finite normalization does not imply finite variance. A heavy-tailed distribution can have total probability one but divergent second moment.
Variance Formula
Section titled “Variance Formula”Expanding the square gives the computational form
Derivation:
Variance is nonnegative:
because it is the expectation of a square. It has the squared units of , while has the same units as .
Standard Deviation
Section titled “Standard Deviation”The standard deviation
is the most common quoted measure of spread because it has the same units as the measured quantity.
It is not the same thing as an experimental error. In probability theory it describes the spread of the distribution. In quantum mechanics, describes the spread of ideal measurement outcomes predicted by a state, even before apparatus imperfections are considered.
Two-Outcome Example
Section titled “Two-Outcome Example”Let take values and with
Then
Since always,
Therefore
The variance is zero when one outcome is certain and maximal when .
Gaussian Example
Section titled “Gaussian Example”For a normal density with mean and standard deviation ,
one has
Different wavefunction conventions sometimes use different width parameters. The variance is the reliable way to identify the physical width of the probability density.
For the broader Gaussian toolkit, including multivariate covariance matrices and Gaussian integrals, see Gaussian Distributions.
Covariance
Section titled “Covariance”For two real random variables and on the same probability space, the covariance is
Equivalently,
Covariance is positive when and tend to fluctuate in the same direction, negative when they tend to fluctuate in opposite directions, and zero when their linear fluctuation is absent.
The units of are the units of times the units of .
Joint Distributions Are Required
Section titled “Joint Distributions Are Required”Covariance depends on the joint distribution of and , not only on their separate distributions.
For a joint density ,
The marginal densities
do not determine the covariance by themselves.
This point matters in quantum mechanics because incompatible observables generally do not come with a single classical joint distribution of pre-existing values; see Classical Probability versus Quantum Probability.
Correlation Coefficient
Section titled “Correlation Coefficient”When and , the correlation coefficient is
It is dimensionless and satisfies
The bound follows from the Cauchy–Schwarz inequality applied to the centered variables and .
Correlation rescales covariance so that variables with different units can be compared. It measures linear association, not all possible dependence.
Uncorrelated Does Not Mean Independent
Section titled “Uncorrelated Does Not Mean Independent”If and are independent and have finite second moments, then
The converse is false. For example, let be uniformly distributed on and let
Then
so . But is fully determined by , so they are not independent.
Zero covariance means no linear covariance, not no relationship.
Covariance Matrices
Section titled “Covariance Matrices”For random variables , the covariance matrix is
It is symmetric:
It is also positive semidefinite. For any real vector ,
This property is the probability-theory ancestor of many positivity constraints in quantum mechanics, including uncertainty inequalities and positivity of density operators.
Quantum Preview
Section titled “Quantum Preview”For a quantum observable in a state, the outcome variance is the classical variance of the Born-rule measurement distribution:
For two commuting observables with a joint measurement, covariance has the ordinary interpretation as covariance of two jointly measured outcomes.
For noncommuting observables, one must be more careful. A common symmetrized quantum covariance is
where
and
This is not the same as assuming that and have simultaneous hidden classical values. It is an operator expression defined by the state and observables.
The general uncertainty relation includes both spread and noncommutativity. A basic form is
The full discussion belongs in General Uncertainty Relations.
Common Mistakes
Section titled “Common Mistakes”- Treating variance as the mean absolute deviation.
- Forgetting to subtract the square of the mean in .
- Assuming zero mean implies zero variance.
- Forgetting that variance has squared units.
- Computing covariance from marginal distributions without a joint distribution.
- Treating zero covariance as independence.
- Reading quantum uncertainty as ordinary apparatus error.
- Assigning covariance to noncommuting observables without specifying the measurement or operator convention.
Cross-Links
Section titled “Cross-Links”- Random Variables
- Probability Densities
- Expectation Values
- Inner Products
- Conditional Probability
- Characteristic Functions
- Gaussian Distributions
- Monte Carlo Basics
- Classical Probability versus Quantum Probability
- Variance and Standard Deviation
- General Uncertainty Relations
- Commutators and Anticommutators
References
Section titled “References”- W. Feller, An Introduction to Probability Theory and Its Applications, Volume I, 3rd ed., Wiley, 1968.
- P. Billingsley, Probability and Measure, 3rd ed., Wiley, 1995.
- R. Durrett, Probability: Theory and Examples, 5th ed., Cambridge University Press, 2019.
- R. Shankar, Principles of Quantum Mechanics, 2nd ed., Springer, 1994.
- J. J. Sakurai and J. Napolitano, Modern Quantum Mechanics, 3rd ed., Cambridge University Press, 2020.
Exercises
Section titled “Exercises”- A random variable takes values and with . Compute its variance.
Solution
Here
because for values and . Therefore
- Let take values and with equal probability. Compute , , and .
Solution
The mean is
Since always,
Thus
- Suppose , , and . Find the correlation coefficient.
Solution
The standard deviations are and . Therefore
- Show that adding a constant does not change variance: .
Solution
The mean of is . Therefore
So
- For centered variables with , what does reduce to?
Solution
Using
and the centered assumptions, one gets