Set Operations: Union, Intersection, Difference, Complement, Cartesian Product, Power Set

Set Operations
Intersection: the intersection of two sets A and B, denoted by AB, is the set that contains all elements of A that also belong to BAND
Example: Let D={1,2,3} and E={1,2,4,5},then DE={1,2}

Union: the union of two sets A and B, denoted by AB, is the set of all elements that belong to either A or BOR
Example: Let I={1,2,3} and J={1,2,4,5},then IJ={1,2,3,4,5}

Complement, intersection and union
Let A and B be subsets of a suitable universal set 𝕌.
● The complement A is the set of all elements of 𝕌 that are not in A.
● The intersection AB is the set of all elements belonging to A and to B.
● The union AB is the set of all elements belonging to A or to B.
● In mathematics, the word ’or’ always means ‘and/or’, so all the elements that are in both sets are in the union.
● The sets A and B are called disjoint if they have no elements in common, that is, if AB=∅.

⛲ Example 1
Consider the sets: K={red, green, blue} L={red, yellow, orange} M={red, orange, yellow, green, blue, purple}
①. Find KL
The union contains all the elements in either set: KL={red, green, blue, yellow, orange}
Notice we only list red once.
②. Find KL
The intersection contains all the elements in both sets: KL={red}
③. Find KM
Here we’re looking for all the elements that are not in set K and are also in M.
KM={orange, yellow, purple}

Set Operations
Complement: The complement of a set A is the set of all elements in the universal set NOT contained in A, denoted Ā. Sometimes the complement is denoted as A‘ or A.

[Example] 𝕌={integers from 1 to 10} N={3,6,9},N̄={1,2,4,5,7,8,10} which are all elements from the universal set that are not found in N.

Union: The union of two sets A and B, denoted AB is the set of all elements that are found in A OR B (or both).

Intersection: The intersection of two sets A and B, denoted AB, is the set of all elements found in both A AND B.

We define two sets to be “disjoint” if their intersection is the empty set (this means the two sets have no elements in common).

⛲ Ex2. Suppose O={a,b,c,d,e}, P={d,e,f} and Q={1,2,3}.
①. OP={a,b,c,d,e,f}
②. OP={d,e}
③. OP={a,b,c}
④. PO={f}
⑤. (OP)∪(PO)={a,b,c,f}
⑥. OQ={a,b,c,d,e,1,2,3}
⑦. OQ
⑧. OQ={a,b,c,d,e}
⑨. (OQ)∪(OQ)={a,b,c,d,e}

Union, Intersection, and Complement
Commonly sets interact. For example, you and a new roommate decide to have a house
party, and you both invite your circle of friends. At this party, two sets are being combined, though it might turn out that there are some friends that were in both sets.

Union, Intersection, and Complement
The union of two sets contains all the elements contained in either set (or both sets).
The union is notated AB.
More formally, xAB if xA or xB (or both)
The intersection of two sets contains only the elements that are in both sets.
The intersection is notated AB.
More formally, xAB if x∊A and xB
The complement of a set A contains everything that is not in the set A.
The complement is notated Ā, A‘ or A, or sometimes ¬A.

Grouping symbols can be used like they are with arithmetic – to force an order of operations.
⛲ Ex3. Suppose H={cat, dog, rabbit, mouse}, F={dog, cow, duck, pig, rabbit}
G={duck, rabbit, deer, frog, mouse}
①. Find (HF)⋃G
We start with the intersection: HF={dog, rabbit}
Now we union that result with G: (H⋂F)⋃G={dog, duck, rabbit, deer, frog, mouse}
②. Find H⋂(FG)
We start with the union: FG={dog, cow, rabbit, duck, pig, deer, frog, mouse}
Now we intersect that result with H: H⋂(FG)={dog, rabbit, mouse}
③. Find (HF)G
We start with the intersection: HF={dog, rabbit}
Now we want to find the elements of G that are not in HF
(HF)G={duck, deer, frog, mouse}

Notice that in the example above, it would be hard to just ask for A, since everything from the color fuchsia to puppies and peanut butter are included in the complement of the set. For this reason, complements are usually only used with intersections, or when we have a universal set in place.

