Counting Relations on a Set with Elements
Let be a finite set containing elements. The number of relations on is:
Therefore, the correct answer is:
A relation on is any subset of the Cartesian product . Since has elements, contains 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
-
Cartesian Products and Relations Definition - Defines relations as subsets of Cartesian products and derives the counting formula. ↩
-
Cartesian Products and Relations Definition - Explains that each ordered pair has two choices: inclusion or exclusion. ↩
1. What Is a Relation on ?
A relation on a set is defined as a subset of :
The phrase “on ” means that both components of every ordered pair come from .
If
then
For example, if
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 Range2. Counting the Ordered Pairs
The first component of an ordered pair can be selected in ways, because there are elements in .
For each first component, the second component can also be selected in ways.
By the multiplication principle:
This is the key observation. There are possible ordered pairs that could potentially be included in a relation.
Deriving the Number of Relations
- 1Step 1
A relation on A must be a subset of A × A. Since A has n elements, the Cartesian product contains n² ordered pairs.
- 2Step 2
Every ordered pair in A × A has exactly two possibilities: it is included in the relation, or it is not included.
- 3Step 3
The choices are independent for all n² ordered pairs, so the total number is 2 multiplied by itself n² times.
- 4Step 4
Therefore, the number of relations is 2^(n²).
- 5Step 5
Among the given choices, the correct answer is (ii) 2^(n²).
3. Why the Exponent Is
A common mistake is to use as the exponent. However, a relation is made from ordered pairs, not individual elements.
There are:
- choices for the first member of a pair;
- choices for the second member;
- therefore possible ordered pairs.
The relation is then chosen from these pairs. In other words, every relation is one subset of :
The power set of a set containing elements has subsets. Taking gives:
Footnotes
-
Ch. 1 Key Concepts - OpenStax Contemporary Mathematics - States that a finite set with elements has 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:
Let
Then
There is one possible ordered pair, and it can either be included or excluded:
- ;
- .
Therefore:
Example 2:
Let
Then:
There are possible ordered pairs. Each can be selected or not selected, so:
Thus, a two-element set has relations on it.
Example 3:
For a set with three elements:
Hence:
Example 4:
For a set with four elements:
Therefore:
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
| Option | Meaning | Correct? |
|---|---|---|
| Number of ordered pairs in | No | |
| Number of subsets of | Yes | |
| Number of subsets of a set with elements | No | |
| Twice the number of elements | No |
The expression 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 elements is .
Subset
Cardinality
Multiplication principle
Common Questions and Misconceptions
6. Relation Properties Do Not Change the Basic Definition
The formula counts every possible relation on . Additional conditions produce smaller classes of relations.
- A relation is reflexive if every must be included.
- A relation is symmetric if including requires including .
- 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 -element set is:
because the diagonal pairs are forced to be included, while the remaining pairs may be chosen freely.
However, unless the question specifies a property, use the unrestricted count:
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
- 1Step 1
A relation on A is any subset of A × A.
- 2Step 2
Since |A| = n, we have |A × A| = n².
- 3Step 3
A set with n² elements has 2^(n²) subsets.
- 4Step 4
Hence, the number of relations on A is 2^(n²), so option (ii) is correct.
Relations on a Set: Essential Recall
7. Final Derivation
Therefore:
Knowledge Check
If |A| = n, how many ordered pairs are in A × A?
Explore Related Topics
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.
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.
Binary Search Complexity: Why the Correct Choice is $O(\log n)$