All Topics  
Multiset

 

   Email Print
   Bookmark   Link






 

Multiset



 
 
In mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, a multiset (or bag) is a generalization of a set. A member
Element (mathematics)

In mathematics, an element or member of a Set is any one of the distinct objects that make up that set....
 of a multiset can have more than one membership
Element (mathematics)

In mathematics, an element or member of a Set is any one of the distinct objects that make up that set....
, while each member of a set has only one membership. The term "multiset" was coined by Nicolaas Govert de Bruijn
Nicolaas Govert de Bruijn

Nicolaas Govert de Bruijn is a Netherlands mathematician, affiliated as professor emeritus with the Eindhoven University of Technology. He received his Ph.D....
 in the 1970s. The use of multisets in mathematics predates the name "multiset" by nearly 90 years; Richard Dedekind
Richard Dedekind

Julius Wilhelm Richard Dedekind was a Germany mathematics who did important work in abstract algebra, algebraic number theory and the foundations of the real numbers....
 used multisets in a paper published in 1888.

The total number of elements in a multiset, including repeated memberships, is the cardinality
Cardinality

In mathematics, the cardinality of a set is a measure of the "number of Element of the set". For example, the set A = contains 3 elements, and therefore A has a cardinality of 3....
 of the multiset, and the number of times an element belongs to the multiset is the multiplicity
Multiplicity (mathematics)

In mathematics, the multiplicity of a member of a multiset is how many memberships in the multiset it has. For example, the term is used to refer to the number of times a given polynomial equation has a root at a given point....
 of that member.






Discussion
Ask a question about 'Multiset'
Start a new discussion about 'Multiset'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, a multiset (or bag) is a generalization of a set. A member
Element (mathematics)

In mathematics, an element or member of a Set is any one of the distinct objects that make up that set....
 of a multiset can have more than one membership
Element (mathematics)

In mathematics, an element or member of a Set is any one of the distinct objects that make up that set....
, while each member of a set has only one membership. The term "multiset" was coined by Nicolaas Govert de Bruijn
Nicolaas Govert de Bruijn

Nicolaas Govert de Bruijn is a Netherlands mathematician, affiliated as professor emeritus with the Eindhoven University of Technology. He received his Ph.D....
 in the 1970s. The use of multisets in mathematics predates the name "multiset" by nearly 90 years; Richard Dedekind
Richard Dedekind

Julius Wilhelm Richard Dedekind was a Germany mathematics who did important work in abstract algebra, algebraic number theory and the foundations of the real numbers....
 used multisets in a paper published in 1888.

The total number of elements in a multiset, including repeated memberships, is the cardinality
Cardinality

In mathematics, the cardinality of a set is a measure of the "number of Element of the set". For example, the set A = contains 3 elements, and therefore A has a cardinality of 3....
 of the multiset, and the number of times an element belongs to the multiset is the multiplicity
Multiplicity (mathematics)

In mathematics, the multiplicity of a member of a multiset is how many memberships in the multiset it has. For example, the term is used to refer to the number of times a given polynomial equation has a root at a given point....
 of that member. i.e. in the multiset the multiplicities of the members a, b, and c are respectively 2, 3, and 1, and the cardinality of the multiset is 6.

In multisets, as in sets and in contrast to tuples, the order of elements does not matter. The following list displays the difference between the three concepts, note how a (finite) multiset can also be considered an unordered tuple:

  • The tuple
    Tuple

    In mathematics, a tuple is a sequence of a specific number of values, called the components of the tuple. These components can be any kind of mathematical objects, where each component of a tuple is a value of a specified type....
    s (a, b) and (b, a) are not equal, because in tuples order is important; and the tuples (a, a) and (a) are not equal either, because in tuples and multisets multiplicity
    Multiplicity (mathematics)

    In mathematics, the multiplicity of a member of a multiset is how many memberships in the multiset it has. For example, the term is used to refer to the number of times a given polynomial equation has a root at a given point....
     is considered, affecting cardinality.


  • The multisets and are equal, because in multisets order is unimportant; but the multisets and are not equal, as they have different cardinalities.


  • The sets and are equal, like the multisets and ; but the sets and are equal, unlike the multisets and , this is because in sets, the concept of multiplicity does not exist, or in other words all objects, no matter how many times they belong to the set, still count as one.


Formal definition


Within set theory
Set theory

