Counting Relations on a Set with nn Elements

Counting Relations on a Set with nn Elements

Verified Sources
Sep 11, 2026

Let AA be a finite set containing nn elements. The number of relations on AA is:

2n2\boxed{2^{n^2}}

Therefore, the correct answer is:

(ii) 2n2\boxed{\text{(ii) }2^{n^2}}

A relation on AA is any subset of the Cartesian product A×AA \times A. Since AA has nn elements, A×AA \times A contains n2n^2 ordered pairs. Each ordered pair may either belong to the relation or not belong to it, giving two choices for each pair.

Cartesian product

Binary relation

Power set

Footnotes

  1. Cartesian Products and Relations Definition - Defines relations as subsets of Cartesian products and derives the counting formula.

  2. Cartesian Products and Relations Definition - Explains that each ordered pair has two choices: inclusion or exclusion.

1. What Is a Relation on AA?

A relation RR on a set AA is defined as a subset of A×AA \times A:

RA×AR \subseteq A \times A

The phrase “on AA” means that both components of every ordered pair come from AA.

If

A={a1,a2,,an},A=\{a_1,a_2,\ldots,a_n\},

then

A×A={(ai,aj):1i,jn}.A\times A=\{(a_i,a_j):1\leq i,j\leq n\}.

For example, if

A={1,2,3},A=\{1,2,3\},

then

\{(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)\}.$$ Thus, $A\times A$ contains $9=3^2$ ordered pairs. Ordered pair Domain Range

2. Counting the Ordered Pairs

The first component of an ordered pair can be selected in nn ways, because there are nn elements in AA.

For each first component, the second component can also be selected in nn ways.

By the multiplication principle:

A×A=nn=n2.|A\times A|=n\cdot n=n^2.

This is the key observation. There are n2n^2 possible ordered pairs that could potentially be included in a relation.

Deriving the Number of Relations

  1. 1
    Step 1

    A relation on A must be a subset of A × A. Since A has n elements, the Cartesian product contains n² ordered pairs.

  2. 2
    Step 2

    Every ordered pair in A × A has exactly two possibilities: it is included in the relation, or it is not included.

  3. 3
    Step 3

    The choices are independent for all n² ordered pairs, so the total number is 2 multiplied by itself n² times.

  4. 4
    Step 4

    Therefore, the number of relations is 2^(n²).

  5. 5
    Step 5

    Among the given choices, the correct answer is (ii) 2^(n²).

3. Why the Exponent Is n2n^2

A common mistake is to use nn as the exponent. However, a relation is made from ordered pairs, not individual elements.

There are:

  • nn choices for the first member of a pair;
  • nn choices for the second member;
  • therefore n2n^2 possible ordered pairs.

The relation is then chosen from these n2n^2 pairs. In other words, every relation is one subset of A×AA\times A:

RP(A×A).R\in\mathcal{P}(A\times A).

The power set of a set containing mm elements has 2m2^m subsets. Taking m=n2m=n^2 gives:

P(A×A)=2A×A=2n2.|\mathcal{P}(A\times A)|=2^{|A\times A|}=2^{n^2}.

Footnotes

  1. Ch. 1 Key Concepts - OpenStax Contemporary Mathematics - States that a finite set with mm elements has 2m2^m subsets.

Number of Relations for Small Values of n

The number grows as 2^(n²), because each of the n² ordered pairs can be independently selected or rejected.

4. Examples

Example 1: n=1n=1

Let

A={a}.A=\{a\}.

Then

A×A={(a,a)}.A\times A=\{(a,a)\}.

There is one possible ordered pair, and it can either be included or excluded:

  • R=R=\varnothing;
  • R={(a,a)}R=\{(a,a)\}.

Therefore:

212=2.2^{1^2}=2.


Example 2: n=2n=2

Let

A={a,b}.A=\{a,b\}.

Then:

A×A={(a,a),(a,b),(b,a),(b,b)}.A\times A=\{(a,a),(a,b),(b,a),(b,b)\}.

There are 4=224=2^2 possible ordered pairs. Each can be selected or not selected, so:

24=16.2^4=16.

Thus, a two-element set has 1616 relations on it.


Example 3: n=3n=3

For a set with three elements:

A×A=32=9.|A\times A|=3^2=9.

Hence:

Number of relations=29=512.\text{Number of relations}=2^9=512.


Example 4: n=4n=4

For a set with four elements:

A×A=42=16.|A\times A|=4^2=16.

Therefore:

Number of relations=216=65, ⁣536.\text{Number of relations}=2^{16}=65,\!536.

