Concept 03 / 10Sets, Relations and Functions
Cartesian Product and Relations: Domain, Range, Codomain and Counting
Ordered pairs and the Cartesian product A x B, why n(A x B) = mn and the product is not commutative, a relation as any subset of A x B, its domain, range and inverse, and counting relations as 2^(mn).
An ordered pair is a pair in which position matters: if and only if and . So , whereas the sets and are equal. This one difference is the whole reason the Cartesian product exists.
The Cartesian product of and is , every ordered pair whose first entry comes from and second from . If and , each of the first entries pairs with each of the second entries, so . The familiar coordinate plane is , and is the set of ordered triples. Taking the product of with itself times gives .
Properties worth knowing. in general; they are equal only if or one of the sets is empty. , because there is no second entry to choose. The product distributes over union, intersection and difference: , and . A particularly neat identity is : a pair lies in both products exactly when its first entry is in and and its second is in and . The same is not true for unions, which is a common trap: is usually strictly smaller than .
A relation from to is simply any subset of . If we write and say is related to . The definition is deliberately minimal: a relation is nothing more than the list of which pairs are related. A relation from to is called a relation on . The domain of is the set of first entries that actually appear, . The range is the set of second entries that actually appear. The codomain is the whole of . So range codomain, and the distinction becomes central when we discuss onto functions. The arrow diagram shows , and . The element has no arrow, so it is not in the domain; has two arrows, which is allowed for a relation (but not for a function).
Counting relations. Since a relation is any subset of , and has elements, the number of relations from to is . This count includes the empty relation (nothing related to anything) and the universal relation (everything related to everything). On a single set with elements, , so there are relations. A relation required to contain specific pairs leaves pairs free, giving relations.
The inverse relation reverses every pair: . It is a relation from to , with domain of equal to the range of and vice versa. Every relation has an inverse relation; this is different from functions, where an inverse function exists only under extra conditions.
Key Takeaways:
- and .
- ; only if or one set is empty.
- .
- , and similarly for and .
- , but the analogous statement for is false.
- A relation from to is any subset of ; there are of them, and on an -element set.
- Range codomain; the domain contains only elements that actually have a partner.
- Pitfall: writing instead of for the universal relation, or forgetting that the empty relation counts.
Brain-Teaser 1: has elements, three of which are , and . Find , and the remaining three elements.
Solution: The first entries show and the second entries show , so and . Since , the only possibility is and . Therefore and , and the remaining elements are , and . The method is to use the known pairs to force lower bounds, then use the product formula to show the bounds are tight.
Brain-Teaser 2: and have elements in common. How many elements does have?
Solution: Apply with and : . This has elements. In words, a pair lies in both products only when belongs to both sets and so does . The sizes of and separately do not matter.
Brain-Teaser 3: Let and . How many relations from to are there? How many are non-empty? How many contain a particular pair ? How many have domain equal to all of ?
Solution: has pairs, so there are relations, and of them are non-empty. Containing fixes one pair, leaving . For the domain to be all of , each element of must have at least one partner. The partner set of can be any non-empty subset of ( choices), and independently so can the partner set of , giving . Thinking of a relation as 'each element of picks a subset of ' is often cleaner than thinking about the pairs one by one.
Practice this concept
Free · no account required · instant solutions