MCS-212 · Block 2 Unit 1

Sets, Relations and Functions

Section 5 of 9

Block 2 · Unit 1Sets, Relations and Functions12 min · Section 5 of 9

1.5Cartesian products and relations

Covers IGNOU MCS-212 §1.4.1, 1.4.2, E18–E20; programme guide: representing relations using matrices and digraphs

A relation such as “student ss is enrolled in course cc” connects elements of one set with elements of another. To describe it precisely we first need pairs of elements where the order matters, and the set of all such pairs.

Ordered pairs and the Cartesian product

If ∣A∣=m|A| = m and ∣B∣=n|B| = n, then ∣A×B∣=mn|A \times B| = mn. Usually A×B≠B×AA \times B \neq B \times A: {1}×{2}={(1,2)}\{1\} \times \{2\} = \{(1, 2)\} but {2}×{1}={(2,1)}\{2\} \times \{1\} = \{(2, 1)\}.

Geometrically, R×R\mathbb{R} \times \mathbb{R} is the plane. {2}×R={(2,y)}\{2\} \times \mathbb{R} = \{(2, y)\} is the vertical line x=2x = 2, and R×{2}={(x,2)}\mathbb{R} \times \{2\} = \{(x, 2)\} is the horizontal line y=2y = 2. A database table with columns (name, city) is a subset of Names ×\times Cities.

Relations

For example, on A={1,2,3,4}A = \{1, 2, 3, 4\} the relation “divides” is R={(1,1),(1,2),(1,3),(1,4),(2,2),(2,4),(3,3),(4,4)}R = \{(1,1), (1,2), (1,3), (1,4), (2,2), (2,4), (3,3), (4,4)\}.

This holds because the relations are exactly the subsets of A×BA \times B, a set with mnmn elements, so there are 2mn2^{mn} of them (by the power-set theorem).

Representing a relation by a matrix or a digraph

Key takeaways

  • A×BA \times B is the set of ordered pairs (a,b)(a, b); ∣A×B∣=∣A∣ ∣B∣|A \times B| = |A|\,|B|.
  • A×B=B×AA \times B = B \times A only if A=BA = B or one of them is empty.
  • A relation is a subset of A×BA \times B; there are 2mn2^{mn} relations from an mm-set to an nn-set.
  • Relations can be shown as zero–one matrices and as digraphs.

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

If ∣A∣=3|A| = 3 and ∣B∣=4|B| = 4, how many elements does A×BA \times B have?

Show answer

Answer: B. 12

∣A×B∣=3×4=12|A \times B| = 3 \times 4 = 12. Option 1 adds instead of multiplying.

Question 2 · multiple choice

How many relations are there on a set with 3 elements?

Show answer

Answer: D. 512

A×AA \times A has 32=93^2 = 9 pairs, so there are 29=5122^9 = 512 relations. Option 2 counts the pairs, not the subsets.

Question 3 · multiple choice

Which set is the horizontal line y=2y = 2 in the plane?

Show answer

Answer: A. R×{2}\mathbb{R} \times \{2\}

R×{2}={(x,2)}\mathbb{R} \times \{2\} = \{(x, 2)\}: any xx, height 2. Option 2 is the vertical line x=2x = 2.

Question 4 · multiple choice

Let A={1,2}A = \{1, 2\} and B=∅B = \emptyset. Which is true?

Show answer

Answer: C. A×B=B×A=∅A \times B = B \times A = \emptyset

With no element in BB, no pairs can be formed in either order. Option 2 is the usual case, but the empty set is the exception.

Question 5 · multiple choice

In the matrix of a relation RR on {1,2,3}\{1, 2, 3\} (rows and columns in order 1, 2, 3), what does a 1 in row 3, column 1 mean?

Show answer

Answer: D. (3,1)∈R(3, 1) \in R

The row gives the first element and the column the second. Option 1 reverses the order.

Question 6 · short answer

Let A={1,2,3,4}A = \{1, 2, 3, 4\} and R={(a,b)∣a<b}R = \{(a, b) \mid a < b\} on AA. List RR and write its matrix.

Show worked answer

R={(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}R = \{(1,2), (1,3), (1,4), (2,3), (2,4), (3,4)\} (6 pairs). Matrix with rows and columns in order 1, 2, 3, 4: row 1: 0 1 1 1; row 2: 0 0 1 1; row 3: 0 0 0 1; row 4: 0 0 0 0. All 1s lie above the main diagonal, because a<ba < b.

↑ ↓ move↵ openTab switch type