Skip to content

GATE CS 1999 Q1.3 — Combinatorics: Counting, Recurrence Relations, Generating Functions

Explain with AI

The number of binary strings of nn zeros and kk ones in which no two ones are adjacent is

Choose one option
View worked solution

Answer: D

We want to find the number of binary strings containing nn zeros and kk ones such that no two ones are adjacent.

We can solve this using the gap method:

  1. First, arrange the nn zeros in a line. This creates n+1n + 1 available slots (gaps) where the ones can be placed (one slot before the first zero, n−1n-1 slots between the zeros, and one slot after the last zero):
    _  0  _  0  _  …  _  0  _\_ \; 0 \; \_ \; 0 \; \_ \; \dots \; \_ \; 0 \; \_
  2. To ensure that no two ones are adjacent, we must place at most one '1' in any of these n+1n + 1 gaps.
  3. Since we have kk ones to place, we need to choose kk distinct gaps out of the n+1n + 1 available gaps.

The number of ways to choose kk gaps from n+1n + 1 is given by the binomial coefficient:

(n+1k)orn+1Ck\binom{n+1}{k} \quad \text{or} \quad ^{n+1}C_k

Comparing this with the given options:

  • A: n−1Ck^{n-1}C_k (Incorrect)
  • B: nCk^nC_k (Incorrect)
  • C: nCk+1^nC_{k+1} (Incorrect)

Therefore, the correct option is D (None of the above).

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Combinatorics: Counting, Recurrence Relations, Generating Functions questions