**Set Operations**

● **Intersection**: the intersection of two sets *A* and *B*, denoted by *A*∩*B*, is the set that contains all elements of *A* that also belong to *B*⇒ **AND**

Example: Let *D*={1,2,3} and *E*={1,2,4,5},then *D*∩*E*={1,2}

● **Union**: the union of two sets *A* and *B*, denoted by *A*∪*B*, is the set of all elements that belong to either *A* or *B*⇒ **OR**

Example: Let *I*={1,2,3} and *J*={1,2,4,5},then *I*∪*J*={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 *A*∩*B* is the set of all elements belonging to *A* and to *B*.

● The union *A*∪*B* 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 *A*∩*B*=∅.

⛲ Example 1

Consider the sets: *K*={red, green, blue} *L*={red, yellow, orange} *M*={red, orange, yellow, green, blue, purple}

①. Find *K*⋃*L*

The union contains all the elements in either set: *K*⋃*L*={red, green, blue, yellow, orange}

Notice we only list red once.

②. Find *K*⋂*L*

The intersection contains all the elements in both sets: *K*⋂*L*={red}

③. Find *K*^{∁}⋂*M*

Here we’re looking for all the elements that are not in set *K* and are also in *M*.

*K*^{∁}⋂*M*={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 *A*∪*B* 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 *A*∩*B*, 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}.

①. *O*∪*P*={a,b,c,d,e,f}

②. *O*∩*P*={d,e}

③. *O*–*P*={a,b,c}

④. *P*–*O*={f}

⑤. (*O*–*P*)∪(*P*–*O*)={a,b,c,f}

⑥. *O*∪*Q*={a,b,c,d,e,1,2,3}

⑦. *O*∩*Q*=Ø

⑧. *O*–*Q*={a,b,c,d,e}

⑨. (*O*∩*Q*)∪(*O*–*Q*)={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 notatedA⋃B.

More formally,x∊A⋃Bifx∊Aorx∊B(or both)

The intersection of two sets contains only the elements that are in both sets.

The intersection is notatedA∩B.

More formally,x∊A⋂Bif x∊Aandx∊B

The complement of a setAcontains everything that is not in the setA.

The complement is notated Ā,A‘ orA^{∁}, 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 (*H*⋂*F*)⋃*G*

We start with the intersection: *H*⋂*F*={dog, rabbit}

Now we union that result with *G*: (H⋂F)⋃*G*={dog, duck, rabbit, deer, frog, mouse}

②. Find *H*⋂(*F*⋃*G*)

We start with the union: *F*⋃*G*={dog, cow, rabbit, duck, pig, deer, frog, mouse}

Now we intersect that result with *H*: *H*⋂(*F*⋃*G*)={dog, rabbit, mouse}

③. Find (*H*⋂*F*)^{∁}⋂*G*

We start with the intersection: *H*⋂*F*={dog, rabbit}

Now we want to find the elements of *G* that are not in *H*⋂*F*

(*H*⋂*F*)^{∁}⋂*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*:*x*∉*A*}.

• *A*∩*B* denotes the **intersection** of *A* and *B* and consists of the elements in both *A* and *B*; symbolically, we define *A*∩*B*={*x*:*x*∈*A* and *x*∈*B*}.

• *A*∪*B* 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 *A*∪*B*={*x*:*x*∈*A* or *x*∈*B*}.

• *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*:*x*∈*A* and *x*∉*B*}. We often use the identity *A*\*B*=*A*∩*B*^{∁}.

• *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*) : *a*∈*A* and *b*∈*B*}.

• þ(*A*) denotes the **power set** of *A* and consists of all subsets of *A*; symbolically, we define þ(*A*)={*x*:*x*⊆*A*}. 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

• *W*∩*X*={1}, since 1 is the only element in both *W* and *X*

• *W*∪*X*={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 A∪B={x:x∈A or x∈B}.The intersection of A and B is the set A∩B={ x:x∈A and x∈B}.The difference of A and B is the set A–B={ x:x∈A and x∉B}. |

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

The difference *A*–*B* 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:

①. *R*∪*S*={1,3,4,5,6,7,8,9}

②. *R*∩*S*={4,6}

③. *R*–*S*={3,7,1,9}

④. *R*–*T*={3,6,7,1,9}

⑤. *S*–*R*={5,8}

⑥. *R*∩*T*={4}

⑦. *S*∩*T*={5,8,4}

⑧. *S*∪*T*={5,6,8,4}

⑨. *T*–*S*=Ø

Observe that for any sets *X* and *Y* it is always true that *X*∪*Y*=*Y*∪*X* and *X*∩*Y*=*Y*∩*X*, but in general *X*–*Y*≠*Y*–*X*.

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

, 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]

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}:*x*^{2}+*y*^{2}≤1} and *Y*={(*x*,*y*)∈ℝ^{2}:*x*≥1 on ℝ^{2}. On separate drawings, shade in the sets *X*∪*Y*, *X*∩*Y*, *X*–*Y* and *Y*–*X*.