GATE / CS ARCHIVE

GATE CSE 1997 / QUESTION 13(a)

Count injections into a larger set

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

GATE 1997, Q13(a) 1 mark · Descriptive
Report issue

Sets, Relations & Functions

Question 13(a), GATE 1997: Let F be all one-to-one functions from {1,…,n} to {1,…,m}, where m≥n≥1. How many functions belong to F?
Question 13(a), GATE 1997: Let F be all one-to-one functions from {1,…,n} to {1,…,m}, where m≥n≥1. How many functions belong to F?
Tap to enlarge
Answer & solution

Answer: m!/(m−n)! = C(m,n)n!. (no official key was published)

Choose the values of the function in domain order. There are m choices for f(1). Once it is chosen, injectivity excludes that value for f(2), leaving m−1 choices. In general f(i) has m−i+1 choices after the preceding i−1 images have been fixed. The multiplication principle gives

|F| = m(m−1)…(m−n+1) = m!/(m−n)!.

Another way is to choose the n-element image set, in C(m,n) ways, then assign its distinct members to the n labelled domain elements, in n! ways. Hence |F|=C(m,n)n!, the same result.

The distinction between a function and an image set matters: C(m,n) alone discards the order in which the n selected values are assigned to 1,…,n. For n=2,m=3, the image set {1,2} supplies both f(1)=1,f(2)=2 and f(1)=2,f(2)=1. There are six injections overall, not three. At n=1 the answer is m, and at m=n it is n!, the number of permutations, providing simple boundary checks.

Original paper, page 7