Multisets
We recall that a set is a collection of distinct objects. There are many occasions, however, when we encounter collections of nondistinct objects. For example, consider the names of the students in a class. We might have two or more students who have the same name, and we might wish to talk about the collection of the names of the students. We define a multiset to be a collection of objects that are not necessarily distinct. Thus, {a, a, a, b, b, c}, {a, a, a, a}, {a, b, c}, and { } are examples of multisets. The multiplicity of an element in a multiset is defined to be the number of times the element appears in the multiset. Thus, the multiplicity of the element a in the multiset {a, a, a, c, d, d} is 3. The multiplicity of the element b is 0, the multiplicity if element c is 1, and the multiplicity of the element d is 2. Not that sets are merely special instances of multisets in which the multiplicity of an element is either 0 or 1. The cardinality of a multiset is defined to be the cardinality of the set it corresponds to, assuming that the elements in the multiset are all distinct.
Let P and Q be two multisets. The union of P and Q, denoted P ∪ Q, is a multiset such that the multiplicity of an element in P ∪ Q is equal to the maximum of the multiplicities of the element in P and in Q. thus, for P = {a, a, a, c, d, d} and Q = {a, a, b, c, c}
P ∪ Q = {a, a, a, b, c, c, d, d}
The intersection of P and Q, denoted P ∩ Q, is a multiset such that the multiplicity of an element in P ∩ Q is equal to the multiplicities of the element in P and in Q. Thus, for P = {a, a, a, c, d, d} and Q = {a, a, b, c, c}
P ∩ Q = {a, a, c}
The difference of P and Q, denoted P – Q, is a multiset such that the multiplicity of the element in Q if the difference is positive, and is equal to 0 if the difference is 0 or is negative. For example, let P = {a, a, a, b, b, c, d, d, e} and Q = {a, a, b, b, b, c, c, d, d, f}. We have,
P – Q = {a, e}
Finally we define the sum of two multisets P and Q, denoted P + Q, to be a multiset such that the multiplicity of an element in P + Q is equal to the sum of the multiplicities of the element in P and in Q. note that there is no corresponding definition of the sum of two sets. For example, let P = {a, a, b, c, c} and Q = {a, b, b, d}. We have P + Q = {a, a, a, b, b, b, c, c, d}. As another example, let R be a multiset containing the account numbers of all the transactions on the next day. R and S are multisets because an account might have more than one transaction in a day. Thus, R + S is a combined record of the account numbers of the transactions in these two days.
Services: - Multisets Homework | Multisets Homework Help | Multisets Homework Help Services | Live Multisets Homework Help | Multisets Homework Tutors | Online Multisets Homework Help | Multisets Tutors | Online Multisets Tutors | Multisets Homework Services | Multisets