GATE / CS ARCHIVE

SIMILAR QUESTIONS / DISCRETE MATHEMATICS

Count unconstrained functions by independent image choices

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

1 mark · MCQ
Report issue

Functions into a power set

Sets, Relations & Functions

Question 2, GATE 2006: Sets X,Y,Z have cardinalities x,y,z. Let W=X×Y and E be the power set of W. How many functions Z→E exist? The reproduced options use uppercase Z where the cardinality z is intended.
Options:
(A) z^(2^(xy))
(B) z·2^(xy)
(C) z^(2^(x+y))
(D) 2^(xyz)
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. The Cartesian product has xy elements, so its power set has 2xy elements. For each of the z domain elements, independently choose one image.

2. This gives(2xy)z=2xyz, option D, with the usual empty-domain convention.

3. Teaching check: For one argument in Z there are 2xy possible output subsets, including the empty subset. Choosing images for different arguments does not impose injectivity or surjectivity. This is the general counting rule |codomain|^|domain|, not |domain|^|codomain|.

Original paper, page 1

Descriptive
Report issue

Count self-maps of a finite set

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

1 mark · MCQ
Report issue

Counting all functions

Combinatorics & Counting

Question 1.8, GATE 1998: Count functions from an m-element domain to an n-element codomain among m+n, m^n, n^m, mn.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Each of the m domain elements independently chooses one of n images. Multiplying n choices m times yields nm. Different domain elements may share an image because injectivity is not required. Thus C, not mn, which would count functions in the reverse direction. With an empty domain there is one empty function; the usual counting formula is interpreted accordingly.

Original paper, page 1