Multiset.md (605B)
1 # Multiset 2 3 U2.2.5 4 5 **Definition:** A multiset is an unordered collection that can contain multiple instances of the same object. 6 7 Multiset is short for multiple-membership set. 8 9 Example: 10 11 Multiset: 12 13 {a,a,a,b,b} 14 15 Preferred notation: 16 17 {3 x a , 2 x b} 18 19 The number out front that denotes the number of instances is called the multiplicity of the element. As such, a multiplicity of 0 means the element is not contained in the set. 20 21 When unioning two multisets we take the larger of the multiplicities for shared elements. Conversely, the intersection between two multisets is the minimal multiplicity value.