Fast Method

For a relation on a set with n elements, first calculate n² possible ordered pairs, then raise 2 to that number: 2^(n²).

5. Distinguishing the Answer Choices

OptionMeaningCorrect?
n2n^2Number of ordered pairs in A×AA\times ANo
2n22^{n^2}Number of subsets of A×AA\times AYes
2n2^nNumber of subsets of a set with nn elementsNo
2n2nTwice the number of elementsNo

The expression n2n^2 counts the possible ordered pairs, but not the possible relations. A relation is a subset of those pairs, and the number of subsets of a set with n2n^2 elements is 2n22^{n^2}.

Subset

Cardinality

Multiplication principle

Common Questions and Misconceptions

6. Relation Properties Do Not Change the Basic Definition

The formula 2n22^{n^2} counts every possible relation on AA. Additional conditions produce smaller classes of relations.

  • A relation is reflexive if every (a,a)(a,a) must be included.
  • A relation is symmetric if including (a,b)(a,b) requires including (b,a)(b,a).
  • A relation is antisymmetric if distinct elements cannot relate in both directions.
  • A relation is transitive if two successive relationships imply a direct relationship.

These restrictions affect the count. For example, the number of reflexive relations on an nn-element set is:

2n2n,2^{n^2-n},

because the nn diagonal pairs (a,a)(a,a) are forced to be included, while the remaining n2nn^2-n pairs may be chosen freely.

However, unless the question specifies a property, use the unrestricted count:

2n2.\boxed{2^{n^2}}.

Read the Wording Carefully

The formula 2^(n²) counts all relations on A. If the question asks for reflexive, symmetric, equivalence, or partial-order relations, a different counting argument is required.

Exam-Solution Format

  1. 1
    Step 1

    A relation on A is any subset of A × A.

  2. 2
    Step 2

    Since |A| = n, we have |A × A| = n².

  3. 3
    Step 3

    A set with n² elements has 2^(n²) subsets.

  4. 4
    Step 4

    Hence, the number of relations on A is 2^(n²), so option (ii) is correct.

Relations on a Set: Essential Recall

1 / 6
Question · Term

What is a relation on A?

Click to reveal
Answer · Definition

Any subset of the Cartesian product A×AA × A.

7. Final Derivation

A=n,A×A=nn=n2,RA×A,#{relations on A}=#{subsets of A×A}=2A×A=2n2.\begin{aligned} |A|&=n,\\ |A\times A|&=n\cdot n=n^2,\\ R&\subseteq A\times A,\\ \#\{\text{relations on }A\} &=\#\{\text{subsets of }A\times A\}\\ &=2^{|A\times A|}\\ &=2^{n^2}. \end{aligned}

Therefore:

(ii) 2n2\boxed{\text{(ii) }2^{n^2}}

Knowledge Check

Question 1 of 4
Q1Single choice

If |A| = n, how many ordered pairs are in A × A?

Explore Related Topics

1

Relational Algebra Equivalence: Why $\pi_A(R) - \pi_A((\pi_A(R) \times S) - R)$ Represents Division

The expression

[ \pi_A(R)-\pi_A\big((\pi_A(R)\times S)-R\big) ]

is a derived form of the relational‑algebra division operator, returning all (A) values that pair with every tuple in (S).

  • Division is defined as (R\div S={a\mid\forall b\in S,;(a,b)\in R}).
  • The formula works by (1) projecting candidate (A) values, (2) forming all required ((A,B)) pairs with (S), (3) subtracting existing pairs to find missing ones, (4) projecting the missing (A) values, and (5) removing them from the candidates.
  • In the example, (R(A,B)={(1,x),(1,y),(2,x),(2,y),(3,x)}) and (S(B)={x,y}) yield (R\div S={1,2}).
  • This construction captures the universal (“for all”) query pattern, unlike selection, join, or simple projection.
2

Lexical Analysis Token Counting: `while(count<=10) count = count + 1;`

The course explains how a lexical analyzer tokenizes the C statement while(count<=10) count = count + 1; and why the standard exam answer is 11 tokens.

  • Keywords, identifiers, literals, operators, and delimiters each count as one token; whitespace is ignored.
  • <= is recognized as a single relational‑operator token due to the longest‑match rule.
  • The full lexical split shows 12 visible symbols, but typical MCQ conventions omit one delimiter, giving 11 tokens.
  • Understanding token categories helps avoid common exam traps such as counting delimiters incorrectly.
3

Binary Search Complexity: Why the Correct Choice is $O(\log n)$