GATE / CS ARCHIVE

GATE CSE 1997 / QUESTION 13(b)

Count injections whose image contains one

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

GATE 1997, Q13(b) 2 marks · Descriptive
Report issue

Sets, Relations & Functions

Question 13(b), GATE 1997: Let F be all one-to-one functions from {1,…,n} to {1,…,m}, where m≥n≥1. How many f satisfy f(i)=1 for some domain element i?
Question 13(b), GATE 1997: Let F be all one-to-one functions from {1,…,n} to {1,…,m}, where m≥n≥1. How many f satisfy f(i)=1 for some domain element i?
Question 13(b), GATE 1997: Let F be all one-to-one functions from {1,…,n} to {1,…,m}, where m≥n≥1. How many f satisfy f(i)=1 for some domain element i?
Tap to enlarge
Answer & solution

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

Because f is one-to-one, the codomain value 1 can occur at exactly one domain position if it occurs at all. Choose that position i in n ways. The remaining n−1 domain elements must receive distinct values from the other m−1 codomain values, giving (m−1)!/(m−n)! assignments. Thus the total is

n·(m−1)!/(m−n)!.

There is no double-counting: each satisfying function has a unique preimage of 1, so it appears in exactly one of the n cases. Equivalently, choose its image set to contain 1 and n−1 other values, then order the n image values over the domain. This gives C(m−1,n−1)n!, equal to the first expression.

As a probability check, divide by all m!/(m−n)! injections. The fraction whose image contains a specified codomain value is n/m, consistent with an image set containing n out of m values symmetrically. At n=1 there is only one satisfying function, f(1)=1. At n=m every injection is a bijection, so all n! functions qualify. These checks also show why simply multiplying the total by 1/m would be wrong: any of n domain positions, not a fixed one, may map to 1.

Original paper, page 7