Set theory is the branch of mathematics that studies Set , which are collections of objects. Although any type of object can be collected into a set, set theory is applied most often to objects that are relevant to mathematics....
, a multiset can be formally defined as a pair (A, m) where A is some set and m : A ? N=1 is a function
Function (mathematics)

The mathematical concept of a function expresses dependence between two quantities, one of which is known and the other which is produced. A function associates a single output to each input element drawn from a fixed Set , such as the real numbers , although different inputs may have the same output....
 from A to the set N=1 =  of positive
Negative and non-negative numbers

A negative number is a real number that is inequality 0 , such as -3. A positive number is a real number that is greater than zero, such as 2....
 natural number
Natural number

In mathematics, a natural number can mean either an element of the Set = *n = = ? = ? ...
s. The set A is called the underlying set of elements. For each a in A the multiplicity (that is, number of occurrences) of a is the number m(a). If a universe U in which the elements of A must live is specified, the definition can be simplified to just a multiplicity function mU : U ? N from U to the set N =  of natural numbers, obtained by extending m to U with values 0 outside A. This extended multiplicity function is the multiplicity function called 1A below. Like any function, the function m may be defined as its graph: the set of ordered pairs . With these definitions the multiset written as is defined as (), and the multiset is defined as ().

The concept of a multiset is a generalization
Generalization

Generalization is a foundational element of logic and reasoning. Generalization posits the existence of a domain or Set theory of elements, as well as one or more common characteristics shared by those elements....
 of the concept of a set. A multiset corresponds to an ordinary set if the multiplicity of every element is one (as opposed to some larger natural number). However to replace set theory by "multiset theory" so as to have multisets directly into the foundations is not easy: a privileged role would still have to be given to (ordinary) sets when defining maps, as there is no clear notion of maps (functions) between multisets. It can be done, with the result that classical theorems such as the Cantor–Bernstein–Schroeder theorem
Cantor–Bernstein–Schroeder theorem

In axiomatic set theory, the Cantor?Bernstein?Schroeder theorem, named after Georg Cantor, Felix Bernstein, and Ernst Schr?der, states that, if there exist injective functions f : A ? B and g : B ? A between the Set A and B, then there exists a bijection function h : A ? B....
 or Cantor's theorem
Cantor's theorem

In elementary set theory, Cantor's theorem states that, for any Set A, the set of all subsets of A has a strictly greater cardinality than A itself....
, when generalized to multisets, are false; they remain true only in the case of finite multisets. One advantage of treating multisets in their own right (as primitive, rather than defined in terms of something else) is that one can talk naturally about multiplicity 0 without having to admit that multisets are infinite - in the classical sense - since multisets have automatically their own notion of size.

An indexed family
Indexed family

In mathematics, an indexed family of sets is defined in stages, beginning with the more general concept of an indexed family of elements, which an alternative way of conceptualizing the range of a function or mapping....
, ( ai ), where i is in some index-set, may define a multiset, sometimes written , in which the multiplicity of any element x is the number of indices i such that ai = x. The condition for this to be possible is that no element occurs infinitely many times in the family: even in an infinite multiset, the multiplicities must be finite numbers.

Multiplicity function

Let us first consider the set indicator function of a normal set, then generalize this concept to the multiplicity function for multisets. The set indicator function
Indicator function

In mathematics, an indicator function or a characteristic function is a Function defined on a Set that indicates membership of an element in a subset of ....
 of a subset of a set is the function

defined by

The set indicator function of the intersection
Intersection (set theory)

In mathematics, the intersection of two Set A and B is the set that contains all elements of A that also belong to B , but no other elements....
 of sets is the minimum function of the indicator functions The set indicator function of the union
Union (set theory)

In set theory, the term Union refers to a set operation used in the convergence of set elements to form a resultant set containing the elements of both sets....
 of sets is the maximum function of the indicator functions The set indicator function of a subset
Subset

In mathematics, especially in set theory, a Set A is a subset of a set B if A is "contained" inside B. Notice that A and B may coincide....
 is smaller than or equal to that of the superset The set indicator function of a cartesian product
Cartesian product

In mathematics, the Cartesian product is a direct product of sets. The Cartesian product is named after Ren? Descartes, whose formulation of analytic geometry gave rise to this concept....
 is the product of the indicator functions of the cartesian factors The cardinality
Cardinality

