GATE Computer ScienceHardGATE CS (PYQ pattern)
How many onto functions f : {1, …, 7} → {a, b, c, d} have exactly one element of the codomain with a single preimage?
- A. 2520
- B. 3150
- C. 1260
- D. 8400
Correct answer: A. 2520
Choose the value with one preimage (4) and that preimage (7). The other 6 elements map onto the remaining 3 values with each value getting at least 2 (it cannot get 1, and it must be hit), so the sizes are 2, 2, 2: 6!/(2!2!2!) = 90. Total 4 × 7 × 90 = 2520.
More Discrete Mathematics questions
- How many functions f : {1, …, 6} → {1, …, 6} satisfy f(f(f(x))) = f(x) for every x?
- How many permutations π of {1, …, 7} satisfy π⁶ = identity but π² ≠ identity?
- What is the largest size of a subset S of {1, 2, …, 40} such that 7 ∈ S and no element of S divides another element of S?
- How many integers from 1 to 1000 are divisible by exactly two of the three numbers 4, 6 and 10?
- A family F of subsets of {1, 2, 3} is union-closed if A ∪ B ∈ F whenever A, B ∈ F. How many union-closed families (including the empty…
- How many ordered pairs (f, g) of functions from {1, 2, 3} to itself satisfy f∘g = g∘f?