# Counting measure

In mathematics, specifically measure theory, the counting measure is an intuitive way to put a measure on any set – the "size" of a subset is taken to be the number of elements in the subset if the subset has finitely many elements, and infinity ${\displaystyle \infty }$ if the subset is infinite.[1]

The counting measure can be defined on any measurable space (that is, any set ${\displaystyle X}$ along with a sigma-algebra) but is mostly used on countable sets.[1]

In formal notation, we can turn any set ${\displaystyle X}$ into a measurable space by taking the power set of ${\displaystyle X}$ as the sigma-algebra ${\displaystyle \Sigma ;}$ that is, all subsets of ${\displaystyle X}$ are measurable sets. Then the counting measure ${\displaystyle \mu }$ on this measurable space ${\displaystyle (X,\Sigma )}$ is the positive measure ${\displaystyle \Sigma \to [0,+\infty ]}$ defined by

${\displaystyle \mu (A)={\begin{cases}\vert A\vert &{\text{if }}A{\text{ is finite}}\\+\infty &{\text{if }}A{\text{ is infinite}}\end{cases}}}$
for all ${\displaystyle A\in \Sigma ,}$ where ${\displaystyle \vert A\vert }$ denotes the cardinality of the set ${\displaystyle A.}$[2]

The counting measure on ${\displaystyle (X,\Sigma )}$ is σ-finite if and only if the space ${\displaystyle X}$ is countable.[3]

## Integration on ${\displaystyle \mathbb {N} }$ with counting measure

Take the measure space ${\displaystyle (\mathbb {N} ,2^{\mathbb {N} },\mu )}$, where ${\displaystyle 2^{\mathbb {N} }}$ is the set of all subsets of the naturals and ${\displaystyle \mu }$ the counting measure. Take any measurable ${\displaystyle f:\mathbb {N} \to [0,\infty ]}$. As it is defined on ${\displaystyle \mathbb {N} }$, ${\displaystyle f}$ can be represented pointwise as

${\displaystyle f(x)=\sum _{n=1}^{\infty }f(n)1_{\{n\}}(x)=\lim _{M\to \infty }\underbrace {\ \sum _{n=1}^{M}f(n)1_{\{n\}}(x)\ } _{\phi _{M}(x)}=\lim _{M\to \infty }\phi _{M}(x)}$

Each ${\displaystyle \phi _{M}}$ is measurable. Moreover ${\displaystyle \phi _{M+1}(x)=\phi _{M}(x)+f(M+1)\cdot 1_{\{M+1\}}(x)\geq \phi _{M}(x)}$. Still further, as each ${\displaystyle \phi _{M}}$ is a simple function

${\displaystyle \int _{\mathbb {N} }\phi _{M}d\mu =\int _{\mathbb {N} }\left(\sum _{n=1}^{M}f(n)1_{\{n\}}(x)\right)d\mu =\sum _{n=1}^{M}f(n)\mu (\{n\})=\sum _{n=1}^{M}f(n)\cdot 1=\sum _{n=1}^{M}f(n)}$
Hence by the monotone convergence theorem
${\displaystyle \int _{\mathbb {N} }fd\mu =\lim _{M\to \infty }\int _{\mathbb {N} }\phi _{M}d\mu =\lim _{M\to \infty }\sum _{n=1}^{M}f(n)=\sum _{n=1}^{\infty }f(n)}$

## Discussion

The counting measure is a special case of a more general construction. With the notation as above, any function ${\displaystyle f:X\to [0,\infty )}$ defines a measure ${\displaystyle \mu }$ on ${\displaystyle (X,\Sigma )}$ via

${\displaystyle \mu (A):=\sum _{a\in A}f(a)\quad {\text{ for all }}A\subseteq X,}$
where the possibly uncountable sum of real numbers is defined to be the supremum of the sums over all finite subsets, that is,
${\displaystyle \sum _{y\,\in \,Y\!\ \subseteq \,\mathbb {R} }y\ :=\ \sup _{F\subseteq Y,\,|F|<\infty }\left\{\sum _{y\in F}y\right\}.}$
Taking ${\displaystyle f(x)=1}$ for all ${\displaystyle x\in X}$ gives the counting measure.