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 if the subset is infinite.
In formal notation, we can turn any set into a measurable space by taking the power set of as the sigma-algebra that is, all subsets of are measurable sets. Then the counting measure on this measurable space is the positive measure defined by
Integration on with counting measure
Take the measure space , where is the set of all subsets of the naturals and the counting measure. Take any measurable . As it is defined on , can be represented pointwise as
Each is measurable. Moreover . Still further, as each is a simple function
The counting measure is a special case of a more general construction. With the notation as above, any function defines a measure on via