Regarding the Complement function, I am trying to understand if I found an error or a misunderstanding of how the function is supposed to work.
Definition from MM documentation:
Complement[M,N1,N2,
]
gives the elements in the list M that are not in any of the lists N.
Here is an example:
Complement[{a, a, a, b, c}, {c,t}]
MM documentation says that the result should show those elements of the first set that are not in the second set. My read of this is that a, a, a, b are not in the second set. However, MM collapses the identical elements to a single element. In other words, MM seems to look at distinct elements.
So based on the documentation, I thought the result should be:
Complement[{a, a, a, b, c}, {c,t}] = {a,a,a,b}
but MM gives:
Complement[{a, a, a, b, c}, {c,t}] = {a,b}
Regardless of which is right or wrong, I'd like to suggest the following. If the function is kept as is, then the definition should be clarified to indicate that only distinct elements are considered. Written the way it is, it can easily be interpreted as ALL elements.
Thanks,
Jeff