In mathematics, the cardinality of a set is a measure of the "number of Element of the set". For example, the set A = contains 3 elements, and therefore A has a cardinality of 3....
 of a (finite) set is the sum of the indicator function values Now generalize the concept of set indicator function by releasing the constraint that the values are 0 and 1 only and allow the values 2, 3, 4 and so on. The resulting function is called a multiplicity function and such a function defines a multiset. The concepts of intersection, union, subset, cartesian product and cardinality of multisets are defined by the above formulas.

The multiplicity function of a join, sometimes called the sum, is the sum of the multiplicity functions . A small finite multiset, A, is represented by a list where each element, x, occurs as many times as the multiplicity, 1A(x), indicates.

Examples


One of the simplest and most natural examples is the multiset of prime
Prime number

In mathematics, a prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. An infinitude of prime numbers exists, as demonstrated by Euclid around 300 BC....
 factors of a number n. Here the underlying set of elements is the set of prime divisor
Divisor

In mathematics, a divisor of an integer n, also called a factor of n, is an integer which evenly divides n without leaving a remainder....
s of n. For example the number 120
120 (number)

120 is the natural number following 119 and preceding 121 . 120 was known as "the great hundred", especially prior to the year 1700, from the Teutonic Hundert which equalled 120....
 has the prime factorization which gives the multiset .

A related example is the multiset of solutions of an algebraic equation. A quadratic equation
Quadratic equation

In mathematics, a quadratic equation is a polynomial equation of the second degree of a polynomial. The general form iswhere a ? 0. The letters a, b, and c are called coefficients: the quadratic coefficient a is the coefficient of x2, the linear coefficient b is the coefficient of x, and c i...
, for example, has two solutions. However, in some cases they are both the same number. Thus the multiset of solutions of the equation could be , or it could be . In the latter case it has a solution of multiplicity 2.

Multiset coefficients

The number of multisets of cardinality k, with elements taken from a finite set of cardinality n, is called the multiset coefficient (the notation is meant to resemble that of binomial coefficient
Binomial coefficient

In mathematics, the binomial coefficient is the coefficient of the x k term in the polynomial expansion of the binomial exponentiation  n....
s, and used for instance in (Stanley, 1997); the symbol could be pronounced "n multichoose k" to resemble "n choose k" for ). Its value can be given explicitly as

where the last two expressions express the multiset coefficient in two ways as a binomial coefficient. So, the number of such multisets is the same as the number of subsets of cardinality k in a set of cardinality n + k − 1.

There are for example 4 multisets of cardinality 3 with elements taken from the set of cardinality 2, namely : , , , . And there are also 20 subsets of cardinality 3 in the set of cardinality 4, namely : , , , , , , , , , , , , , , , , , , , .

One simple way to prove this involves representing multisets in the following way. First, consider the notation for multisets that would represent (6 as, 2 bs, 3 cs, 7 ds) in this form:

This is a multiset of cardinality 18 made of elements of a set of cardinality 4. The number of characters including both dots and vertical lines used in this notation is 18 + 4 − 1. The number of vertical lines is 4 − 1. The number of multisets of cardinality 18 is then the number of ways to arrange the 4 − 1 vertical lines among the 18 + 4 − 1 characters, and is thus the number of subsets of cardinality 4 − 1 in a set of cardinality 18 + 4 − 1. Equivalently, it is the number of ways to arrange the 18 dots among the 18 + 4 − 1 characters, which is the number of subsets of cardinality 18 of a set of cardinality 18 + 4 − 1. This is

so that is the value of the multiset coefficient

One may define a generalized binomial coefficient

in which n is not required to be a nonnegative integer, but may be negative or a non-integer, or a non-real complex number
Complex number

In mathematics, the complex numbers are an extension of the real numbers obtained by adjoining an imaginary unit, denoted i, which satisfies:...
. (If k = 0, then the value of this coefficient is 1 because it is the empty product
Empty product

In mathematics, an empty product, or nullary product, is the result of multiplication no numbers. Its numerical value is 1 , the multiplicative identity element, just as the empty sum—the result of addition no numbers—is 0 , or the additive identity....
.) Then the number of multisets of cardinality k in a set of cardinality n is

This fact led Gian-Carlo Rota
Gian-Carlo Rota

Gian-Carlo Rota was an Italy-born American mathematician and philosopher.He was born in Vigevano, Italy, where he lived until he was 13 years old....
 to ask "Why are negative sets multisets?". He considered that question worthy of the attention of philosophers of mathematics
Philosophy of mathematics

The philosophy of mathematics is the branch of philosophy that studies the philosophical assumptions, foundations, and implications of mathematics....
.

