GATE / CS ARCHIVE

SIMILAR QUESTIONS / DISCRETE MATHEMATICS

Count subsets of the Cartesian square

2 questions solved the same way, newest first. Back to Discrete Mathematics

Descriptive
Report issue

Count binary relations on a finite set

Sets, Relations & Functions

Question 3(a), GATE 2002: A has n>0 elements. Let Nᵣ be the number of binary relations on A and N𝒻 the number of functions A→A. Express Nᵣ in terms of n.
Question 3(a), GATE 2002: A has n>0 elements. Let Nᵣ be the number of binary relations on A and N𝒻 the number of functions A→A. Express Nᵣ in terms of n.
Tap to enlarge
Shared context

A is a finite set of n > 0 elements. N_r counts all binary relations on A, and N_f counts all total functions A → A.

Answer & solution

Answer: N_r = 2^(n²) (no official key was published)

1. Identify what is being counted. A binary relation on a set A is any subset R of A × A; there are no requirements such as reflexivity or symmetry in this question.

2. Count the possible ordered pairs. The first coordinate has n choices and the second also has n choices. The product rule therefore gives |A × A| = n². Reversed pairs are distinct when their coordinates differ.

3. Make an independent yes/no decision for every pair. Each of the n² pairs can be included in R or omitted. Multiplying the two choices for all pairs gives Nr = 2 × ⋯ × 2 = 2n².

4. Check the boundary case n = 1. If A = {a}, the two relations are ∅ and {(a,a)}. This agrees with 21² = 2. For n = 2 there are four possible pairs and therefore 16 relations.

Original paper, page 6

1 mark · MCQ
Report issue

Counting binary relations

Sets, Relations & Functions

Question 1.2, GATE 1999: How many binary relations exist on a set of n elements? Options: n,2^n,2^(n²),none.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

A binary relation is any subset of the Cartesian product S×S. There are n choices for each coordinate, hence n² ordered pairs. Each pair independently either belongs to the relation or does not. Multiplying the two choices over n² pairs gives 2n², C. No reflexivity, symmetry or function restriction is imposed; imposing one would change the count.

Original paper, page 1