If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: Statistics and probability>Unit 7

Lesson 3: Basic set operations

# Relative complement or difference between sets

Sal shows an example finding the relative complement or difference of two sets A and B. Created by Sal Khan.

## Want to join the conversation?

• Could you add, divide and/or multiply sets?
• Great question! Actually, there are operations you can do with sets that are similar to the operations of multiplication, division, etc. that you do with numbers. However, that is all pretty advanced stuff--you probably won't learn about them until at least high school (if not college). Nevertheless, these operations do exist (and they have fancy names like Minkowski Addition, Product Sets, & Quotient Sets, to name a few).

If you're still interested, here's an example of an operation on two sets to get you thinking about the concept:
Let's say you have two sets, A & B
A = {a, b, c}
B = {2, 7}

Then the Cartesian Product of A and B (written as "A x B") is the set:

A x B = { (a,2), (a,7), (b,2), (b,7), (c,2), (c,7)},

where each element of the set is an ordered pair of elements. Thus, while "7" is a single element of the set B, the letter/number pair "(c,2)" is a single element of the set "A x B". Also, note that while "(c,2)" is an element of "A x B", "(2,c)" is NOT an element of "A x B" because order matters.

Anyway, there's a lot more to be said about these set operations but I don't want to bore you. I hope you found this interesting! (And not too confusing!!)
• EDIT: Can we even have the same object more than once in a set?
At Sal says "take out the 17, 19, and 6s". So does that mean that if there were two 17s in set A, but only one in set B, would you take out both or only one 17? Do you remove all of what is in set A from set B, or only how many items are in set A from set B? (I can clarify my question if needed)
Example:
Set C={1, 2 , 2 ,5,12, 33 ,chicken, 33 }
Set D={ 2 ,pizza, 33 }
When you take C-D, is it (paying attention to the 2 s and 33 s)
C-D={1, 2 ,5,12,chicken, 33 } (we subtracted one 2 & 33 from set C because there was only one 2 & 33 in set D)
OR
C-D={1,5,12,chicken} (we subtracted all 2 s & 33 s from set C because there is at least one 2 & 33 in set D)
Which way is correct?

Thanks!
• Very good question! Set's can't have duplicate elements, so even though set C is listed as C={1, 2 , 2 ,5,12, 33 ,chicken, 33 }, it would be simplified to C={1, 2, 5,12, 33, chicken }
• As per the video, is there any difference between A-B and A-A∩B ?
• Nope, they both would be [5,3,12].
(1 vote)
• Does it matter in what order species appear in sets?

For example is A = {5, 24, 6, 7}
the same as set B = {24, 7, 6, 5} or would you treat them as different sets?

• Yes, you must treat them as different sets. In this case, each set is given a different name. The first is A, the second is B. Even though the ORDER of the items in a set does not matter, the NAME does. So, by giving these sets two different names, you have created two different, distinct sets. You must treat them as such. Hope this helps!
• If A-B = ø then A=B is this true or false
• Counterexample:
Let A = ø and B = {x}.
"A - B = ø" = True
"A = B" = False
"If A - B = ø, then A = B"
= "If True, then False"
= False

Therefore, the statement is false.
• At / before, does the 6 float off to space?
• That's not a mistake. If we subtract set B from set A, (A-B) all we have to do is remove all elements which are in both sets from set A. 6 is only in set B and not in set A. That's why 6 isn't in the set A-B. Does that answer your question?
• Since A\B = {5, 3, 12}, can I use a notation like this?

A'

Would the notation above do the same thing? Or do I need a universal set in order to use that notation? I've learned that notation from my teacher.
• The first notation means everything in A but not in B.
The second notation means everything not in A.

Regardless of a universal set, these are not the same thing.

And you really can't not have a universal set. Even if it's not stated explicitly, a universal set is probably implied.
• PLEASE dont laugh at my ignorance............as far as i know SET IS A COLLECTION OF WELL DEFINED OBJECTS.... What is the well defined object in the null/empty set? How can we call a set an "EMPTY SET"?
• It is well defined as containing nothing.
Sure that idea is abstract, but not any more than understanding the value of 0 (something mathematicians did not for many generations).
• Null is different than zerro right?