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.

## Statistics and probability

### Course: Statistics and probability>Unit 7

Lesson 3: Basic set operations

# Bringing the set operations together

Sal summarizes the set operations that he has discussed in the previous videos. Created by Sal Khan.

## Want to join the conversation?

• Do the set operations have an order of precedence in the same way the operations of arithmetic do. In this example it's not clear to me if you do the union with (B intersect C) before or after the difference from A.
• Yes, if you wanted to write a solver, you would have to define strict ordering or require no ambiguity (by judicious use of parenthesis). Due to unions and intersections, you can't just rewrite all these operations in terms of normal addition and substraction to reveal you have the same commutative properties.

In this case, if you did the union first, you'd get:
`{3, 7, -5, 0, 13} \ {3, 7, -5, 13, 17, *} = {0}`
Which is of course different than `{0, 17, 3, *}`, implying ordering is important.
• As in arithmetic with PEMDAS, is there an order of operations for set operations?
• Well, parentheses come first, and both union and intersection distribute over the parentheses. So:

A ∩ (B U C) = (A ∩ B) U (A ∩ C)
and
A U (B ∩ C) = (A U B) ∩ (A U C)

Depending on what quantities are known, this can often help in calculating probabilities, because it allows us to write what we want to find in different terms, trying to get to terms that we do know. Also, complements have a particular rule:

(A U B)' = A' ∩ B'
and
(A ∩ B)' = A' U B'
The operation changes when you distribute the complement over the parentheses. These two are called De Morgan's Laws.

Now if there were something like: A ∩ (B U C)' . Here you should first take the complement of the parentheses. In this case it turns into an intersection, so there would be no need to more parentheses afterwards: A ∩ (B U C)' = A ∩ B' ∩ C'

But if you had: A ∩ (B ∩ C)' , you should first complement the term in parentheses:

A ∩ (B ∩ C)' = A ∩ (B' U C') = (A ∩ B') U (A ∩ C')
• I think it is interesting that the empty set { } is different from a set containing a zero {0}. It is kind of difficult to wrap my brain around the idea that the very definition of nothing is an object itself. I guess you could call an empty set an "emptier" nothing, but then again, couldn't you have a set that contained an empty set? {{ }} Then even the empty set itself becomes an element. Is there anything that can't become an object?
• The empty set is a very important concept and is very different from {0}. For instance, think about the set of all real numbers x such that x = x+1. There aren't any, right? So that solution set is the empty set. {0} would mean that 0 is a solution to that equation, which is different (and untrue).

And, yes, any mathematical object can be a member of a set, and the empty set is a mathematical object. But realize that {{}} is not the empty set -- it is a set with one element, and that one element is the empty set.
• Just to help make it a bit simpler to understand is A∩B' = A\B ?
• A∩B = A and B
(1 vote)
• Just out of curiosity, what are the practical applications of this math? (I don't really care, I'm just wondering.)
• It's a fundamental part of math and much of it can be expressed through set theory. However, if you're not a mathematician, the most practical benefits of it come in the form of computer software — for example fast route finding for your GPS, sorting and efficient memory structures.
• What is the difference between Equivalent and equal sets?
• Two sets are equivalent when they each contain the same number of elements.
Two sets are equal when all of their elements are identical.

For example, if A = {1,2,3,4}, B = {5,6,7,8}, C = {2,4,3,1}, and D = {4,6,9}, then A, B, and C are equivalent sets (they all contain 4 elements), but only A and C are equal sets (they contain all the same elements).
• If A and B be two finite sets such that the
total number of subsets of A is 960 more
than the total number of subsets of B, then
n(A)−n(B) (where n(X) denotes the
number of elements in set X) is equal to
• Interesting problem!

In general, if a set has m elements, then there are a total of 2^m possible subsets. This is because each element has two possible outcomes: the element either belongs or does not belong to the subset. It then follows from the Fundamental Counting Principle that the total number of subsets is the product of m factors of 2, that is, 2^m.

Now let a = n(A) and b = n(B), with a and b non-negative integers.
Since the total number of subsets of A is 960 more than the total number of subsets of B, we have
2^a = 2^b + 960.

Dividing both sides by 2^a gives 1 = 2^(b-a) + 960/(2^a).

Note that this implies that 2^(b-a) < 1 and 960/(2^a) < 1, since 2^(b-a) > 0 and 960/(2^a) > 0.
Since 2^(b-a) < 1, b-a < 0. Because b and a are integers, b-a <= -1 and so 2^(b-a) <= 1/2.
Therefore, since 1 = 2^(b-a) + 960/(2^a), 960/(2^a) >= 1 - 1/2 = 1/2.
So 1/2 <= 960/(2^a) < 1 which implies that 960 < 2^a <= 1,920.
Note that 2^10 = 1,024, which exceeds 960 but does not exceed 1,920; 2^9 = 512 < 960; and 2^11 = 2,048 > 1,920.
Therefore, since a is an integer and 2^a increases with a, the only solution for a is a = 10.

Substituting a = 10 into the equation 1 = 2^(b-a) + 960/(2^a) gives
1 = 2^(b-a) + 960/(2^10); 2^(b-a) = 1 - 960/1,024 = 64/1,024 = 1/16 = 1/(2^4); b-a = -4.

Therefore, n(A)−n(B) = a-b = -(b-a) = -(-4) = 4. (So n(A) = 10 and n(B) = 6.)

Have a blessed, wonderful day!
• um, if the bracket contains a 0, shouldn't it be a null, since it contains no value? ( sorry for silly doubts :P)