StreakPeaked· Practice

ExamsGATEEngineering Mathematics

Let aₙ be the number of n-bit strings that do NOT contain two consecutive 1s. Which one of the following is the recurrence relation for aₙ?

  1. aₙ = aₙ₋₁ + 2aₙ₋₂
  2. aₙ = aₙ₋₁ + aₙ₋₂
  3. aₙ = 2aₙ₋₁ + aₙ₋₂
  4. aₙ = 2aₙ₋₁ + 2aₙ₋₂

Correct answer: aₙ = aₙ₋₁ + aₙ₋₂

Solution

The correct option is right because an n-bit string that does not contain two consecutive 1s can be formed by either appending a '0' to an (n-1)-bit valid string or appending '10' to an (n-2)-bit valid string, leading to the recurrence relation aₙ = aₙ₋₁ + aₙ₋₂.

Related GATE Engineering Mathematics questions

⚔️ Practice GATE Engineering Mathematics free + battle 1v1 →