- You are here
- Everything Explained.Today
- A-Z Contents
- M
- MU
- MUL
- MULT
- MULTI
- MULTIS
- Multiset

In mathematics, a **multiset** (or **bag**, or **mset**) is a modification of the concept of a set that, unlike a set, allows for multiple instances for each of its elements. The number of instances given for each element is called the **multiplicity** of that element in the multiset. As a consequence, an infinite number of multisets exist which contain only elements and, but vary in the multiplicities of their elements:

- The set contains only elements and, each having multiplicity 1 when is seen as a multiset.
- In the multiset, the element has multiplicity 2, and has multiplicity 1.
- In the multiset, and both have multiplicity 3.

These objects are all different, when viewed as multisets, although they are the same set, since they all consist of the same elements. As with sets, and in contrast to tuples, order does not matter in discriminating multisets, so and denote the same multiset. To distinguish between sets and multisets, a notation that incorporates square brackets is sometimes used: the multiset can be denoted as .^{[1]}

The cardinality of a multiset is constructed by summing up the multiplicities of all its elements. For example, in the multiset the multiplicities of the members,, and are respectively 2, 3, and 1, and therefore the cardinality of this multiset is 6.

Nicolaas Govert de Bruijn coined the word *multiset* in the 1970s, according to Donald Knuth.^{[2]} However, the use of the concept of multisets predates the coinage of the word *multiset* by many centuries. Knuth himself attributes the first study of multisets to the Indian mathematician Bhāskarāchārya, who described permutations of multisets around 1150. Other names have been proposed or used for this concept, including *list*, *bunch*, *bag*, *heap*, *sample*, *weighted set*, *collection*, and *suite*.^{[2]}

Wayne Blizard traced multisets back to the very origin of numbers, arguing that “in ancient times, the number *n* was often represented by a collection of *n* strokes, tally marks, or units.”^{[3]} These and similar collections of objects are multisets, because strokes, tally marks, or units are considered indistinguishable. This shows that people implicitly used multisets even before mathematics emerged.

Practical needs for this structure have caused multisets to be rediscovered several times, appearing in literature under different names.^{[4]} For instance, they were important in early AI languages, such as QA4, where they were referred to as *bags,* a term attributed to Peter Deutsch.^{[5]} A multiset has been also called an aggregate, heap, bunch, sample, weighted set, occurrence set, and fireset (finitely repeated element set).^{[6]}

Although multisets were used implicitly from ancient times, their explicit exploration happened much later. The first known study of multisets is attributed to the Indian mathematician Bhāskarāchārya circa 1150, who described permutations of multisets.^{[2]} The work of Marius Nizolius (1498–1576) contains another early reference to the concept of multisets.^{[7]} Athanasius Kircher found the number of multiset permutations when one element can be repeated.^{[8]} Jean Prestet published a general rule for multiset permutations in 1675.^{[9]} John Wallis explained this rule in more detail in 1685.^{[10]}

Multisets appeared explicitly in the work of Richard Dedekind.^{[11]} ^{[12]}

Other mathematicians formalized multisets and began to study them as precise mathematical structures in the 20th century. For example, Whitney (1933) described *generalized sets* ("sets" whose characteristic functions may take any integer value - positive, negative or zero).^{[13]} Monro (1987) investigated the category **Mul** of multisets and their morphisms, defining a *multiset* as a set with an equivalence relation between elements "of the same *sort*", and a *morphism* between multisets as a function which respects *sorts*. He also introduced a *multinumber*: a function *f*(*x*) from a multiset to the natural numbers, giving the *multiplicity* of element *x* in the multiset. Monro argued that the concepts of multiset and multinumber are often mixed indiscriminately, though both are useful.^{[14]}

One of the simplest and most natural examples is the multiset of prime factors of a natural number . Here the underlying set of elements is the set of prime factors of . For example, the number 120 has the prime factorization

120=2^{3}3^{1}5^{1}

A related example is the multiset of solutions of an algebraic equation. A quadratic equation, 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. More generally, the fundamental theorem of algebra asserts that the complex solutions of a polynomial equation of degree always form a multiset of cardinality .

