An extension of the concept of a set. A multiset
is an unordered collection of elements where the
same element may appear more than once. Two multisets
are equal if and only if they contain the same elements
in the same multiplicities.
For example, A={1,2,3} and B={1,2,2,3} are distinct
multisets (since the element 2 appears only once in A,
but twice in B). On the other hand, C = {3,3,1,2} and
D = {1,2,3,3} are equal as multisets.
If all the elements of a multiset A are drawn from
some universal set U, then we can extend the notion
of characterisitc function to multisets. The
characteristic function of A (usually written),
χA: U → N (where
N
is the set of natural numbers {0,1,2,...}) such that
for all x in U, if x is an element of A, and appears with
multiplicity n then
χA(x)=n, and
0 otherwise.
It's easy to see that two multisets A and B are equal
iff χA = χB as functions.