• S
    SwaseekhGATE Preparation
General
  • Dashboard
  • Syllabus
  • Questions
  • Aptitude
  • Mock Tests
  • TCS NQT 2026
Account
  • Pricing
  • Contact
  1. GATE CS
  2. PYQs
  3. Discrete Mathematics

We are given 5 distinct balls B_1, B_2, B_3, B_4, B_5 and 5 distinct cells C_1, C_2, C_3, C_4, C_5, and each cell contains exactly one ball. In how many ways can the balls be placed in the cells such that B_i is not in cell C_i for 1 <= i <= 5? A. 44 B. 96 C. 120 D. 3125

GATE 2004 · Discrete Mathematics · Balls In Bins · medium

Answer: 44

  1. Recall derangement formula via inclusion-exclusion: D(5) = 5! * (1 - 1 + 1/2 - 1/6 + 1/24 - 1/120) = 120 * (1 - 1 + 0.5 - 0.1667 + 0.0417 - 0.00833)
  2. Compute D(5) using exact fractions: Term k=0: 120; k=1: -120; k=2: +C(5,2)*3! = 10*6 = 60; k=3: -C(5,3)*2! = 10*2 = 20; k=4: +C(5,4)*1! = 5; k=5: -C(5,5)*0! = 1. Sum = 120 - 120 + 60 - 20 + 5 - 1 = 44.
  3. State the answer: The number of ways to place the balls so that no ball is in its own cell is 44. This matches option A.