At the beginning of this section, we pointed out that a set is an unordered collection
of elements; that is, a set is determined by its elements and not by any particular order
in which the elements are listed. Sometimes, however, we do want to take order into
account. An ordered pair of elements, written (a, b), is considered distinct from the or-
dered pair (b, a), unless, of course, a = b. To put it another way, (a, b) = (c, d) precisely
when a = c and b = d. If X and Y are sets, we let X x Y denote the set of all ordered
pairs (x, y) where x € X and y € Y. We call X x Y the Cartesian product of X and Y.
If X = (1,2, 3} and Y = {a,b}, then
Xx Y = ((l, a), (1, 6), (2, a), (2, 5), (3,4). G,b)}
Y x X = [(a, 1). (6, 1), (a. 2). (b,2), (a. 3). (6, 3)
X x X =((1, 1), (1,2), (1,3), (2, 1), (2,2), 2,3), G, D), 3,2), G,3)}
Y x Y = [(a, a), (a,b), (b, a). (b, b)). 4