5

Does the mathematical definition of a set specify/imply that its elements be unique?


For context, this question has arisen in my mind from my experience using the Python programming language where one of the properties of the 'Set' data structure is that its elements are necessarily unique. Prior to this I had done a maths degree, but don't recall this being highlighted when learning about [mathematical] sets; certainly not with the emphasis it is given in Python.

Moreover, I feel like I came across questions or problems where sets would sometimes have repeated elements (perhaps problems in probability or combinatorics), but I may be mis-remembering this or it may have simply been an abuse of the notation. But an example might be:

What is the probability that the sum of two numbers, one each drawn randomly from the sets $A = \{1, 2, 2, 3, 3, 3\}$ and $B = \{1, 2, 3, 4\}$ is at least 6?

(where the desired answer is 8/24, rather than 3/12)

The Set Theory Wikipedia page does not use the term "unique" or "distinct" in reference to set elements. I came across this Stack Overflow question, but it's obviously geared heavily towards programming, so it's hard to know if that answers are really about the mathematical concept rather than programming data structures. It does mention that a set where repeated elements are allowed is called a Multiset, and in making this distinction, the Wikipedia page for Multiset does assert that a set is only allowed a single instance of an element. But it goes on to say that the term Multiset was only coined in the 1970s, so I'm left wondering what Mathematicians did before then if they wanted collections of objects with duplicates?

Tim
  • 153
  • Yes, because there is no way for you to know how many of a given element are in a set, just whether an element is in a set or not. Hence, regardless or not of whether the element is unique, to you, it will seem unique. – Rushabh Mehta Feb 18 '20 at 22:54
  • To allow for objects with duplicates, we make functions from some indexing set into a set of elements from which we want to build our set. For example, If I want to represent your $A$, I would represent it as a function $A:{1,2,3,4,5,6}\to{1,2,3}$ defined by $$1\mapsto1;;2,3\mapsto2;;4,5,6\mapsto3$$ – Rushabh Mehta Feb 18 '20 at 22:56
  • We don't really use collections with duplicates much, anyways. Functions are far more versatile. – Rushabh Mehta Feb 18 '20 at 22:59
  • Possible duplicate of https://math.stackexchange.com/questions/934378/why-cant-a-set-have-two-elements-of-the-same-value – lhf Feb 18 '20 at 23:01
  • I think the real issue here is that of notation. As I understand it, in very fundamental set theory, you wouldn't write out things in lists in braces like $A={1,2,2,3,3,3}$. Instead, you might say that $A$ is the set for which $1\in A, 2\in A, 3\in A$ and $x\in A\implies x=1$, $x=2$, or $x=3$. We've said that $A$ has as its elements just $1$, $2$, and $3$. But there's no basic logical/ set-theoretic language we could use to specify 'how many times' $1$ or $2$ or $3$ appears in $A$. In fact, at such a basic level the idea of 'how many times' hasn't itself been defined yet. – CardioidAss22 Feb 19 '20 at 00:38

3 Answers3

5

Does the mathematical definition of a set specify/imply that its elements be unique?

Yes.

The Set Theory Wikipedia page does not use the term "unique" or "distinct" in reference to set elements.

No, but it does say this:

"Set theory begins with a fundamental binary relation between an object o and a set A. If o is a member (or element) of A, the notation o ∈ A is used."

I interpret this as: To be an object in the universe is to be unique. For every thing, it is the only thing that is itself and either an object $o$ is a member of a set $A$.... or it isn't.

Now a set has nothing about how order the things or how you pick them out or list them. And if $o$ is in the set $A$, it doesn't matter if when asked to describe the elements of $A$ I mention $o$ first, or last, or $53$rd and if I say "$A$ has $o$ and it has $t$ and $s$ and it has $o$, did I mention $o$ already, and it has $q$ and $z$ and $o$ and $m$ and $o$ and $o$ and, gee I'm mentioning $o$ a lot, and ..." The fact remains either $o$ is in the set or not. Those are the only options.

