Suppose I have two sets, A and B:
A={1,2,3,4,5}B={1,1,2,3,4}
Set A is valid, but set B isn’t because not all of its elements are unique. My question is, why can’t sets contain duplicate elements?
Answer
The short, perhaps unsatisfying answer is, because that is how they are defined. The long answer is that, in most cases, that is what is useful.
For other cases, there is also a theory built around multisets, which are like sets except they allow multiplicity.
Attribution
Source : Link , Question Author : Ethan Bierlein , Answer Author : TobiMcNamobi