Q159: Strings of length n from a binary alphabet?

Question 159: Given a binary alphabet {0,1}, how many different strings are possible of length n, which start with ‘0’ and end with ‘1’?

Options:

  1. 2^(n-2)
  2. n-2
  3. 2^n
  4. 2^(n-1)

Solution: The correct answer is first one. As first and last place is already fixed, there are n-2 places where 0 or 1 can appear. Hence, 2^(n-2) different strings are possible.