GATE / CS ARCHIVE

GATE CSE 2008 / QUESTION 79

Length-five strings with no consecutive zeros

Discrete Mathematics · Combinatorics & Counting · Full GATE CSE 2008 paper

GATE 2008, Q79 2 marks · MCQ
Report issue

Combinatorics & Counting

Question 79, GATE 2008: Let xₙ count binary strings of length n containing no consecutive zeros. What is x₅?

(A) 5
(B) 7
(C) 8
(D) 16
Question 79, GATE 2008: Let xₙ count binary strings of length n containing no consecutive zeros. What is x₅?

(A) 5
(B) 7
(C) 8
(D) 16
Question 79, GATE 2008: Let xₙ count binary strings of length n containing no consecutive zeros. What is x₅?

(A) 5
(B) 7
(C) 8
(D) 16
Tap to enlarge
Your answer
Answer & solution

Answer: 13; no listed option (no official key was published)

1. The initial counts are x0=1 for the empty string and x1=2 for 0 and 1. The recurrence from Q78 gives x2=3, x3=5, x4=8 and x5=13.
2. Independently, count by the number of nonadjacent zeros: binomial(6,0)+binomial(5,1)+binomial(4,2)+binomial(3,3)=1+5+6+1=13. The scan lists 5,7,8,16; none is correct.
3. Do not use Fibonacci seeds 1,1, which count the wrong objects.

Original paper, page 17