Terminology
1.If m occurs in a multiset M at least n times, we can write it as m ∈n M. For example, a ∈2 {a, b, b, a, b} and b ∈3 {a, b, b, a, b}.
2. Multiplicity: The number of times an element occurs in a multiset is called its multiplicity. The multiplicity of an element m∈M is denoted by νM(m).
3.If multiplicities of two sets are the same, they are said to be equivalent multisets.
4.Multiset X is a multisubset of Y if multiplicities of all the elements in X are less than or equal to the multiplicities of those elements in Y. It is denoted by X ⊆ Y.
5.Multiset X is said to be a proper multisubset of Y if X is a multisubset of Y and X ≠ Y. It is denoted by X ⊂ Y.
6.The cardinality of a multiset is the number of elements in it, including every element's multiplicity.
7.Powerset of a multiset P(X) is a set having all multisubsets of X.
8.Universal multiset (U) is a multiset containing all relevant elements with relevant multiplicities.
Operations on Multisets
-
Union of multisets: Union of two multisets X and Y is a multiset where the multiplicity of an element is equal to the maximum multiplicity of an element in X and Y and is denoted by X ∪ Y.
-
Intersection of multisets: The intersection of two multisets X and Y is a multiset where the multiplicity of an element is equal to the minimum multiplicity of an element in X and Y . It is denoted by X ∩ Y.
-
Sum of multisets: The sum of two multisets, X and Y, is a multiset such that the multiplicity of an element is equal to the sum of the multiplicity of an element in X and Y.
- Difference of multisets: The difference of two multisets X−Y is a multiset where the multiplicity of each element is max(νA−νB,0).
FAQs
-
How do you denote a multiset?
A multiset is usually denoted by writing its elements, separated by commas, between curly braces. For example, {m, m, n, o, n}. It can also be denoted by writing the elements and their multiplicities as colon-separated pairs: for example, {m:2,n:2,o:1}, which avoids confusing it with a standard set.
-
What is the difference between a set and multiset?
A set is a collection of well-defined elements, and every element should be unique. The difference between a set and multiset is that multiset allows repetition of elements while set does not.
-
Define multiplicity of a multiset.
The number of times an element occurs in a multiset is called its multiplicity. Multiplicity of an element m ∈ M is denoted by νM(m).
Key Takeaways
In this article, we have extensively discussed Introduction to multisets, its mathematical definition, associated terminologies and operations on multisets. We hope that this blog has helped you enhance your knowledge, and if you wish to learn more, check out our playlist Basic Mathematics. You can also go through our Coding Ninjas Blog site and visit our Library.
Check out this problem - Redundant Braces
Recommended Readings:
Do upvote our blog to help other ninjas grow.
Happy Learning!