GATE Computer ScienceVery hardGATE CS (PYQ pattern)
How many injective functions f : {1, 2, 3, 4} → {1, 2, …, 7} satisfy f(i) ≠ i for every i?
- A. 480
- B. 840
- C. 489
- D. 465
Correct answer: D. 465
Total injections 7·6·5·4 = 840. Inclusion-exclusion over the set of fixed positions: Σ(−1)ᵏ C(4,k)·P(7 − k, 4 − k) = 840 − 4·120 + 6·30 − 4·6 + 1 = 465.
More Discrete Mathematics questions
- How many relations R on {1, 2, 3} have the property that the transitive closure of R is the full relation {1, 2, 3} × {1, 2, 3} (all 9…
- How many functions f : {1, …, 6} → {1, …, 6} have an image with exactly 3 elements and no fixed point (f(x) ≠ x for all x)?
- How many surjective functions f : {1, …, 6} → {a, b, c} satisfy f(1) = f(2)?
- How many down-sets (order ideals, including the empty set) does the divisor poset (D₁₈₀, |) have? (180 = 2²·3²·5)
- Consider the 3 × 3 grid poset {1,2,3} × {1,2,3} with the product order. How many of its linear extensions list (1,3) before (2,1)?
- How many non-empty sublattices (subsets closed under both join and meet) does the diamond lattice M₃ have?