English translation
Define random variable X
Variance measures how much outcomes fluctuate around their expected value. Two models may share the same expectation, yet differ markedly in variance—leading to entirely different risk perceptions.
I always examine both expectation and variance. Relying solely on average performance risks overlooking instability and volatility.
In the previous tutorial, we covered computing expectations and the expectation of squared deviations—laying the groundwork for understanding distributional characteristics of random variables. In this tutorial, we focus on the properties of variance, and how to leverage them to analyze the behavior of random variables. As a key measure of dispersion, variance—and its intrinsic properties—forms the foundation for grasping more advanced statistical concepts.
1. Definition of Variance
Variance is a statistical measure quantifying the spread or dispersion of values taken by a random variable. For a random variable , its variance is defined as:
Here, denotes the expectation (or mean) of the random variable .
2. Fundamental Properties of Variance
Variance possesses several important properties—we introduce each below.
2.1 Non-negativity
Variance is always non-negative:
This reflects the fact that values of a random variable always scatter around their mean—and the magnitude of that scattering cannot be negative. Because variance involves squaring deviations, all squared terms are inherently non-negative.
2.2 Variance Under Addition of a Constant
Adding a constant to a random variable yields a new random variable , whose variance equals that of :
This property states that shifting a distribution by a constant does not affect its dispersion.
Example
Suppose random variable takes values , with expectation . Define , so takes values and . Compute variances:
-
For :
For :
Thus, .
2.3 Additivity of Variance (for Independent Variables)
For two independent random variables and , the variance of their sum equals the sum of their variances:
When learning variance properties, first visualize: mean → deviations → squared deviations → average. Then distinguish effects of translation (shifting), scaling (stretching/shrinking), and summing independent variables.
This means that when summing multiple independent random variables, the resulting variance is simply the sum of individual variances.
Example
Let and be independent random variables with:
Then for :
2.4 Variance Under Linear Transformation
For a random variable and constants , the linear transformation yields:
That is, scaling by scales its variance by ; adding constant has no effect on variance.
Sample Code
Below is a Python example demonstrating how variance transforms under linear operations:
import numpy as np
# Define random variable X
X = np.array([1, 2, 3])
mu_X = np.mean(X)
var_X = np.var(X)
# Apply linear transformation Y = 2X + 3
a = 2
b = 3
Y = a * X + b
var_Y = np.var(Y)
print(f"Variance of X: {var_X:.2f}")
print(f"Variance of Y after linear transformation: {var_Y:.2f} (should equal {a**2} × {var_X:.2f})")
2.5 Square Root of Variance: Standard Deviation
The standard deviation () is the square root of variance:
Don’t stop at “I understood” after reading AI-Ready Probability for Beginners: Properties of Variance. Go back, pick one step, implement it yourself—and note where you get stuck. This makes future learning more solid.
Because standard deviation shares the same units as the original data, it offers an intuitive, interpretable measure of dispersion—unlike variance, which is in squared units.
By now, organize AI-Ready Probability for Beginners: Properties of Variance into a concise recap table: clarify the core narrative first, then verify understanding with a small task.
After finishing AI-Ready Probability for Beginners: Properties of Variance, try walking through a small concrete example end-to-end—and assess which steps you can now execute independently.
3. Summary
In this tutorial, we thoroughly examined key properties of variance: non-negativity, invariance under constant addition, additivity for independent variables, behavior under linear transformations, and its relationship to standard deviation. These properties form the bedrock for analyzing and applying random variables across statistics and machine learning. In the next tutorial, we’ll explore covariance and correlation—the natural extensions of variance for describing relationships among multiple random variables. We hope you’ll soon wield these variance properties with confidence!
Continue