# Multiset

The bags that can be used for shopping are at bag.

A multiset (sometimes called a bag) is a concept from mathematics. In many ways, multisets are like sets. Certain items are either elements of that multiset, or they are not. However, multisets are different from sets: The same type of item can be in the multiset more than once. For this reason, mathematicians have defined a relation (function) that tells, how many copies of a certain type of item there are in a certain multiset. They call this multiplicity. For example, in the multiset { a, a, b, b, b, c }, the multiplicities of the members a, b, and c are respectively 2, 3, and 1.

A multiset is illustrated by means of a histogram.

A multiset can also be considered an unordered tuple:

• The tuples (a,b) and (b,a) are not equal, and the tuples (a,a) and (a) are not equal either.
• The multisets {a,b} and {b,a} are equal, but the multisets {a,a} and {a} are not equal.
• The sets {a,b} and {b,a} are equal, and the sets {a,a} and {a} are equal too.

## Examples

One of the simplest examples is the multiset of prime factors of a number n. Here the underlying set of elements is the set of prime divisors of n. For example the number 120 has the prime factorisation

$120 = 2^3 3^1 5^1$

which gives the multiset {2, 2, 2, 3, 5}.

Another 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 { 3, 5 }, or it could be { 4, 4 }. In the latter case it has a solution of multiplicity 2.

## References

• Stanley, Richard P. (1997, 1999). Enumerative Combinatorics, Volumes 1 and 2. Cambridge University Press. ISBN 0-521-55309-1, 0-521-56069-1..

This short article about mathematics can be made longer. You can help Wikipedia by .
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 1, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9061154723167419, "perplexity_flag": "middle"}