8.1k views
2 votes
let S be the set of bit strings of length n having no two consecutive zeros. Let aₙ denote the cardinality of S. Find a recurrence relation for aₙ

User Tonywei
by
7.4k points

1 Answer

5 votes

Final answer:

The recurrence relation for the number of length n bit strings with no two consecutive zeros is aₙ = aₙ₋₁ + aₙ₋₂, similar to the Fibonacci sequence, with different initial conditions.

Step-by-step explanation:

To find a recurrence relation for the number of bit strings of length n that have no two consecutive zeros, denoted as an, we start by considering the two possibilities for how a string of length n can end:

  1. If it ends in a 1, the preceding n-1 bits can be any string counted by an-1.
  2. If it ends in a 0, it must be preceded by a 1 (since we cannot have two consecutive zeros), and the remaining n-2 bits can be any string counted by an-2.

Therefore, the recurrence relation can be expressed as:

an = an-1 + an-2

Note that this is similar to the Fibonacci sequence, with different initial conditions specific to our problem. We also need to establish base cases; for example, we know that:

  • a1 = 2 (since both '0' and '1' are valid strings of length 1)
  • a2 = 3 (with valid strings '00', '01', and '10')
User Ophir Radnitz
by
7.4k points