2 Basic Structures: Sets, Functions,Sequences, Sums, and Matrices
2.1.6 Cartesian Products
The set {∅} has exactly two subsets, namely, ∅ and the set {∅} itself. Therefore,
({∅}) = {∅, {∅}}.
◂
If a set has n elements, then its power set has 2n elements. We will demonstrate this fact in several ways in subsequent sections of the text.
2.1.6 Cartesian Products
The order of elements in a collection is often important. Because sets are unordered, a different structure is needed to represent ordered collections. This is provided by ordered n-tuples.
Definition 7
The ordered n-tuple (a1, a2, … , an) is the ordered collection that has a1as its first element, a2as its second element, … , and an as its nth element.We say that two ordered n-tuples are equal if and only if each corresponding pair of their elements is equal. In other words, (a1, a2, … , an) = (b1, b2, … , bn) if and only if ai= bi, for i = 1, 2, … , n. In particular, ordered 2-tuples are called ordered pairs. The ordered pairs (a, b) and (c, d) are equal if and only if a = c and b = d. Note that (a, b) and (b, a) are not equal unless a = b.
Many of the discrete structures we will study in later chapters are based on the notion of the Cartesian product of sets (named after Ren´e Descartes). We first define the Cartesian product of two sets.
Definition 8
Let A and B be sets. The Cartesian product of A and B, denoted by A × B, is the set of all ordered pairs (a, b), where a ∈ A and b ∈ B. Hence,A × B = {(a, b) ∣ a ∈ A ∧ b ∈ B}.
EXAMPLE 16 Let A represent the set of all students at a university, and let B represent the set of all courses offered at the university. What is the Cartesian product A × B and how can it be used?
Solution:The Cartesian product A × B consists of all the ordered pairs of the form (a, b), where a Extra
Examples
is a student at the university and b is a course offered at the university. One way to use the set A × B is to represent all possible enrollments of students in courses at the university. Furthermore, observe that each subset of A × B represents one possible total enrollment configuration, and
(A × B) represents all possible enrollment configurations.
◂
EXAMPLE 17 What is the Cartesian product of A = {1, 2} and B = {a, b, c}?
Solution:The Cartesian product A × B is
A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}.
◂
Note that the Cartesian products A × B and B × A are not equal unless A = ∅ or B = ∅ (so that A × B = ∅) or A = B (see Exercises 33 and 40). This is illustrated in Example 18.
EXAMPLE 18 Show that the Cartesian product B × A is not equal to the Cartesian product A × B, where A and B are as in Example 17.
Stock Montage/Archivec Photos/Getty Images
REN ´E DESCARTES (1596–1650) Ren´e Descartes was born into a noble family near Tours, France, about Links
130 miles southwest of Paris. He was the third child of his father’s first wife; she died several days after his birth. Because of Ren´e’s poor health, his father, a provincial judge, let his son’s formal lessons slide until, at the age of 8, Ren´e entered the Jesuit college at La Fl`eche. The rector of the school took a liking to him and permitted him to stay in bed until late in the morning because of his frail health. From then on, Descartes spent his mornings in bed; he considered these times his most productive hours for thinking.
Descartes left school in 1612, moving to Paris, where he spent 2 years studying mathematics. He earned a law degree in 1616 from the University of Poitiers. At 18 Descartes became disgusted with studying and decided to see the world. He moved to Paris and became a successful gambler. However, he grew tired of bawdy living and moved to the suburb of Saint-Germain, where he devoted himself to mathematical study.
When his gambling friends found him, he decided to leave France and undertake a military career. However, he never did any fighting. One day, while escaping the cold in an overheated room at a military encampment, he had several feverish dreams, which revealed his future career as a mathematician and philosopher.
After ending his military career, he traveled throughout Europe. He then spent several years in Paris, where he studied mathemat-ics and philosophy and constructed optical instruments. Descartes decided to move to Holland, where he spent 20 years wandering around the country, accomplishing his most important work. During this time he wrote several books, including the Discours, which contains his contributions to analytic geometry, for which he is best known. He also made fundamental contributions to philosophy.
In 1649 Descartes was invited by Queen Christina to visit her court in Sweden to tutor her in philosophy. Although he was reluctant to live in what he called “the land of bears amongst rocks and ice,” he finally accepted the invitation and moved to Sweden.
Unfortunately, the winter of 1649–1650 was extremely bitter. Descartes caught pneumonia and died in mid-February.
Solution:The Cartesian product B × A is
B × A = {(a, 1), (a, 2), (b, 1), (b, 2), (c, 1), (c, 2)}.
This is not equal to A × B, which was found in Example 17.
◂
The Cartesian product of more than two sets can also be defined.
Definition 9
The Cartesian product of the sets A1, A2, … , An, denoted by A1× A2×⋯ × An, is the set of ordered n-tuples (a1, a2, … , an), where aibelongs to Aifor i = 1, 2, … , n. In other words,A1× A2×⋯ × An= {(a1, a2, … , an) ∣ ai ∈ Aifor i = 1, 2, … , n}.
EXAMPLE 19 What is the Cartesian product A × B × C, where A = {0, 1}, B = {1, 2}, and C = {0, 1, 2}?
Solution:The Cartesian product A × B × C consists of all ordered triples (a, b, c), where a ∈ A, b ∈ B, and c ∈ C. Hence,
A × B × C = {(0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 0), (0, 2, 1), (0, 2, 2),
(1, 1, 0), (1, 1, 1), (1, 1, 2), (1, 2, 0), (1, 2, 1), (1, 2, 2)}.
◂
Remark: Note that when A, B, and C are sets, (A × B) × C is not the same as A × B × C (see Exercise 41).
We use the notation A2 to denote A × A, the Cartesian product of the set A with itself.
Similarly, A3 = A × A × A, A4 = A × A × A × A, and so on. More generally, An= {(a1, a2, … , an) ∣ ai∈ A for i = 1, 2, … , n}.
EXAMPLE 20 Suppose that A = {1, 2}. It follows that A2= {(1, 1), (1, 2), (2, 1), (2, 2)} and A3= {(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2), (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)}.
◂
A subset R of the Cartesian product A × B is called a relation from the set A to the set B. The elements of R are ordered pairs, where the first element belongs to A and the second to B. For example, R = {(a, 0), (a, 1), (a, 3), (b, 1), (b, 2), (c, 0), (c, 3)} is a relation from the set {a, b, c} to the set {0, 1, 2, 3}, and it is also a relation from the set {a, b, c, d, e} to the set {0, 1, 3, 4). (This illustrates that a relation need not contain a pair (x, y) for every element x of A.) A relation from a set A to itself is called a relation on A.
EXAMPLE 21 What are the ordered pairs in the less than or equal to relation, which contains (a, b) if a≤ b, on the set {0, 1, 2, 3}?
Solution:The ordered pair (a, b) belongs to R if and only if both a and b belong to {0, 1, 2, 3} and a≤ b. Consequently, R = {(0, 0), (0, 1), (0, 2), (0, 3), (1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)}.
◂
We will study relations and their properties at length in Chapter 9.