Polynomial notation

The set may be represented by the monomial
Monomial

In mathematics, the word monomial means two different things in the context of polynomials:*The first meaning is a product of powers of variables, or formally any value obtained from 1 by finitely many multiplications by a variable....
 x. The set of subsets, , is represented by the binomial
Binomial

In elementary algebra, a binomial is a polynomial with two terms—the sum of two monomials—often bound by parenthesis or brackets when operated upon....
 1 + x.

The set may be represented by the monomial x·y. The set of subsets, , is represented by the polynomial
Polynomial

In mathematics, a polynomial is an expression constructed from variables and constants, using the operations of addition, subtraction, multiplication, and constant non-negative whole number exponents....
·(1 + y) = 1 + x + y + x·y.

The multiset may be represented by the monomial x·x = x2. The multiset of submultisets, , is represented by the polynomial 2 = 1 + x + x + x·x = 1 + 2·x + x2.

The multiset of submultisets of the multiset xn is That is why the binomial coefficient
Binomial coefficient

In mathematics, the binomial coefficient is the coefficient of the x k term in the polynomial expansion of the binomial exponentiation  n....
 counts the number of k-combination
Combination

In combinatorics, a combination is an un-ordered collection of distinct elements, usually of a prescribed size and taken from a given set. Given such a Set S, a combination of elements of S is just a subset of S, where as always for sets the order of the elements is not taken into account ....
s of an n-set.

The multiset xK·yN−K , containing N elements, K of which are hits, is called a statistical population
Statistical population

In statistics, a statistical population is a Set of entities concerning which statistical inferences are to be drawn, often based on a random sample taken from the population....
, and a submultiset is called a statistical sample. The set of samples is K·(1 + y)N−K

which by the binomial theorem
Binomial theorem

In mathematics, the binomial theorem is an important formula giving the expansion of exponentiation of sums. Its simplest version states that...
 equals

So the number of n-samples with k hits is

See hypergeometric distribution
Hypergeometric distribution

In probability theory and statistics, the hypergeometric distribution is a discrete probability distribution that describes the number of successes in a sequence of n draws from a finite population without replacement, just as the binomial distribution describes the number of successes for draws with replacement....
 and inferential statistics for further on the distribution of hits.

The infinite set of finite multisets of elements taken from the set :
may be represented by the formal power series
Formal power series

In mathematics, formal power series are devices that make it possible to employ much of the mathematical analysis machinery of power series in settings that do not have natural notions of Convergent series....
S = 1 + x + x2 + x3 + ... = 1 + xS .
The formal solution,
S = (1 − x)−1,
makes sense as a set of multisets, but the intermediate result, 1−x, does not make sense as a set of multisets.

The infinite set of finite multisets of elements taken from the set x·y is −1·(1 − y)−1 = 1 + (x + y) + (x2 + x·y + y2) + ...

The special case y=x : The infinite multiset of finite multisets of elements taken from the multiset x2 is −2 =  1 + 2·x + 3·x2 + ... The general case: The infinite multiset of finite multisets of elements taken from the multiset xn is  . This explains why "multisets are negative sets". The negative binomial coefficient
Binomial coefficient

In mathematics, the binomial coefficient is the coefficient of the x k term in the polynomial expansion of the binomial exponentiation  n....
s count the number of k-multisets of elements taken from an n-set.

Cumulant generating function

A non-negative integer, n, can be represented by the monomial xn .

So a finite multiset of non-negative integers, say , can be represented by a polynomial f(x), say f(x) = 3·x2 + x3 + x5 .

It is convenient to consider the cumulant generating function g(t) = log(f(et)), say g(t) = log(3·et + et  + et) .

The cardinality of the multiset is eg(0) = f(1), say 3 + 1 + 1 = 5.

The derivative
Derivative

In calculus, a branch of mathematics, the derivative is a measure of how a function changes as its input changes. Loosely speaking, a derivative can be thought of as how much a quantity is changing at a given point....
 of the g function is g '(t) = f(et)−1·f '(et)·et, say g '(t) = (3·et + et  + et)−1 ·(6·et + 3·et  + 5·et) .

The mean value of the multiset is µ = g '(0) = f(1)−1·f '(1), say µ = (3+1+1)−1·(6+3+5) = 2.8 .

The second derivative of the g function is g ' '(t) .

The variance
Variance

