m identical balls are to be placed in n distinct bags. You are given that m >= n and each bag must contain at least 1 ball. In how many ways can the balls be distributed? A. C(m-1, n-1) B. C(m-n+1, n-1) C. C(m-1, m-n) D. C(m+n-1, m-n)

GATE 2003 · Discrete Mathematics · Balls In Bins · medium

Answer: C(m-1, n-1)

  1. Substitute to remove lower bound: Let y_i = x_i - 1. Then y_1 + y_2 + ... + y_n = m - n, with each y_i >= 0.
  2. Apply stars and bars: Number of non-negative integer solutions to y_1 + ... + y_n = m - n is C((m-n) + n - 1, n - 1) = C(m-1, n-1).
  3. State the answer: The answer is C(m-1, n-1), which matches option A.