Question

Let XX and YY denote the sets containing 2 and 20 distinct objects respectively and FF denote the set of all possible functions defined from XX to YY. Let ff be randomly chosen from FF. The probability of ff being one-to-one is _____.

Official answer and solution
Official answer
0.95
From
Official GATE 2015 answer key

Solution

Calculate the ratio of injective (one-to-one) functions to total functions from XX to YY.

We are given:

  • ∣X∣=2|X| = 2
  • ∣Y∣=20|Y| = 20
  1. Total number of functions from XX to YY:
∣F∣=∣Y∣∣X∣=202=400.|F| = |Y|^{|X|} = 20^2 = 400.
  1. Number of one-to-one (injective) functions:
  • The first element of XX can map to any of the 20 elements in YY.
  • The second element of XX must map to any of the remaining 19 distinct elements in YY.
Injective functions=20×19=380.\text{Injective functions} = 20 \times 19 = 380.
  1. Probability:
P(one-to-one)=380400=3840=1920=0.95.P(\text{one-to-one}) = \frac{380}{400} = \frac{38}{40} = \frac{19}{20} = 0.95.
Final answer

0.95

Common trap

Dividing combinations (202)\binom{20}{2} by 20220^2 without accounting for domain permutations.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 2
Question
64 of 65, printed as CS Q.54
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.