Post · 6 min read· pp. 24–32
Video Available 
The union of two sets is a set containing all elements that are in A or in
B (possibly both). For example, {1,2}∪{2,3}={1,2,3}. Thus, we can write x∈(A∪B)
if and only if (x∈A) or (x∈B). Note that A∪B=B∪A. In Figure 1.4,
the union of sets A and B is shown by the shaded area in the Venn diagram.

Fig.1.4 - The shaded area shows the set B∪A.
Similarly we can define the union of three or more sets. In particular, if A1,A2,A3,⋯,An are n
sets, their union A1∪A2∪A3⋯∪An is a set containing all elements that are
in at least one of the sets. We can write this union more compactly by
i=1⋃nAi.
For example, if
A1={a,b,c},A2={c,h},A3={a,d}, then $\bigcup_{i} A_i=A_1 \cup A_2
\cup A_3={a,b,c,h,d}$. We can similarly define the union of infinitely many sets
A1∪A2∪A3∪⋯.
The intersection of two sets A and B, denoted by A∩B, consists of all elements
that are both in A and B. For example, {1,2}∩{2,3}={2}.
In Figure 1.5, the intersection of sets A and B is shown by the shaded area using a Venn diagram.

Fig.1.5 - The shaded area shows the set B∩A.
More generally, for sets A1,A2,A3,⋯, their intersection ⋂iAi is defined as the
set consisting of the elements that are in all Ai's. Figure 1.6 shows the intersection of three sets.

Fig.1.6 - The shaded area shows the set A∩B∩C.
The complement of a set A, denoted by Ac or Aˉ, is the set of all elements that are
in the universal set S but are not in A. In Figure 1.7, Aˉ is shown by the shaded area using a Venn diagram.

Fig.1.7 - The shaded area shows the set Aˉ=Ac.
The difference (subtraction) is defined as follows. The set A−B consists of elements that are
in A but not in B. For example if A={1,2,3} and B={3,5}, then A−B={1,2}. In Figure 1.8,
A−B is shown by the shaded area using a Venn diagram. Note that A−B=A∩Bc.

Fig.1.8 - The shaded area shows the set A−B.
Two sets A and B are mutually exclusive or disjoint if they do not have any shared
elements; i.e., their intersection is the empty set, A∩B=∅. More generally, several sets
are called disjoint if they are pairwise disjoint, i.e., no two of them share a common element.
Figure 1.9 shows three disjoint sets.

Fig.1.9 - Sets A,B, and C are disjoint.
If the earth's surface is our sample space, we might want to partition it to the different continents.
Similarly, a country can be partitioned to different provinces. In general, a collection of nonempty
sets A1,A2,⋯ is a partition of a set A if they are disjoint and their union is A.
In Figure 1.10, the sets A1,A2,A3 and A4 form a partition of the universal set S.

Fig.1.10 - The collection of sets A1,A2,A3 and A4 is a partition of S.
Here are some rules that are often useful when working with sets. We will see examples of their usage shortly.
Theorem : De Morgan's law
For any sets A1, A2, ⋯, An, we have
- (A1∪A2∪A3∪⋯An)c=A1c∩A2c∩A3c⋯∩Anc;
- (A1∩A2∩A3∩⋯An)c=A1c∪A2c∪A3c⋯∪Anc.
Theorem : Distributive law
For any sets A, B, and C we have
- A∩(B∪C)=(A∩B)∪(A∩C);
- A∪(B∩C)=(A∪B)∩(A∪C).
Example
If the universal set is given by S={1,2,3,4,5,6}, and A={1,2}, $B={2,4,5},
C={1,5,6} $ are three sets, find the following sets:
- A∪B
- A∩B
- A
- B
- Check De Morgan's law by finding (A∪B)c and Ac∩Bc.
- Check the distributive law by finding A∩(B∪C) and (A∩B)∪(A∩C).
- Solution
- A∪B={1,2,4,5}.
- A∩B={2}.
- A={3,4,5,6} (A consists of elements that are in S but not in A).
- B={1,3,6}.
- We have
(A∪B)c={1,2,4,5}c={3,6}, which is the same as
Ac∩Bc={3,4,5,6}∩{1,3,6}={3,6}.
- We have
A∩(B∪C)={1,2}∩{1,2,4,5,6}={1,2}, which is the same as
(A∩B)∪(A∩C)={2}∪{1}={1,2}.
A Cartesian product of two sets A and B, written as A×B, is the set containing ordered
pairs from A and B. That is, if C=A×B, then each element of C is of the form (x,y), where
x∈A and y∈B:
A×B={(x,y)∣x∈A and y∈B}.
For example, if
A={1,2,3} and
B={H,T}, then
A×B={(1,H),(1,T),(2,H),(2,T),(3,H),(3,T)}.
Note that here the pairs are ordered, so for example,
(1,H)=(H,1). Thus
A×B is
not the
same as
B×A.
If you have two finite sets A and B, where A has M elements and B has N elements, then A×B
has M×N elements. This rule is called the multiplication principle and is very useful in counting
the numbers of elements in sets. The number of elements in a set is denoted by ∣A∣, so here we write $|A|=M,
|B|=N$, and ∣A×B∣=MN. In the above example, ∣A∣=3,∣B∣=2, thus ∣A×B∣=3×2=6.
We can similarly define the Cartesian product of n sets A1,A2,⋯,An as
A1×A2×A3×⋯×An={(x1,x2,⋯,xn)∣x1∈A1 and x2∈A2 and ⋯xn∈An}.
The multiplication principle states that for finite sets
A1,A2,⋯,An, if
∣A1∣=M1,∣A2∣=M2,⋯,∣An∣=Mn, then
∣A1×A2×A3×⋯×An∣=M1×M2×M3×⋯×Mn.
An important example of sets obtained using a Cartesian product is Rn, where n is a natural
number. For n=2, we have
| |
|---|
| R2 | =R×R |
| ={(x,y)∣x∈R,y∈R}. |
Thus, R2 is the set consisting of all points in the two-dimensional plane. Similarly,
R3=R×R×R and so on.