Ordered pairs and Cartesian product
A seat in a cinema is told as (row, seat number). (C, 5) is not the same seat as (5, C): the order matters.
An ordered pair (a, b) is two objects written in a fixed order; (a, b) = (c, d) only when a = c and b = d. The Cartesian product A × B is the set of all ordered pairs (a, b) with a ∈ A and b ∈ B.
Formula: A × B = {(a, b) : a ∈ A, b ∈ B}
Rule 1: Form A × B — Take each element of A, pair it with every element of B.
- Easy: A = {1, 2}, B = {x}: A × B = {(1, x), (2, x)}.
- Medium: A = {1, 2}, B = {3, 4}: A × B = {(1, 3), (1, 4), (2, 3), (2, 4)}.
- Exam-type: B × A for the same sets = {(3, 1), (3, 2), (4, 1), (4, 2)}: not equal to A × B.
Rule 2: Equal ordered pairs — Match first with first and second with second.
- Easy: (x, 3) = (5, 3) gives x = 5.
- Medium: (x + 1, 7) = (4, y − 2) gives x = 3, y = 9.
- Exam-type: (a − b, 4) = (2, a + b) gives a − b = 2 and a + b = 4, so a = 3, b = 1.
A × B and B × A are equal only if A = B or one of the sets is empty.
Writing (a, b) as a set {a, b} — a set ignores order, a pair does not.
Pair = Position matters (like row, seat).
Spot the difference
| (2, 5) | {2, 5} |
|---|---|
| Order matters | Order does not matter |
| (2, 5) ≠ (5, 2) | {2, 5} = {5, 2} |
Practice questions
- 1Is (3, 7) = (7, 3)?
- 2If (x, 2) = (9, 2), find x.
- 3A = {1}, B = {2, 3}. Write A × B.
- 4If (p + 2, 5) = (6, q − 1), find p and q.
- 5A = {a, b}, B = {1, 2}. How many pairs are in B × A?
- 6Is A × B = B × A for A = {1, 2}, B = {2, 3}?
- 7If (2x − 1, y + 3) = (7, 10), find x and y.
- 8If A × B = {(1, 4), (1, 5), (2, 4), (2, 5)}, find A and B.
Show answers (try them yourself first)
- 1No.
- 29
- 3{(1, 2), (1, 3)}
- 4p = 4, q = 6
- 54
- 6No — (1, 2) ∈ A × B but not in B × A.
- 7x = 4, y = 7
- 8A = {1, 2}, B = {4, 5}
Counting pairs and the graph of A × B
If a shop has 3 shirts and 2 trousers, you can dress in 3 × 2 = 6 different ways.
If A has p elements and B has q elements, then A × B has p × q elements. For real sets, A × B can be drawn as points on a grid; R × R is the whole coordinate plane.
Formula: n(A × B) = n(A) × n(B)
Rule 1: Count pairs — Multiply the two counts.
- Easy: n(A) = 3, n(B) = 4: n(A × B) = 12.
- Medium: A × A for n(A) = 5: 25 pairs.
- Exam-type: If A × ∅, the count is 0.
Rule 2: Recover a set — Divide the total by the other count.
- Easy: n(A × B) = 20, n(A) = 4: n(B) = 5.
- Medium: A × B has 15 pairs and A has 3 elements: B has 5.
- Exam-type: A × B has 7 pairs (prime): one set has 1 element and the other has 7.
Order of the two sets changes the pairs but not their count.
Adding the counts instead of multiplying.
Pairs = Product (multiply).
Practice questions
- 1n(A) = 6, n(B) = 2. Find n(A × B).
- 2n(A) = 4. Find n(A × A).
- 3A × B has 18 elements and n(B) = 3. Find n(A).
- 4A = {1, 2, 3}, B = {1, 2}. How many pairs (a, b) in A × B have a > b?
- 5Two sets A and B have 3 common elements and A × B has 12 pairs. If n(A) = 4, find n(B) and a possible number of elements in B − A.
- 6A × B has 9 elements and contains (1, 2), (2, 3), (3, 1). Find A and B.
- 7How many points are in the grid picture of {1, 2, 3} × {1, 2}?
- 8If n(A × B) = 12 and A, B are non-empty sets of natural numbers, list all possible (n(A), n(B)).
Show answers (try them yourself first)
- 112
- 216
- 36
- 43 (they are (2,1), (3,1), (3,2))
- 5n(B) = 3; since all 3 are common, B − A has 0 elements.
- 6n(A) = n(B) = 3 and A ⊇ {1, 2, 3}, B ⊇ {1, 2, 3}, so A = B = {1, 2, 3}.
- 76
- 8(1,12), (2,6), (3,4), (4,3), (6,2), (12,1)
Relations
Student → roll number, country → capital, brother → sister: wherever two groups are linked by a rule, we have a relation.
A relation R from A to B is any subset of A × B. If (a, b) ∈ R we write a R b. The set of all first elements is the domain, the whole of B is the codomain, and the set of second elements that actually appear is the range.
Formula: R ⊆ A × B
In the figure: R: x → 2x. Domain {1, 2, 3}, range {2, 4, 6}, codomain {2, 4, 6, 8}.
Rule 1: Write a relation — Use the rule to pick pairs from A × B.
- Easy: A = {1, 2, 3}, B = {1, 2, 3, 4}, R = {(x, y) : y = x + 1} = {(1, 2), (2, 3), (3, 4)}.
- Medium: A = {1, 2, 3, 4}, R = {(x, y) : x < y} on A gives {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}.
- Exam-type: R = {(x, y) : y = x², x ∈ {1, 2, 3}} = {(1, 1), (2, 4), (3, 9)}.
Rule 2: Domain, codomain, range — Domain = first entries. Range = second entries used. Codomain = the full target set.
- Easy: R = {(1, 5), (2, 5), (3, 7)}: domain {1, 2, 3}, range {5, 7}.
- Medium: B = {5, 7, 9}: codomain {5, 7, 9}; range {5, 7} is a part of it.
- Exam-type: Number of relations from A to B = 2^(n(A) × n(B)); for n(A) = 2, n(B) = 2 it is 16.
Every relation from A to B is a subset of A × B, so the total number of relations is 2^(pq).
Calling the codomain "range". The range contains only the values actually used.
Domain = Departure, Range = Reached.
Spot the difference
| Codomain | Range |
|---|---|
| The whole target set B | Only the values used |
| Fixed by the definition | Found from the relation |
Practice questions
- 1R = {(1, 3), (2, 4), (5, 3)}. Write its domain.
- 2For the same R, write its range.
- 3A = {1, 2, 3}. Write R = {(x, y) : y = 2x, y ∈ A} as pairs.
- 4A = {1, 2, 3, 4}. Write R = {(x, y) : y = x + 2} on A.
- 5If n(A) = 3 and n(B) = 2, how many relations are possible from A to B?
- 6R = {(x, y) : x + y = 6, x, y ∈ N, x ≤ y}. Write R.
- 7Find domain and range of R = {(x, x²) : x ∈ {−2, −1, 0, 1, 2}}.
- 8Is {(1, a), (1, b)} a relation from {1} to {a, b}? Give its range.
Show answers (try them yourself first)
- 1{1, 2, 5}
- 2{3, 4}
- 3{(1, 2)}
- 4{(1, 3), (2, 4)}
- 52⁶ = 64
- 6{(1, 5), (2, 4), (3, 3)}
- 7Domain {−2, −1, 0, 1, 2}, range {0, 1, 4}
- 8Yes, any subset of A × B is a relation; range {a, b}.