So if a set is $\{1,2,3,4\}$ that doesn't mean we can't list it as $\{4,3,4,1,2,4\}$. In fact consider $\mathbb Q = \{\frac ab| a,b\in \mathbb Z; b\ne 0\}$. That's perfectly valid but inefficient. Notice we have include then element $\frac 34$ when we consider $\frac 34\in \mathbb Q$ as $3,4\in \mathbb Z$. But we considered it a second time when we considered $-3, -4 \in \mathbb Z$ and $\frac 34 = \frac {-3}{-4}$. And we considered it a third time when we considered $51, 68\in \mathbb Z$.

....

As to consider sets as lists with multiple listings of elements or as listings where order does matter.... well, that is why we have such concepts as multisets or sequences. Even functions is an extension of the concept.

As for a probability problem as you suggest. I imagine must would state it as something like "What is the probability that the sum of two numbers, one each drawn randomly from the collections A={1,2,2,3,3,3} and B={1,2,3,4} is at least 6?" Technically we'd say $A$ is a multiset, not a set.

fleablood
  • 130,341
0

My source is Set Theory and Logic by Robert R. Stoll. The set theory developed by Stoll is what he calls Intuitive Set Theory. Other authors use the designation Naive Set Theory for this foundational field of mathematics. So-called Axiomatic Set Theory is a refinement developed in an effort to remove such problems as Russell's Paradox.

Stoll uses Cantor's original definitions in his development, so I will treat them as mathematically definitive.

Let us consider Cantor's concept of the term set and then analyze briefly its constituent parts. According to his definition, a set $S$ is any collection of definite, distinguishable objects of our intuition or of our intellect to be conceived as a whole. The objects are called the elements or members of $S.\text{ }\dots$ (we shall use both terms synonymously).

The essential point of Cantor's concept is that a collection of objects is to be regarded as a single entity (to be conceived as a whole). The transfer of attention from individual objects to collections of individual objects as entities is commonplace, as evidenced by the presence in our language of such words as "bunch," "covey," "pride," and "flock."

$\dots$

With regard to the objects which may be allowed in a set, the phrase "objects of our intuition or of our intellect" gives considerable freedom.

$\dots$

The remaining key words in Cantor's concept of a set are "distinguishable" and "definite." The intended meaning of the former, as he used it, was this: With regard to any pair of objects qualified to appear as elements of a particular set, one must be able to determine whether they are different or the same. The attribute "definite" is interpreted as meaning that if given a set and an object, it is possible to determine whether the object is, or is not, a member of the set. The implication is that a set is completely determined by its members.

Consider the following natural language definitions:

element (3)noun - an artifact that is one of the individual parts of which a composite entity is made up; especially a part that can be separated from or attached to a system

member noun - anything that belongs to a set or class

0
  1. Sets don't allow repeats and don't impose an ordering. Example: $\{1,2,1\} = \{1,2\} = \{2,1\}$. This is the default. Your math teachers surely mentioned this a few times over the course of any mathematical undergraduate degree.

  2. Multisets do allow repeats but don't impose an ordering. Example: $\{1,2,1\} = \{2,1,1\} \neq \{2,2,1\}$. When you use them, you must always clearly say so to avoid ambiguities with the much, much more common set notation.

  3. Sequences do allow repeats and do impose an ordering. Example: $(1,2,3,2,1) \neq (1,1,2,2,3)$. These are essentially Python lists or tuples. Sometimes they're notated as $\{a_i\}$, which looks like a set but is actually a sequence. It's generally obvious from context what is meant.

  4. Total orders don't allow repeats and do impose an ordering. Example: $1<2<3$.

  • Why post a new answer to an old question with an accepted answer you add nothing to? – Ethan Bolker Jan 09 '25 at 15:35
  • It had been bumped by someone else before me. I found the existing accepted answer a little unfocused. I also mentioned total orders, which was "new". I found your comment unlikely to be constructive. – Joshua P. Swanson Jan 09 '25 at 21:50