In probability theory and statistics, the variance of a random variable, probability distribution, or sample is one measure of statistical dispersion, averaging the squared distance of its possible values from the expected value ....
 of the multiset is s2 = g ' '(0) .

The numbers ( µ, s2, ··· )  = ( g '(0), g ' '(0), ··· ) are called cumulant
Cumulant

In probability theory and statistics, if a random variable X admits an expected value ? = E and a variance s2 = E, then these are the first two cumulants: ? = ?1 and s2 = ?2....
s, and that's why g is called the cumulant generating function.

The infinite set of non-negative integers is represented by the formal power series
Formal power series

In mathematics, formal power series are devices that make it possible to employ much of the mathematical analysis machinery of power series in settings that do not have natural notions of Convergent series....
 1 + x + x2 + ··· = (1 − x)−1. The mean value and standard deviation are undefined. Nevertheless it has a cumulant-generating function, g(t) = −log(1−et). The derivative of this cumulant-generating function is g '(t) = (et−1)−1.

A finite multiset of real numbers , A = , is represented by the cumulant generating function

This representation is unique: different multisets have different cumulant generating functions. See partition function (statistical mechanics)
Partition function (statistical mechanics)

In statistical mechanics, the partition function Z is an important quantity that encodes the statistics properties of a system in thermodynamic equilibrium....
 for the case where the numbers in question are the energy levels of a physical system.

The cumulant-generating function of a multiset of n real numbers having mean µ and standard deviation s is: g(t) = log(n) + µ·t  + 2−1·(s·t)2 + ··· , and the derivative is simply: g '(t) = µ + s2·t + ···

The cumulant-generating function of set, , consisting of a single real number, k, is g(t) = k·t , and the derivative is the number itself: g '(t) = k . So the concept of the derivative of the cumulant generating function of a multiset of real numbers is a generalization
Generalization

Generalization is a foundational element of logic and reasoning. Generalization posits the existence of a domain or Set theory of elements, as well as one or more common characteristics shared by those elements....
 of the concept of a real number.

The cumulant-generating function of a constant multiset, of n elements all equal to the same real number k, is g(t) = log(n)+k·t , and the derivative is the number itself: g '(t) = k , irrespective of n.

The cumulant-generating function of the multiset of sums of elements of two multisets of numbers is the sum of the two cumulant-generating functions:

There is unfortunately no general formula for computing the cumulant generating function of a product

but the special case of a constant times a multiset of numbers is:

The multiset 2·A =  is not the same multiset as 2×A =A+A = . For example, 2· = while 2× = + = = .

The standard normal distribution is like a limit of big multisets of numbers.

This limit does not make sense as a multiset of numbers, but the derivative of the cumulant generating functions of the multisets in question makes sense, and the limit is well defined.

The constant term k2·log(2) vanishes by differentiation. The terms ··· vanish in the limit. So for the standard normal distribution, having mean 0 and standard deviation
Standard deviation

In statistics, standard deviation is a simple measure of the variability or statistical dispersion of a data set. A low standard deviation indicates that all of the data points are very close to the same value , while high standard deviation indicates that the data are ?spread out? over a large range of values....
 1, the derivative of the cumulant generating function is simply g '(t) = t . For the normal distribution
Normal distribution

The normal distribution, also called the Gaussian distribution, is an important family of continuous probability distributions, applicable in many fields....
 having mean µ and standard deviation s, the derivative of the cumulant generating function is g '(t) = µ + s2·t .

See also random variable
Random variable

In mathematics, random variables are used in the study of Randomness and probability. They were developed to assist in the analysis of Game of chance, stochastic events, and the results of experiment by capturing only the mathematical properties necessary to answer probability questions....
.

Free commutative monoids

There is a connection with the free object
Free object

In mathematics, the idea of a free object is one of the basic concepts of abstract algebra. It is a part of universal algebra, in the sense that it relates to all types of algebraic structure ....
 concept: the free commutative monoid
Monoid

In abstract algebra, a branch of mathematics, a monoid is an algebraic structure with a single, associative binary operation and an identity element....
 on a set X can be taken to be the set of finite multisets with elements drawn from X, with the obvious addition operation. Such monoids are also known as (finite) formal sums of elements of X with natural coefficents. Compare free abelian group
Free abelian group

In abstract algebra, a free abelian group is an abelian group that has a "basis" in the sense that every element of the group can be written in one and only one way as a finite linear combination of elements of the basis, with integer coefficients....
.

Footnotes