Ordered pairs, products and relations · Mathematics Class 11–12 | StemPy Lab
Course 1.1·Lesson 2 of 3
Ordered pairs, products and relations
An ordered pair (a, b) has a first and a second element, and the order matters. The Cartesian product A × B is the set of all ordered pairs, with n(A×B)=n(A)n(B)
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
Order matters
On a map, the point (3,5) is not the point (5,3). A seat in a cinema is "row 4, seat 7", and it is not "row 7, seat 4". When the order matters, we write the two items as an ordered pair(a,b).
Two ordered pairs are equal only when both places match:
(a,b)=(c,d)⟺a=c and b=d
For example, if (x+1,3)=(4,y−2), then x+1=4 and 3=y−2, so x=3 and y=5.
The Cartesian product
The Cartesian product of two sets A and B is the set of all ordered pairs with the first element from A and the second from B:
A×B={(a,b):a∈A,b∈B}
If A={1,2} and B={x,y,z}, then
A×B={(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)}
There are 2×3=6 pairs. In general, n(A×B)=n(A)×n(B). Also A×B=B×A unless A=B, because (1,x) is not (x,1).
The product R×R is the set of all pairs of real numbers. These are exactly the points of the coordinate plane, which is why the plane is written R2.
Count the crossings: there are always m×n. A relation picks any collection of them, so there are 2mn relations.
Relations
A relationR from a set A to a set B is any subset of A×B. We write (a,b)∈R, or aRb, and we say that "a is related to b".
An arrow diagram of the relation R from A equal to 1, 2, 3 to B equal to x, y, z. Arrows go from 1 to x, from 1 to y and from 2 to z. The element 3 has no arrow.
In an arrow diagram, we draw an arrow from a to b for every pair (a,b) in R. Here R={(1,x),(1,y),(2,z)}. The element 1 has two arrows, and the element 3 has none. A relation allows both.
Three sets belong to a relation from A to B:
the domain, the set of all first elements: here {1,2};
the codomain, the whole set B: here {x,y,z};
the range, the set of the second elements that actually occur: here {x,y,z}.
The domain is a subset of A, and the range is a subset of the codomain.
A relation by a rule. Let A={1,2,3,4} and let R={(x,y):y=x+2} from A to N. Then R={(1,3),(2,4),(3,5),(4,6)}. The domain is {1,2,3,4} and the range is {3,4,5,6}.
How many relations? A relation is a subset of A×B, and this product has n(A)n(B) elements. So the number of relations from A to B is
2n(A)n(B)
For A={1,2} and B={x,y,z} it is 26=64.
Relations on one set
A relation from A to A is called a relation onA. Three properties are important.
Reflexive: every a is related to itself, (a,a)∈R.
Symmetric: if (a,b)∈R then (b,a)∈R.
Transitive: if (a,b)∈R and (b,c)∈R then (a,c)∈R.
A relation with all three properties is an equivalence relation. It sorts the elements into groups that do not overlap.
Example. On Z, let aRb mean that a−b is divisible by 3. It is reflexive, since a−a=0. It is symmetric, since if 3 divides a−b it also divides b−a. It is transitive, since if 3 divides a−b and b−c then it divides their sum, a−c. So R is an equivalence relation. It puts two numbers in the same group when they leave the same remainder after division by 3.
Counterexample. "a is less than b" on N is transitive, but it is not reflexive (since a<a is false) and not symmetric.
Practise with new numbers
Try it in Python
This program makes the Cartesian product of {1,2} and {x,y,z}, finds one relation in it, and counts all the relations.
Remember these
An ordered pair (a,b) has a first and a second element, and (a,b)=(c,d) only if a=c and b=d.
A×B is the set of all pairs. n(A×B)=n(A)n(B).
A relation from A to B is any subset of A×B. There are 2n(A)n(B) of them.
Domain: first elements. Codomain: the whole of B. Range: the second elements that occur.
An equivalence relation is reflexive, symmetric and transitive.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
If (a+2,5)=(7,b−1), find a and b.
A has 3 elements and B has 4. How many elements does A×B have, and how many relations are there from A to B?
Is the relation "a is a brother of b" reflexive?
On N, is the relation "a divides b" symmetric?
Enroll free in Sets, Relations and Functions
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.