Let A = {l, m, m, m, n, n, n, p, p, p} and B = {l, l, m, n, n, n, p, r, r}, find the operations of the following multisets:
A. A + B
B. A - B
C. A U B
D. A ∩ B
A. 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
"=\\{l,l,l,m,m,m,m,n,n,n,n,n,n,p,p,p,p,r,r\\}"
B. 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 positive, and is equal to 0 if the difference is 0 or negative
"=\\{m,m,p,p\\}"
C. 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
"=\\{l,l,m,m,m,n,n,n,p,p,p,r,r\\}"
D. 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
"=\\{l,m,n,n,n,p\\}"
Comments
Leave a comment