What Is the Entropy of the Sum of Two Uniform Random Variables?
At a glance
- 1. Set the assumptions
Assume the variables are independent and uniform on the same interval, usually [0,1].
- 2. Find the density
Convolve the two uniform densities to get a triangular density on [0,2].
- 3. Integrate the entropy
Use differential entropy, minus the integral of the density times its natural logarithm.
- 4. Adjust for scale
For a common interval of width L, add the natural logarithm of L to the [0,1] result.
The usual interpretation is that the two variables are independent and each is uniform on [0,1]. Their sum is not uniform: its density rises linearly, then falls linearly. Its differential entropy is 1/2 nat, or about 0.721 bits.
The interval and independence assumptions matter. The derivation below gives the standard result, then shows how it changes for other interval widths and what fails without independence.
Find the density of the sum
Let and be independent, each with density 1 on , and let . The density of a sum of independent continuous random variables is the convolution of their densities. Here, the density at is the length of the overlap between and :
For example, sums near 0 can be made in very few ways: both variables must be small. Sums near 1 have many possible pairs, so the density reaches its maximum there. The same reasoning makes the density decrease from 1 to 2.
Calculate differential entropy
For a continuous random variable with density , differential entropy in nats is
The two halves of this triangular density contribute equally. Therefore,
In the second line, integration by parts gives . To express the answer in bits, divide by :
If the uniforms use another interval
If both variables are uniform on , let be the interval width. Adding a constant to a random variable does not change its differential entropy, while multiplying it by adds . Thus, for the sum of these two variables,
For instance, if both are uniform on , then and the sum has entropy nats. Differential entropy depends on scale and units, so the numerical value can be negative for sufficiently small intervals; that is allowed.
If the variables are independent but their interval widths differ, the density is trapezoidal rather than symmetric triangular. Let be the larger width and the smaller width. For uniform variables on intervals of those widths, the entropy is
Translations of either interval do not affect this result. The formula uses widths measured in the same units; changing units shifts differential entropy by the logarithm of the scale factor.
What if the variables are dependent?
Knowing that each variable is uniform does not determine the entropy of their sum unless their joint dependence is specified. For example, if is uniform on and , then is uniform on , with entropy nats—not nat. The convolution calculation applies when the variables are independent.
Common mistakes
- Adding the two entropies: Entropy of a sum is generally not . In the standard case, each input has entropy 0, but the sum has entropy nat.
- Using discrete entropy: The sum is continuous, so use the density integral for differential entropy, not a sum over possible outcomes.
- Assuming a uniform sum: Even though both inputs are uniform, their sum has a triangular density when the intervals match.
- Ignoring the interval width: Differential entropy changes under rescaling; the value nat applies specifically to two independent uniforms on an interval of width 1.
References
- Elements of Information Theory, 2nd ed., Thomas M. Cover and Joy A. Thomas
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.