From a Density to Exact Measure
A density turns the length of a set into a weighted measure: regions where the density is large contribute more, and regions where it is small contribute less. When a density is constant on each piece of a partition, the calculation reduces to finding the lengths of the set inside those pieces and multiplying by the corresponding constants. The pieces may be finitely many or countably many, and the domain may be unbounded.
Throughout, \(m\) denotes Lebesgue measure on \(\mathbb{R}\), and \(E\) denotes a Lebesgue measurable subset of \(\mathbb{R}\). A density in this tutorial is a nonnegative, finite-valued measurable function \(f:\mathbb{R}\to[0,\infty)\), constant on each cell of a specified partition. It defines a measure \(\mu\) on the Lebesgue sigma-algebra \(\mathcal{L}\) by integrating \(f\). The measure may have finite or infinite total mass; it is not necessarily a probability measure.
The basic calculation is weighted length. For a measurable set \(E\), its contribution from cell \(I_j\) is \(c_jm(E\cap I_j)\). For an interval, the intersections are again intervals, possibly empty or with endpoints included or excluded; their Lebesgue measures are their lengths. If a cell is unbounded, its intersection length can be infinite. A zero density on such a cell contributes zero, while a positive constant density contributes infinite measure when the intersection has infinite length.
The Weighted-Length Formula
Proof. First suppose \(J=\{1,\ldots,r\}\) is finite. The functions \(c_j\chi_{E\cap I_j}\) are nonnegative and have disjoint supports. By finite additivity of the Lebesgue integral for nonnegative functions, \(\int_E f\,dm=\sum_{j=1}^r\int c_j\chi_{E\cap I_j}\,dm\). The integral of a constant times an indicator is \(c_jm(E\cap I_j)\), so the claimed formula follows.
Now suppose \(J\) is countably infinite and enumerate its cells as \(I_1,I_2,\ldots\). Define \(f_n=\sum_{j=1}^n c_j\chi_{I_j\cap E}\) on \(\mathbb{R}\). These functions are measurable, nonnegative, and increase pointwise to \(f\chi_E\), because the cells partition \(\mathbb{R}\). The Monotone Convergence Theorem applies on \((\mathbb{R},\mathcal{L},m)\): thus \(\int_E f\,dm=\lim_{n\to\infty}\int f_n\,dm\). The finite-case calculation gives \(\int f_n\,dm=\sum_{j=1}^n c_jm(E\cap I_j)\). Taking the limit gives the stated nonnegative series, including when it diverges to \(+\infty\). This proves the formula for every Lebesgue measurable \(E\). \(\square\)
Proof. Apply the theorem with \(E=\mathbb{R}\). Since the cells partition \(\mathbb{R}\), this gives \(\mu(\mathbb{R})=\sum_{j\in J}c_jm(I_j)\). A measure is finite precisely when its value on the whole space is finite, proving both directions. \(\square\)
Worked Calculations on Finite Partitions
Worked Example: An Interval and a Measurable Union
Let \(I_1=[0,1)\), \(I_2=[1,4)\), and \(I_3=[4,5)\), and set the density equal to \(2\), \(1/2\), and \(3\) on these cells, respectively, and \(0\) outside \([0,5)\). Calculate the measure of \(A=(1/2,9/2]\) and of \(E=[0,1/4)\cup[2,3)\cup[4,9/2]\).
For the interval \(A\), the intersections with the three cells have lengths \(1/2\), \(3\), and \(1/2\), respectively. The endpoints do not affect Lebesgue lengths. Therefore $$ \mu(A)=2\cdot\frac12+\frac12\cdot3+3\cdot\frac12 =1+\frac32+\frac32=4. $$
For \(E\), the first piece lies in \(I_1\) and has length \(1/4\), the second lies in \(I_2\) and has length \(1\), and the third lies in \(I_3\) and has length \(1/2\). Thus $$ \mu(E)=2\cdot\frac14+\frac12\cdot1+3\cdot\frac12 =\frac12+\frac12+\frac32=\frac52. $$
Check: \(A\) consists of lengths \(1/2\), \(3\), and \(1/2\) at the three respective densities, giving \(1+3/2+3/2=4\). For \(E\), the three weighted contributions are \(1/2\), \(1/2\), and \(3/2\), which sum to \(5/2\). The total mass of this measure is also finite: \(2\cdot1+(1/2)\cdot3+3\cdot1=2+3/2+3=13/2\).
This calculation works for arbitrary Lebesgue measurable sets, not only unions of intervals. The theorem requires just the lengths \(m(E\cap I_j)\); those lengths need not be computed by finding endpoints if the set has a more complicated shape.
Countably Many Pieces on an Unbounded Domain
Worked Example: A Finite Measure on the Whole Real Line
Partition \(\mathbb{R}\) into the cells \(I_n=[n,n+1)\), \(n\in\mathbb{Z}\). Give \(I_n\) density \(c_n=2^{-n-1}\) for \(n\ge0\), and density \(c_n=2^n\) for \(n\le-1\). Find the total mass and the measure of \((-3/2,5/2)\).
Every cell has length \(1\), so the total mass on the nonnegative cells is $$ \sum_{n=0}^{\infty}2^{-n-1} =\frac{1/2}{1-1/2}=1. $$ On the negative cells it is $$ \sum_{n=-\infty}^{-1}2^n =\sum_{k=1}^{\infty}2^{-k} =\frac{1/2}{1-1/2}=1, $$ where \(k=-n\). Thus \(\mu(\mathbb{R})=1+1=2\); despite the unbounded domain, the measure is finite.
The interval \((-3/2,5/2)\) meets five cells in positive length. In \(I_{-2}=[-2,-1)\), the intersection length is \(1/2\) and the density is \(2^{-2}=1/4\), contributing \(1/8\). In \(I_{-1}\), the full-cell contribution is \(2^{-1}\cdot1=1/2\). In \(I_0\), it is \(2^{-1}\cdot1=1/2\). In \(I_1\), it is \(2^{-2}\cdot1=1/4\). In \(I_2\), the intersection length is \(1/2\) and the density is \(2^{-3}=1/8\), contributing \(1/16\). Hence $$ \mu((-3/2,5/2)) =\frac18+\frac12+\frac12+\frac14+\frac1{16} =\frac{2+8+8+4+1}{16} =\frac{23}{16}. $$
Check: the same five contributions, grouped as \(1/8+1/2=5/8\), \(1/2+1/4=3/4\), and \(1/16\), total \(10/16+12/16+1/16=23/16\). This is less than the total mass \(2=32/16\), as it must be.
Worked Example: A Measurable Set Meeting Infinitely Many Cells
Use the same partition and densities. Let \(E=\bigcup_{n\in\mathbb{Z}}[n+1/4,n+3/4)\), the set that takes the middle half of every cell. Find \(\mu(E)\).
In each cell \(I_n\), the set \(E\cap I_n\) has length \(1/2\). The weighted-length formula therefore gives $$ \mu(E)=\sum_{n\in\mathbb{Z}}\frac12c_n =\frac12\sum_{n\in\mathbb{Z}}c_n =\frac12\cdot2=1. $$ The infinite sum is legitimate because the formula was proved by the Monotone Convergence Theorem: its partial sums are nonnegative and increase to the full density integral over \(E\).
Check: in each cell exactly half of its mass is included. Since the total mass is \(2\), the selected mass is \(2/2=1\), agreeing with the cell-by-cell sum.
Common Errors and the Conditions for Finiteness
A frequent mistake is to multiply a density by the number of cells an interval touches, rather than by the length of its intersection with each cell. For instance, in the preceding interval calculation, \(I_{-2}\) contributes \(1/4\cdot1/2=1/8\), not \(1/4\): only half that cell belongs to the interval. Likewise, \(I_2\) contributes \(1/8\cdot1/2=1/16\), not \(1/8\). The corrected calculation sums \(1/8+1/2+1/2+1/4+1/16=23/16\).
It is also important not to infer finiteness from the fact that every density value is finite. If a cell has infinite length and its density is a positive constant, its contribution is infinite. More generally, on a countable partition of an unbounded domain, infinitely many finite cell contributions can still have a divergent sum. The finiteness test is the full weighted series \(\sum_j c_jm(I_j)\), not a check of the individual constants alone. Conversely, the geometric example shows that positive densities on infinitely many unboundedly located cells can have finite total mass when their weighted contributions form a convergent series.
Finally, endpoints do not create extra mass here: each singleton has Lebesgue measure zero, so its integral against a finite piecewise-constant density is zero. But this endpoint observation does not allow one to ignore an interval of positive length, and it does not replace the need to check the lengths of partial cells.
Check Your Understanding
Use the weighted-length formula, and state whether the resulting total mass is finite whenever the question asks for it.
- A density equals \(1\) on \([0,2)\), \(3\) on \([2,3)\), and \(0\) elsewhere. Find the measure of \((1,5/2]\) and the total mass.
- On \(I_n=[n,n+1)\), \(n\in\mathbb{Z}\), let the density be \(4^{-|n|-1}\). Write the series for the total mass and determine whether it converges.
- For a countable measurable partition and nonnegative finite constants \(c_j\), prove that the measure of a measurable set \(E\) is \(\sum_j c_jm(E\cap I_j)\).
- For the density in the unbounded-domain example, find the measure of \([-1,1)\) by listing each cell contribution.
- Give an example of a finite constant density on a cell of infinite length for which the measure of that cell is infinite, and explain why this does not contradict the finiteness criterion.