Javatpoint Logo
Javatpoint Logo

Multisets

A multiset is an unordered collection of elements, in which the multiplicity of an element may be one or more than one or zero. The multiplicity of an element is the number of times the element repeated in the multiset. In other words, we can say that an element can appear any number of times in a set.

Example:

Operations on Multisets

1. Union of Multisets: The Union of two multisets A and B is a multiset such that the multiplicity of an element is equal to the maximum of the multiplicity of an element in A and B and is denoted by A ∪ B.

Example:

2. Intersections of Multisets: The intersection of two multisets A and B, is a multiset such that the multiplicity of an element is equal to the minimum of the multiplicity of an element in A and B and is denoted by A ∩ B.

Example:

3. Difference of Multisets: The difference of two multisets A and B, is a multiset such that the multiplicity of an element is equal to the multiplicity of the element in A minus the multiplicity of the element in B if the difference is +ve, and is equal to 0 if the difference is 0 or negative

Example:

4. Sum of Multisets: The sum of two multisets A and B, is a multiset such that the multiplicity of an element is equal to the sum of the multiplicity of an element in A and B

Example:

5. Cardinality of Sets: The cardinality of a multiset is the number of distinct elements in a multiset without considering the multiplicity of an element

Example:

The cardinality of the multiset A is 5.

Ordered Set

It is defined as the ordered collection of distinct objects.

Example:

Ordered Pairs

An Ordered Pair consists of two elements such that one of them is designated as the first member and other as the second member.

(a, b) and (b, a) are two different ordered pair. An ordered triple can also be written regarding an ordered pair as {(a, b) c}

An ordered Quadrable is an ordered pair {(((a, b), c) d)} with the first element as ordered triple.

An ordered n-tuple is an ordered pair where the first component is an ordered (n - 1) tuples, and the nth element is the second component.

Example:

Multisets





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA