1.2.2 Set Operations: 1 2 3 N 1 2 3 N N I
1.2.2 Set Operations: 1 2 3 N 1 2 3 N N I
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.
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
n
⋃ Ai .
i=1
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.
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 1/9
1/16/24, 10:59 AM Set Operations | Union | Intersection | Complement | Difference | Mutually Exclusive | Partitions | De Morgan's Law | Distributive L…
More generally, for sets A1 , A2 , A3 , ⋯ , their intersection ⋂i Ai is defined as the set consisting of the elements
that are in all Ai 's. Figure 1.6 shows the intersection of three sets.
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 2/9
1/16/24, 10:59 AM Set Operations | Union | Intersection | Complement | Difference | Mutually Exclusive | Partitions | De Morgan's Law | Distributive L…
¯
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.
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 3/9
1/16/24, 10:59 AM Set Operations | Union | Intersection | Complement | Difference | Mutually Exclusive | Partitions | De Morgan's Law | Distributive L…
¯
Fig.1.7 - The shaded area shows the set A = A
c
.
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 .
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 4/9
1/16/24, 10:59 AM Set Operations | Union | Intersection | Complement | Difference | Mutually Exclusive | Partitions | De Morgan's Law | Distributive L…
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.
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 5/9
1/16/24, 10:59 AM Set Operations | Union | Intersection | Complement | Difference | Mutually Exclusive | Partitions | De Morgan's Law | Distributive L…
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 .
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 6/9
1/16/24, 10:59 AM Set Operations | Union | Intersection | Complement | Difference | Mutually Exclusive | Partitions | De Morgan's Law | Distributive L…
Here are some rules that are often useful when working with sets. We will see examples of their usage shortly.
⋯ ∩ An ;
c c c c c
(A1 ∪ A2 ∪ A3 ∪ ⋯ An ) = A ∩ A ∩ A
1 2 3
⋯ ∪ An .
c c c c c
(A1 ∩ A2 ∩ A3 ∩ ⋯ An ) = A ∪ A ∪ A
1 2 3
A ∩ (B ∪ C ) = (A ∩ B) ∪ (A ∩ C ) ;
A ∪ (B ∩ C ) = (A ∪ B) ∩ (A ∪ C ) .
Example 1.4
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 7/9
1/16/24, 10:59 AM Set Operations | Union | Intersection | Complement | Difference | Mutually Exclusive | Partitions | De Morgan's Law | Distributive L…
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. A ∪ B
b. A ∩ B
¯
¯¯¯
c. A
¯
¯¯¯
d. B
e. Check De Morgan's law by finding (A ∪ B)c and Ac ∩ Bc .
f. Check the distributive law by finding A ∩ (B ∪ C ) and (A ∩ B) ∪ (A ∩ C ).
Solution
a. A ∪ B = {1, 2, 4, 5}.
b. A ∩ B = {2} .
¯
¯¯¯ ¯
¯¯¯
c. A = {3, 4, 5, 6} (A consists of elements that are in S but not in A).
¯
¯¯¯
d. B = {1, 3, 6}.
e. We have
c c
(A ∪ B) = {1, 2, 4, 5} = {3, 6},
f. We have
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 :
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| = M N . In the above example, |A| = 3, |B| = 2, thus |A × B| = 3 × 2 = 6 . We can similarly
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 8/9
1/16/24, 10:59 AM Set Operations | Union | Intersection | Complement | Difference | Mutually Exclusive | Partitions | De Morgan's Law | Distributive L…
then
∣A1 × A2 × A3 × ⋯ × An ∣= M 1 × M 2 × M 3 × ⋯ × M n .
n
An important example of sets obtained using a Cartesian product is R , where n is a natural number. For n = 2, we
have
2
R = R × R
= {(x, y)|x ∈ R, y ∈ R} .
Thus, R 2 is the set consisting of all points in the two-dimensional plane. Similarly, R 3 = R × R × R and so on.
← previous
next →
https://www.probabilitycourse.com/chapter1/1_2_2_set_operations.php 9/9