# Set Theory Questions - Member of vs. Subset of

**URL:** <https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269>\
**Category:** Factual Questions\
**Created:** [October 29, 2012, 11:02pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269 "2012-10-29T23:02:07Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [October 30, 2012, 7:41pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/21 "2012-10-30T19:41:56Z")

</div>

> [@Senegoid](#):
>
> Well, if OP read Post #9 he might be able to figure that out.

I’m sorry, I’m having trouble understanding what the point of this statement was.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 7:51pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/22 "2012-10-30T19:51:35Z")

</div>

> [@Frylock](#):
>
> I’m sorry, I’m having trouble understanding what the point of this statement was.

Only that your post repeated substantially just what Post #9 said, even to the extent of asking the question

> [@](#):
>
> Take the set Q = {{a, b}, c}.
> 
> Here’s a question. How many members does Q have?

after Post #9 explicitly raised (and answered, with additional discussion) a similar question for the OP’s consideration:

> [@](#):
>
> A = { x, y }  
> B = { a, b, c, { x, y } } or equivalently B = { a, b, c, A }
> 
> \<snip\>
> 
> Question: What is the size of set B? That is, how many elements does it have?  
> Answer: 4 elements, namely: a, b, c, and { x, y } where { x, y } counts as just one member of B.

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [October 30, 2012, 7:52pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/23 "2012-10-30T19:52:32Z")

</div>

Maybe this will help, maybe this will just be gibberish –

A SET is made up of MEMBERS, we’ll represent members as capital letters:

{A,B,C,D}

I think you’ll agree that those four members can be anything you want, right? It could be {1,2,3,4}, it could be {a,b,c,d}, it could be {fish,cat,dog,gorilla}. The set can also (in principle though rarely in practice) be mixed, {fish, cat, a, 1}. Well, a SET can also be a MEMBER\*.

If you want to understand what’s going on – after the first curly brace, STOP. From now on, replace everything in the set with a capital letter that stands in for whatever was there. If you see another pair of curly braces inside your first set, it doesn’t matter, replace that whole expression from start to end brace with a letter.

{{1,2},1,2,3} -\> {A,B,C,D}. What’s A? A={1,2}, B={1}, C={2}. D={3}. When determining equality, all that matters is that the second set also has {A,B,C,D} (in any order). If it’s a subset, it has any combination of A,B,C or D in it. Again, we don’t care what TYPE of thing, A, B, C, or D are, just that they’re the same.

If you see { {a,{c,{d,e}}}, e, f}, that’s just the set {A,B,C}. Sure, A equals the really obnoxious set {a,{c,{d,e}}}, but that doesn’t matter.

For membership, A ∈ SET if, not matter what A equals, that thing is also in the set. If A = {b,c}, then the set might be something like {{b,c},d,e}-\>{A,B,C}.

- In a nice tongue-twisty turn of fate, this means that the set of all sets is a subset of the set MEMBERS.

ETA: I should mention that there’s no **magical** distinction between a and {a} – it’s a notational convention. It’s a convention that unlike SOME things is rather intuitive to the majority of people, but if you really don’t see the difference intuitively or logically, you might just have to resign yourself to accepting that they’re different because we define them as different.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [October 30, 2012, 7:59pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/24 "2012-10-30T19:59:07Z")

</div>

> [@Omniscient](#):
>
> Trying to translate user stories in technical specs. It’s a programming problem, basically. The end user inputs a set of values and those values are compared to another set of values defined by the admin. The admin defines the operator used to compare those sets changing when the output is true or false.
> 
> The simplest and most common case is 2 values, equals versus not equals. This case I’m struggling with is when the input and the comparison are a set of choices instead of 1 value, and I need to understand the different set operators that can be used and how they’ll evaluate predictably for the many different possibilities.

We’ve been trying to answer your question about set theory as it’s used in mathematics, but now I’m wondering if your questions are really more about implementation: how sets are treated in the particular programming language or context you’re working with.

From the OP:

> [@Omniscient](#):
>
> If you want to create a formula where A is {a, b, c, d, g, i} and B = {c} it’s evaluated as true when A is selected (left side) and B is the comparison (right side) is there a better way to do this than just reversing the set operator symbols? Also what happens when A is {a, b, c, d, g, i} and B = {c, h}? Is there a operator for that to be true?

I don’t know whether this is what you’re looking for or not, but in case it’s any help:

You might want to try looking at the intersection of A and B (A ∩ B). If you want to see whether A and B have any elements in common, you just check whether or not their intersection is empty. If you want to see whether the one or more elements that comprise B are _all_ in A (i.e. whether B is a subset of A), you could check whether B = A ∩ B.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 8:02pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/25 "2012-10-30T20:02:01Z")

</div>

> [@Omniscient](#):
>
> I’ll wait until you read the above description before responding here, I think that may get the point across. The main issue is that we don’t have the flexibility to change which side of the equation the user input set and the admin defined comparison set are on, so properly explaining the function is trickier.

It’s still a bit unclear what problem you’re trying to solve here. But it sounds like you’re working with some formal language with rules not of your own making, that you must conform to.

The best guess I can think of so far is the notion and symbolism of “supersets”, as noted in Post #10 above, which puts the “larger” set on the left-hand-side and the “smaller” set on the right-hand-side – perhaps amended to use **Jragon** ’s suggestion (Post #15) that we should speak of “improper subsets” and “improper supersets” (and use their symbols) instead.

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [October 30, 2012, 8:02pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/26 "2012-10-30T20:02:04Z")

</div>

> [@Omniscient](#):
>
> Basically you’re saying {a} AND {b} is not the same thing as {a, b}. So {{a, b}, c} is different than {a, b, c}. Can you explain why this is because it isn’t registering with me.

That’s right–{a} and {b} is not the same thing as {a, b}.

The expression “{a} and {b}” refers to two sets–the set containing only a as a member, and the set containing only b as a member–while the expression “{a, b}” refers to only one set–the set containing both (and only) a and b as members.

There are a couple of common mistakes I can imagine might have led you to think “{a} and {b} is the same as {a, b}.”

One is, you may have been thinking that “{a}” and “a” refer to the same thing. But they don’t. One refers to a, the other refers to a set containing a.

Another one is, (though this is less likely, and also harder to explain,) you may have been thinking of “and” as in some way concatenating things into sets–so that the expression “P AND Q” can be interpreted to mean “the set containing P and Q.” But that, too, is not generally true. (I can think of contexts where the prior expression could be used to mean the latter one, but there is no general equivalence.)

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [October 30, 2012, 8:04pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/27 "2012-10-30T20:04:31Z")

</div>

> [@Senegoid](#):
>
> Only that your post repeated substantially just what Post #9 said, even to the extent of asking the question  
> after Post #9 explicitly raised (and answered, with additional discussion) a similar question for the OP’s consideration:

Okay. I believed my post had a chance at getting to the “heart” of the misunderstanding in simpler terms, and therefore believed it appropriate to post it even though it did, as you point out and as I was aware, repeat the concepts in some of the other posts.

If you felt somehow ignored or slighted, please know it wasn’t my intention. Perhaps an asterisk and a note “ **Senegoid** has said substantially the same thing in the following quotation from post #9” would have been in order. I’ll try to remember to give that some thought in future posts.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 8:04pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/28 "2012-10-30T20:04:42Z")

</div>

> [@Jragon](#):
>
> I think you’ll agree that those four members can be anything you want, right? It could be {1,2,3,4}, it could be {a,b,c,d}, it could be {fish,cat,dog,gorilla}. The set can also (in principle though rarely in practice) be mixed, {fish, cat, a, 1}. Well, a SET can also be a MEMBER\*.

Q: What set is a gorilla a member of?

A: Any set he wants to be a member of.

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [October 30, 2012, 8:09pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/29 "2012-10-30T20:09:49Z")

</div>

> [@Jragon](#):
>
> {{1,2},1,2,3} -\> {A,B,C,D}. What’s A? A={1,2}, B={1}, C={2}. D={3}.

Oh shit :smack:, I failed HARD here. A={1,2}, B=1, C=2, D=3. I just accidentally reinforced your confusion with that mistake.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 8:14pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/30 "2012-10-30T20:14:17Z")

</div>

> [@Frylock](#):
>
> There are a couple of common mistakes I can imagine might have led you to think “{a} and {b} is the same as {a, b}.”
> 
> One is, you may have been thinking that “{a}” and “a” refer to the same thing. But they don’t. One refers to a, the other refers to a set containing a.

It’s starting to become (vaguely) clear that OP is dealing with some kind of programming language and/or data entry specification that OP himself doesn’t have control of.

Here, it becomes unclear just what distinction there might be between a, b, {a}, {b}, and {a, b}. I think there are some languages that don’t make clear distinctions in the same way that formal mathematical set theory does. Maybe there is some confusion over that, and even in the absence of confusion, there may be confusion about how some language will deal.

I vaguely feel that I recall noticing some sloppy usage in some language, but I can’t recall off-hand what the language was (JavaScript or PHP maybe, two languages about as sloppy as any you’ll find), nor what the details were.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 8:17pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/31 "2012-10-30T20:17:07Z")

</div>

> [@Jragon](#):
>
> Oh shit :smack:, I failed HARD here. A={1,2}, B=1, C=2, D=3. I just accidentally reinforced your confusion with that mistake.

Thank you for catching this yourself before someone else had to do it for you 😃

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 8:21pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/32 "2012-10-30T20:21:53Z")

</div>

[Terrible terrible thread jack warning!]Let X = the set of all sets. Does X contain itself?  
Let Y = the powerset of X. Does Y contain itself? Does Y contain X? Does X contain Y?  
Don’t try to enter this into a computer at home, kids.  
[/Terrible terrible thread jack warning!]

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [October 30, 2012, 8:30pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/33 "2012-10-30T20:30:15Z")

</div>

> [@Senegoid](#):
>
> Let Y = the powerset of X. Does Y contain itself? Does Y contain X? Does X contain Y?

No. Yes. No.

Whatever paradox you were aiming for here, you missed it.

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [October 30, 2012, 8:34pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/34 "2012-10-30T20:34:52Z")

</div>

> [@ultrafilter](#):
>
> No. Yes. No.
> 
> Whatever paradox you were aiming for here, you missed it.

I agree Y trivially contains X, but if X is the set of all sets, then naturally P(X) is included in that list, no?

ETA: And Y would contain itself, since X is the set of all sets, and there is some combination of sets that make up Y, then naturally that combination of sets must occur in X and show up in its power set.

The tricky “no” question is whether every set is a subset of X. The answer, of course, is no, because not every set is made up of sets and X’s domain is only sets.

---

<div class="post-metadata">

**Author:** ![Trinopus](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@Trinopus](https://boards.straightdope.com/u/Trinopus)\
**Post date:** [October 30, 2012, 8:45pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/35 "2012-10-30T20:45:49Z")

</div>

An improper subset puts its feet up on the coffee table and smokes cigars without an ash-tray.

(Next: “degenerate triangles.”)

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 8:58pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/36 "2012-10-30T20:58:00Z")

</div>

> [@Jragon](#):
>
> The tricky “no” question is whether every set is a subset of X. The answer, of course, is no, because not every set is made up of sets and X’s domain is only sets.

(Where X was defined as the set of all sets.)

Right, and this goes back directly to the OP’s original questions!

A set containing anything other than a set as a member (example: { 1, 2 } ), is not a _subset_ of X, but is a _member_ of X.

And another member of X may include the set { 1, 2 } as a member. Thus, while { 1, 2 } is not a subset of X, it may be a subset of a member of X. Or it could be a member of a subset of X. Or it could be a subset of a subset of X. Or it could be a member of a member of X.

ETA: The set of all sets is a big tent!

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [October 30, 2012, 9:13pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/37 "2012-10-30T21:13:42Z")

</div>

> [@Senegoid](#):
>
> hus, while { 1, 2 } is not a subset of X, it may be a subset of a member of X. Or it could be a member of a subset of X. Or it could be a subset of a subset of X. Or it could be a member of a member of X.

Not **could be** , **is**. The set of all sets contains the set of all possible set members (which is actually a superset of the set of all sets). Any set you care to dream up will necessarily be a subset of that particular member of the set of all sets.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 9:22pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/38 "2012-10-30T21:22:35Z")

</div>

> [@Omniscient](#):
>
> If you want to create a formula where A is {a, b, c, d, g, i} and B = {c} it’s evaluated as true when A is selected (left side) and B is the comparison (right side) is there a better way to do this than just reversing the set operator symbols? Also what happens when A is {a, b, c, d, g, i} and B = {c, h}? Is there a operator for that to be true?

Okay, let’s try to help out the poor OP already.

Are you writing a program or script in some programming language? Or are you trying to figure out how to enter data into an existing program using some data syntax rules?

Taking your question at face value here, it looks like the formula you want, with A (the “big” set) on the left and B (the “little” set) on the right, might be: A ⊇ B

But it’s not entirely clear from your OP just what question you are asking.

In the example: A = {a, b, c, d, g, i}, B = {c}, is B necessarily just a one-item set (being treated as a single item)? Are you asking: Is the single item c a member of the set A? (Even if your data syntax requires B to be entered as a set instead of as a single non-set item?)

Or can the set B contain multiple items, as in: A = {a, b, c, d, g, i}, B = {b, d}  
and if so, is the question:  
---- Is EVERY member of B also in A?  
or is the question:  
---- Is ANY member of B also in A?

From your other example: A = {a, b, c, d, g, i}, B = {c, h} it looks like you envision that B (the “smaller” set) could in fact be a set of multiple items, not just one item. Then my question just above is relevant: Are you asking if EVERY member of B is in A, or are you asking if ANY member of B is in A?

If this involves a programming language, what language are you using? What set operations does it contain? Does your language contain sets as a data type (or, does it have arrays that can be treated as sets)? Does it contain set-relational operators that take two sets as their operands and returns TRUE or FALSE? Specifically, can you write an expression like A ⊂ B (where A and B are sets) to get a TRUE or FALSE result? Do you also have the other set-relational operators like ⊃ (superset of), ⊆ (improper subset of, meaning subset of or same set as), ⊇ (improper superset of, meaning superset of or same set as).

Do you have set operators that let you do things like **Thudlow Boink** suggested above, like these?

> [@](#):
>
> You might want to try looking at the intersection of A and B (A ∩ B). If you want to see whether A and B have any elements in common, you just check whether or not their intersection is empty. If you want to see whether the one or more elements that comprise B are all in A (i.e. whether B is a subset of A), you could check whether B = A ∩ B.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 30, 2012, 9:26pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/39 "2012-10-30T21:26:01Z")

</div>

Or, taking a hint from these remarks:

> [@](#):
>
> And if you were to do all these things using plain English instead of the special characters what would be language be to be mathematically/programmatic accurate?

> [@](#):
>
> Trying to translate user stories in technical specs. It’s a programming problem, basically. The end user inputs a set of values and those values are compared to another set of values defined by the admin. The admin defines the operator used to compare those sets changing when the output is true or false.

are you not doing programming at all, but simply trying to learn how to discuss this in plain English with other people?

ETA: And, seeing that this conversation is active _right now_, I must respectfully excuse myself to go run some errands now, before the bank closes. Back later.

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [October 30, 2012, 9:28pm UTC](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269/40 "2012-10-30T21:28:39Z")

</div>

> [@Senegoid](#):
>
> Or, taking a hint from these remarks:
> 
> are you not doing programming at all, but simply trying to learn how to discuss this in plain English with other people?

It seems more like he’s going the other way – a customer has something they want done and the OP is trying to make a formal spec for the software developers.

[Previous page](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269.md?page=1)

[Next page](https://boards.straightdope.com/t/set-theory-questions-member-of-vs-subset-of/639269.md?page=3)
