GATE / CS ARCHIVE

GATE CSE 2002 / QUESTION 3(b)

Count self-maps of a finite set

Discrete Mathematics · Sets, Relations & Functions · Full GATE CSE 2002 paper

GATE 2002, Q3(b) Descriptive
Report issue

Sets, Relations & Functions

Question 3(b), 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(b), 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_f = n^n (no official key was published)

1. Apply the definition of a total function. For every element x of the n-element set A, a function f:A → A must select exactly one image f(x). An element may not be left without an image, unlike an arbitrary relation.

2. Count the image choices. There are n possible values of f(x), because the codomain is also A. The images of different domain elements need not be distinct: the question counts all functions, not only injective functions.

3. Apply the product rule over the n domain elements. Independent choices give Nf = n × n × ⋯ × n = nn, with n factors.

4. Check a small example. For A = {a,b}, the ordered pair (f(a),f(b)) can be (a,a), (a,b), (b,a), or (b,b), giving 4 = 2² functions. Using n! would incorrectly discard the two constant functions.

Original paper, page 6