We now turn our attention to six fundamental operations on sets. These set operations manipulate a single set or a pair of sets to produce a new set. When applying the first three of these operations, you will want to utilize the close correspondence between the set operations and the connectives of sentential logic.

We now move on to a number of operations on sets. You are already familiar with several operations on numbers such as addition, multiplication, and negation.

[Definition 1] Let A and B be sets.
A denotes the complement of A and consists of all elements not in A, but in some prespecified universe or domain of all possible elements including those in A; symbolically, we define A={x:xA}.
AB denotes the intersection of A and B and consists of the elements in both A and B; symbolically, we define AB={x:xA and xB}.
AB denotes the union of A and B and consists of the elements in A or in B or in both A and B; symbolically, we define AB={x:xA or xB}.
A\B denotes the set difference of A and B and consists of the elements in A that are not in B; symbolically, we define A\B={x:xA and xB}. We often use the identity A\B=AB.
A×B denotes the Cartesian product of A and B and consists of the set of all ordered pairs with first-coordinate in A and second-coordinate in B; symbolically, we define A×B={(a,b) : aA and bB}.
• þ(A) denotes the power set of A and consists of all subsets of A; symbolically, we define þ(A)={x:xA}. Notice that we always have Øϵþ(A)and Aϵþ(A).

⛲ Ex4. We let W={1,2}, X={1,3,5} and Y={n:n is an odd integer}. In addition,we assume that the set of integers ℤ={…,-2,-1,0,1,2,…} is the universe and we identify the elements of the following sets.
W={…,-2,-1,0,3,4,5,…}
Y={n:n is an even integer } by the parity property of the integers
WX={1}, since 1 is the only element in both W and X
WX={1,2,3,5}, since union is defined using the inclusive-or
W\X={2}
X\W={3,5}
• ℤ*=ℤ\{0}={…,-3,-2,-1,1,2,3,…}
W×X={(1,1),(1,3),(l,5),(2,1),(2,3),(2,5)}
• þ(W)={Ø,{1},{2},{1,2}}

Union, Intersection, Difference
Just as numbers are combined with operations such as addition, subtraction and multiplication, there are various operations that can be applied to sets. Here are three new operations called union, intersection and difference.
[Definition 2] Suppose A and B are sets.

The union of A and B is the set AB={x:xA or xB}.
The intersection of A and B is the set AB={ x:xA and xB}.
The difference of A and B is the set AB={ x:xA and x∉B}.

In words, the union AB is the set of all things that are in A or in B (or in both). The intersection AB= is the set of all things in both A and B.

The difference AB is the set of all things that are in A but not in B.

⛲ Ex5. Suppose R={4,3,6,7,1,9}, S={5,6,8,4} and T={5,8,4}. Find:
①. RS={1,3,4,5,6,7,8,9}
②. RS={4,6}
③. RS={3,7,1,9}
④. RT={3,6,7,1,9}
⑤. SR={5,8}
⑥. RT={4}
⑦. ST={5,8,4}
⑧. ST={5,6,8,4}
⑨. TS

Observe that for any sets X and Y it is always true that XY=YX and XY=YX, but in general XYYX.

Continuing the example, parts 12–15 below use the interval notation discussed in the link of

How to Write Subsets of ℝ as Intervals?

, so [2,5]={x∈ℝ :2≤x≤5}, etc.

⛲ Ex6. Sketching these examples on the number line may help you understand them.
①. [2,5]∪[3,6]=[2,6]
②. [2,5]∩[3,6]=[3,5]
③. [2,5]-[3,6]=[2,3)
④. [0,3]-[1,2]=[0,1)∪(2,3]

union intersection difference of two set

Figure 1. (a) sets A and B (b) The union, (c) intersection and (d) difference of sets A and B

⛲ Ex7. Sketch the sets X={(x,y)∈ℝ2:x2+y2≤1} and Y={(x,y)∈ℝ2:x≥1 on ℝ2. On separate drawings, shade in the sets XY, XY, XY and YX.

sketch union intersection difference of two set

RELATED POSTs