= Counting measure
{wiki}
<Counting measure> makes <integration> into <summation> by giving every measurable <singleton> unit weight. On any <measurable space> $(X,\mathcal F)$, it is the <measure> $\#$ defined by
$$
\#(A)=\begin{cases}|A|,&A\text{ is finite},\\\infty,&A\text{ is infinite},\end{cases}\qquad A\in\mathcal F.
$$
Thus $\#(\varnothing)=0$, a <finite set> has its usual <cardinality>, and every <infinite set> has the same value $\infty$ in the <extended real number line>. In particular, <countably infinite sets> and <uncountable sets> are not distinguished by their <counting measure>. Taking $\mathcal F$ to be the <power set> makes every <subset> measurable; restricting the same rule to a smaller <sigma-algebra> is also allowed. https://www.math.ucdavis.edu/~hunter/measure_theory/measure_notes_ch1.pdf[John K. Hunter, Measure Theory, Example 1.11: counting measure]{ref}
Why is this a <countably additive> <measure>? For pairwise disjoint <measurable sets> $A_n$,
$$
\#\left(\bigcup_{n=1}^{\infty}A_n\right)=\sum_{n=1}^{\infty}\#(A_n).
$$
If the <union> is finite, only finitely many $A_n$ are nonempty, and finite <cardinality> adds. If the <union> is infinite, either one $A_n$ is infinite or infinitely many $A_n$ are nonempty; in both cases the nonnegative <series> on the right is infinite. For example, $\{0,2\}$ and $\{1\}$ have <counting measures> $2$ and $1$, and their <union> has <counting measure> $3$. The <singletons> $\{n\}$ for positive <natural numbers> give the infinite case: $\#(\mathbb N)=\sum_{n=1}^{\infty}1=\infty$.
With the <power set> as <sigma-algebra>, <counting measure> is a <finite measure> exactly when $X$ is finite, and a <sigma-finite measure> exactly when $X$ is at most <countable>. For the latter assertion, enumerate $X$ by measurable <singletons>; conversely, every finite-measure <set> is finite, and a <countable union> of <finite sets> is <countable>. Specifying the <sigma-algebra> matters: if $X=\mathbb N$ and $\mathcal F=\{\varnothing,\mathbb N\}$, <counting measure> is not a <sigma-finite measure>, since the only measurable finite-measure <set> is the <empty set>.
For a finite or <countably infinite set> $X$ equipped with its <power set>, every nonnegative <function> is a <measurable function>, and
$$
\int_X f\,d\#=\sum_{x\in X}f(x):=\sup_{F\subseteq X\text{ finite}}\sum_{x\in F}f(x).
$$
The <supremum> allows an infinite result and avoids choosing an order for the terms. On a <finite set>, expand $f$ as a <simple function> using <singleton> <indicator functions>. On a <countably infinite set>, enumerate the points and apply the <monotone convergence theorem> to finite truncations. Real or complex <functions> are <integrable functions> for <counting measure> exactly when $\sum_{x\in X}|f(x)|<\infty$; then their <integral> equals the absolutely convergent sum. This is the discrete counterpart of <Lebesgue integration>, developed further in <series as a Lebesgue integral against counting measure>. https://www.math.ucdavis.edu/~hunter/measure_theory/measure_notes_ch4.pdf[John K. Hunter, Measure Theory, Example 4.10: absolutely convergent series as integrals]{ref}
For example, $f(n)=2^{-n}$ on the positive <natural numbers> has <counting measure> <integral> one, by the <geometric series>. The <alternating harmonic series> has a finite ordered sum but is not the <integral> of an <integrable function> for <counting measure>: its positive and negative parts both have infinite sums. <Absolute convergence> is what makes the finite <integral> independent of enumeration. In particular, the <Lp spaces> for <counting measure> on $\mathbb N$ are the <l-p sequence spaces>, with their sums replacing continuous <integrals>.
Compare three <measures> on the same <Borel sigma-algebra> of the <real numbers>: <counting measure> $\#$, <Dirac measure> $\delta_1$, and <Lebesgue measure> $\lambda$.
$$
\begin{array}{c|ccc}
A&\#(A)&\delta_1(A)&\lambda(A)\\\hline
\varnothing&0&0&0\\
\{0\}&1&0&0\\
\{0,1,2\}&3&1&0\\
[0,2]&\infty&1&2\\
\mathbb Q\cap[0,2]&\infty&1&0
\end{array}
$$
The <rational numbers> in the last row form a <countably infinite set>; their <Lebesgue measure> is zero by <countable additivity> applied to <singletons>, even though they are <dense> in the <interval>.
\Image[/counting-dirac-measures-same-sets.png]
{title=The same <Borel sets> have different sizes under <counting measure>, <Dirac measure>, and <Lebesgue measure>}
{description=Original analytical comparison on the <real numbers>, with the selected point $1$ marked in orange. Drawings show the finite <sets> and the <interval>; the <rational numbers> are named symbolically because finitely many plotted points cannot depict that infinite dense <set>. Green zero entries mark the <null sets> for each column's <measure>.}
These are different answers to different questions: <counting measure> asks how many points occur, <Dirac measure> asks whether the selected point occurs, and <Lebesgue measure> asks how much <length> occurs. A <null set> therefore depends on its <measure>. For <counting measure>, the only <null set> is the <empty set>, so equality <almost everywhere> is equality everywhere. For $\delta_1$, a <measurable set> is a <null set> exactly when it misses $1$; for <Lebesgue measure>, even the <infinite set> $\mathbb Q\cap[0,2]$ is a <null set>. Integrating an <indicator function> recovers each table entry through $\int\mathbf1_A\,d\mu=\mu(A)$. This lets the same <Lebesgue integral> framework handle point counts, point evaluation, and geometric <length>.
Back to article page