A special case of the above are the eigenvalues of a matrix, whose multiplicity is usually defined as their multiplicity as roots of the characteristic polynomial. However two other multiplicities are naturally defined for eigenvalues, their multiplicities as roots of the minimal polynomial, and the geometric multiplicity, which is defined as the dimension of the kernel of (where is an eigenvalue of the matrix). These three multiplicities define three multisets of eigenvalues, which may be all different: Let be a matrix in Jordan normal form that has a single eigenvalue. Its multiplicity is, its multiplicity as a root of the minimal polynomial is the size of the largest Jordan block, and its geometric multiplicity is the number of Jordan blocks.

A **multiset** may be formally defined as a 2-tuple where is the *underlying set* of the multiset, formed from its distinct elements, and

*m\colon**A**\to*Z^{+}

Representing the function by its graph (the set of ordered pairs

*\left\{\left(a,**m\left(a\right)\right)**:**a**\in**A\right\}*

If

*A*=*\{a*_{1,}*\ldots,**a*_{n\}}

m(a_{1)} | |

\left\{a | |

1 |

*,*

m(a_{n)} | |

\ldots,a | |

n |

*\right\},*

m(a_{1)} | |

a | |

1 |

…

m(a_{n)} | |

a | |

n |

*,*

where upper indices equal to 1 are omitted. For example, the multiset may be written

*\{a*^{2,b\}}

*a*^{2b.}

A multiset corresponds to an ordinary set if the multiplicity of every element is one (as opposed to some larger positive integer). An indexed family,, where varies over some index-set *I*, may define a multiset, sometimes written . In this view the underlying set of the multiset is given by the image of the family, and the multiplicity of any element is the number of index values such that

*a*_{i}=*x*

It is possible to extend the definition of a multiset by allowing multiplicities of individual elements to be infinite cardinals instead of positive integers, but not all properties carry over to this generalization.

Elements of a multiset are generally taken in a fixed set, sometimes called a *universe*, which is often the set of natural numbers. An element of that does not belong to a given multiset is said to have a multiplicity 0 in this multiset. This extends the multiplicity function of the multiset to a function from to the set

*\N*

This extended multiplicity function is commonly called simply the **multiplicity function**, and suffices for defining multisets when the universe containing the elements has been fixed. This multiplicity function is a generalization of the indicator function of a subset, and shares some properties with it.

The **support** of a multiset

*A*

*m*

*\operatorname{Supp}(A)**:*=*\left\{x**\in**U**\mid**m*_{A}*(x)**>*0*\right\}*

A multiset is *finite* if its support is finite, or, equivalently, if its cardinality

*|A|*=*\sum*_{x\in}*(A)}m*_{A(x)=}*\sum*_{x\in}*m*_{A(x)}

The usual operations of sets may be extended to multisets by using the multiplicity function, in a similar way as using the indicator function for subsets. In the following, and are multisets in a given universe, with multiplicity functions

*m*_{A}

*m*_{B.}

**Inclusion:**is*included*in, denoted, if

*m*_{A(x)}*\le**m*_{B(x) \forall}*x\in**U.*

**Union:**the*union*(called, in some contexts, the*maximum*or*lowest common multiple*) of and is the multiset with multiplicity function^{[15]}

*m*_{C(x)}=max*(m*_{A(x),m}_{B(x)) \forall}*x\in**U.*

**Intersection:**the*intersection*(called, in some contexts, the*infimum*or*greatest common divisor*) of and is the multiset with multiplicity function

*m*_{C(x)}=min*(m*_{A(x),m}_{B(x)) \forall}*x\in**U.*

**Sum:**the*sum*of and is the multiset with multiplicity function

*m*_{C(x)}=*m*_{A(x)}+*m*_{B(x) \forall}*x\in**U.*

It may be viewed as a generalization of the disjoint union of sets. It defines a commutative monoid structure on the finite multisets in a given universe. This monoid is a free commutative monoid, with the universe as a basis.

**Difference:**the*difference*of and is the multiset with multiplicity function

*m*_{C(x)}=max*(m*_{A(x)}-*m*_{B(x),}0*)* *\forall**x\in**U.*

Two multisets are *disjoint* if their supports are disjoint sets. This is equivalent to saying that their intersection is the empty multiset or that their sum equals their union.

There is an inclusion–exclusion principle for finite multisets (similar to the one for sets), stating that a finite union of finite multisets is the difference of two sums of multisets: in the first sum we consider all possible intersections of an odd number of the given multisets, while in the second sum we consider all possible intersections of an even number of the given multisets.

See also: Stars and bars (combinatorics). The number of multisets of cardinality, with elements taken from a finite set of cardinality, is called the **multiset coefficient** or **multiset number**. This number is written by some authors as

style\left({n\choose*k}\right)*

*\tbinom**nk*

The value of multiset coefficients can be given explicitly as

*\left({n\choose**k}\right)*=*{n*+*k*-1*\choose**k}*=

(n+k-1)! | |

k!(n-1)! |

=*{n(n*+1*)(n*+2*)* … *(n*+*k*-1*)\over**k!},*

*\left({n\choose**k}\right)*=*{n*^{\overline{k}

*{n\choose**k}*=*{n*^{\underline{k}

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

One simple way to prove the equality of multiset coefficients and binomial coefficients given above, involves representing multisets in the following way. First, consider the notation for multisets that would represent (6 s, 2 s, 3 s, 7 s) 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

*{*4+18-1*\choose*4-1*}*=*{*4+18-1*\choose*18*}*=1330*,*

\left({4\choose18}\right)={21\choose18}= | 21! |

18!3! |

=*{*21*\choose*3*}*=*\left({*19*\choose*3*}\right),*

= | {\color{red |

ak{ 4 ⋅ 5 ⋅ 6 ⋅ 7 ⋅ 8 ⋅ 9 ⋅ 10 ⋅ 11 ⋅ 12 ⋅ 13 ⋅ 14 ⋅ 15 ⋅ 16 ⋅ 17 ⋅ 18 |

= |
1 ⋅ 2 ⋅ 3 ⋅ 4 ⋅ 5 … 16 ⋅ 17 ⋅ 18 ⋅ 19 ⋅ 20 ⋅ 21 |

1 ⋅ 2 ⋅ 3 ⋅ 4 ⋅ 5 …
16 ⋅ 17 ⋅ 18 x 1 ⋅ 2 ⋅ 3 |

*,*

= | 19 ⋅ 20 ⋅ 21 |

1 ⋅ 2 ⋅ 3 |

*.*

One may define a generalized binomial coefficient

*{n**\choose**k}*=*{n(n*-1*)(n*-2*)* … *(n*-*k*+1*)**\over**k!}*

*\left({n\choose**k}\right)*=*(*-1*)*^{k{-n}*\choose**k}.*

A recurrence relation for multiset coefficients may be given as

*\left({n\choose**k}\right)*=*\left({n\choose**k*-1*}\right)*+*\left({n*-1*\choose**k}\right)* for*n,k>*0

*\left({n**\choose*0*}\right)*=1*,* *n\in\N,* and *\left({*0*\choose**k}\right)*=0*,* *k>*0*.*

The above recurrence may be interpreted as follows.Let :=

*\{*1*,*...*,n\}*

Now, consider the case in which . A multiset of cardinality with elements from might or might not contain any instance of the final element . If it does appear, then by removing once, one is left with a multiset of cardinality of elements from, and every such multiset can arise, which gives a total of

*\left({n\choose**k*-1*}\right)*

If does not appear, then our original multiset is equal to a multiset of cardinality with elements from, of which there are

*\left({n*-1*\choose**k}\right).*

Thus,

*\left({n\choose**k}\right)*=*\left({n\choose**k*-1*}\right)*+*\left({n*-1*\choose**k}\right).*

The generating function of the multiset coefficients is very simple, being

infty | |

\sum | |

d=0 |

*\left({n\choose**d}\right)t*^{d}=

1 | |

(1-t)^{n} |

*.*

*\left({n\choose**d}\right)*

*k[x*_{1,}*\ldots,**x*_{n].}

As

*\left({n\choose**d}\right)*

The multiplicative formula allows the definition of multiset coefficients to be extended by replacing *n* by an arbitrary number *α* (negative, real, complex):

*\left({\alpha\choose**k}\right)*=

\alpha^{\overline} | |

k! |

=

\alpha(\alpha+1)(\alpha+2) … (\alpha+k-1) | |

k(k-1)(k-2) … 1 |

for*k\in\N*andarbitrary*\alpha.
*

With this definition one has a generalization of the negative binomial formula (with one of the variables set to 1), which justifies calling the

*\left({\alpha\choose**k}\right)*

*(*1-*X)*^{-\alpha}=

infty | |

\sum | |

k=0 |

*\left({\alpha\choose**k}\right)**X*^{k.}

This Taylor series formula is valid for all complex numbers *α* and *X* with < 1. It can also be interpreted as an identity of formal power series in *X*, where it actually can serve as definition of arbitrary powers of series with constant coefficient equal to 1; the point is that with this definition all identities hold that one expects for exponentiation, notably

*(*1-*X)*^{-\alpha}*(*1-*X)*^{-\beta}=*(*1-*X)*^{-(\alpha+\beta)} and *((*1-*X)*^{-\alpha}*)*^{-\beta}=*(*1-*X)*^{-(-\alpha\beta)}

If *α* is a nonpositive integer *n*, then all terms with *k* > −*n* are zero, and the infinite series becomes a finite sum. However, for other values of *α*, including positive integers and rational numbers, the series is infinite.

Multisets have various applications. They are becoming fundamental in combinatorics.^{[16]} ^{[17]} ^{[18]} ^{[19]} Multisets have become an important tool in the theory of relational databases, which often uses the synonym *bag*.^{[20]} ^{[21]} ^{[22]} For instance, multisets are often used to implement relations in database systems. In particular, a table (without a primary key) works as a multiset, because it can have multiple identical records. Similarly, SQL operates on multisets and return identical records. For instance, consider "SELECT name from Student". In the case that there are multiple records with name "sara" in the student table, all of them are shown. That means the result set of SQL is a multiset. If it was a set, the repetitive records in the result set were eliminated. Another application of multiset is in modeling multigraphs. In multigraphs there can be multiple edges between any two given vertices. As such, the entity that shows edges is a multiset, and not a set.

There are also other applications. For instance, Richard Rado used multisets as a device to investigate the properties of families of sets. He wrote, "The notion of a set takes no account of multiple occurrence of any one of its members, and yet it is just this kind of information which is frequently of importance. We need only think of the set of roots of a polynomial *f*(*x*) or the spectrum of a linear operator."

Different generalizations of multisets have been introduced, studied and applied to solving problems.

- Real-valued multisets (in which multiplicity of an element can be any real number)
^{[23]}^{[24]}

This seems straightforward, as many definitions for fuzzy sets and multisets are very similar and can be taken over for real-valued multisets by just replacing the value range of the characteristic function ([0, 1] or ℕ = respectively) by ℝ_{0}^{+} = [0, ∞). However, this approach cannot be easily extended for generalized fuzzy sets which use a [[poset]] or lattice instead of a simple degree of membership. Several other approaches for fuzzy multisets have been developed that don't have this restriction.

- Fuzzy multisets
^{[25]} - Rough multisets
^{[26]} - Hybrid sets
^{[27]} - Multisets whose multiplicity is any real-valued step function
^{[28]} - Soft multisets
^{[29]} - Soft fuzzy multisets
^{[30]} - Named sets (unification of all generalizations of sets)
^{[31]}^{[32]}^{[33]}^{[34]}

- Frequency (statistics) as multiplicity analog
- Quasi-sets
- Set theory

- Book: Hein, James L.. Discrete mathematics. limited. Jones & Bartlett Publishers. 2003. 0-7637-2210-3. 29–30.
- Book: Knuth , Donald E. . Donald Knuth . . 2 . Seminumerical Algorithms . . 1998 . 3rd . 0-201-89684-2 .
- Blizard. Wayne D. 1989. Multiset theory. Notre Dame Journal of Formal Logic. 30. 1. 36–66. 10.1305/ndjfl/1093634995. free.
- Blizard. Wayne D.. 1991. The Development of Multiset Theory. Modern Logic. 1. 4. 319–352.
- Rulifson. J. F.. Derkson. J. A.. Waldinger. R. J.. November 1972. SRI International. QA4: A Procedural Calculus for Intuitive Reasoning. 73.
- Singh. D.. Ibrahim. A. M.. Yohanna. T.. Singh. J. N.. 2007. An overview of the applications of multisets. Novi Sad Journal of Mathematics. 37. 2. 73–92.
- Angelelli. I.. 1965. Leibniz's misunderstanding of Nizolius' notion of 'multitudo'. Notre Dame Journal of Formal Logic. 6. 319–322.
- Book: Kircher, Athanasius. Athanasius Kircher. 1650. Musurgia Universalis. Corbelletti. Rome.
- Book: Prestet, Jean. 1675. Elemens des Mathematiques. André Pralard. Paris.
- Book: Wallis, John. John Wallis. 1685. A treatise of algebra. John Playford. London.
- Book: Dedekind, Richard. Richard Dedekind. 1888. Was sind und was sollen die Zahlen?. Vieweg. Braunschweig.
- Book: Syropoulos, Apostolos. 2001. Mathematics of Multisets. C. S.. Calude. Multiset processing: Mathematical, computer science, and molecular computing points of view. Springer-Verlag. 347 - 358. etal.
- Whitney . H. . Characteristic Functions and the Algebra of Logic . Annals of Mathematics . 1933 . 34 . 405–414 . 10.2307/1968168.
- Monro . G. P. . The Concept of Multiset . Zeitschrift für Mathematische Logik und Grundlagen der Mathematik . 1987 . 33 . 171–178 . 10.1002/malq.19870330212.
- Syropoulos . Apostolos . Mathematics of Multisets . Lecture Notes in Computer Science . 2000 . 2235 . 347--358 . 10.1007/3-540-45523-X_17 . 16 February 2021.
- Book: Aigner, M.. 1979. Combinatorial Theory. Springer Verlag. New York/Berlin.
- Book: Anderson, I.. 1987. Combinatorics of Finite Sets. registration. Clarendon Press. Oxford.
- Book: Stanley, Richard P.. Richard P. Stanley. 1997. Enumerative Combinatorics. 1. Cambridge University Press. 0-521-55309-1.
- Book: Stanley, Richard P.. 1999. Enumerative Combinatorics. 2. Cambridge University Press. 0-521-56069-1.
- Grumbach. S.. Milo. T. 1996. Towards tractable algebras for bags. Journal of Computer and System Sciences. 52. 3. 570–588. 10.1006/jcss.1996.0042. free.
- Book: Libkin, L.. Wong. L.. 1994. Some properties of query languages for bags. Proceedings of the Workshop on Database Programming Languages. Springer Verlag. 97–114.
- Libkin. L.. Wong. L.. 1995. On representation and querying incomplete information in databases with bags. Information Processing Letters. 56. 4. 209–214. 10.1016/0020-0190(95)00154-5.
- Blizard. Wayne D.. 1989. Real-valued Multisets and Fuzzy Sets. Fuzzy Sets and Systems. 33. 77–97. 10.1016/0165-0114(89)90218-2.
- Blizard. Wayne D.. 1990. Negative Membership. Notre Dame Journal of Formal Logic. 31. 1. 346–368.
- Yager. R. R.. 1986. On the Theory of Bags. International Journal of General Systems. 13. 23–37. 10.1080/03081078608934952.
- Book: Grzymala-Busse, J.. 1987. Learning from examples based on rough multisets. Proceedings of the 2nd International Symposium on Methodologies for Intelligent Systems. Charlotte, North Carolina. 325–332.
- Loeb. D.. 1992. Sets with a negative numbers of elements. Advances in Mathematics. 91. 64–74. 10.1016/0001-8708(92)90011-9. free.
- Miyamoto. S.. 2001. Fuzzy Multisets and their Generalizations. Multiset Processing. 2235. 225–235.
- Alkhazaleh. S.. Salleh. A. R.. Hassan. N.. 2011. Soft Multisets Theory. Applied Mathematical Sciences. 5. 72. 3561–3573.
- Alkhazaleh. S.. Salleh. A. R.. 2012. Fuzzy Soft Multiset Theory. Abstract and Applied Analysis.
- Book: Burgin, Mark. 1990. Theory of Named Sets as a Foundational Basis for Mathematics. Structures in Mathematical Theories. San Sebastian. 417–420. http://www.blogg.org/blog-30140-date-2005-10-26.html.
- Burgin. Mark. 1992. On the concept of a multiset in cybernetics. Cybernetics and System Analysis. 3. 165–167.
- Burgin. Mark. 2004. Unified Foundations of Mathematics. math/0403186.
- Book: Burgin, Mark. 2011. Theory of Named Sets. Mathematics Research Developments. Nova Science Pub Inc. 978-1-61122-788-8.