GATE | GATE CS 2008 | Question 78
Let xn denote the number of binary strings of length n that contain noconsecutive 0s. Which of the following recurrences does Xn satisfy?
Answer: (D)
Explanation:
- For n = 1 i.e. binary strings of length 1, strings are ‘0’, ‘1’.
So, X1 = 2 - For n = 2 i.e. binary strings of length 2, strings are ’01’ , ’10’ , ’11’.
(here string ’00’ will be rejected because it has consecutive zeros).
So, X2 = 3 - For n = 3 i.e. binary strings of length 3, strings are ‘010’ , ‘011’ , ‘101’ , ‘110’ , ‘111’ .
0 01 (rejected)
0 10
0 11
1 01
1 10
1 11
So, X3 = 5
This shows that X3 = X2 + X1
Therefore, X(n) = X(n – 1) + X(n – 2)
Please comment below if you find anything wrong in the above post.
Recommended Posts:
- GATE | GATE CS 2008 | Question 50
- GATE | GATE CS 2008 | Question 66
- GATE | GATE CS 2008 | Question 67
- GATE | GATE CS 2008 | Question 68
- GATE | GATE CS 2008 | Question 69
- GATE | GATE CS 2008 | Question 70
- GATE | GATE CS 2008 | Question 71
- GATE | GATE CS 2008 | Question 72
- GATE | GATE CS 2008 | Question 73
- GATE | GATE CS 2008 | Question 74
- GATE | GATE CS 2008 | Question 75
- GATE | GATE CS 2008 | Question 76
- GATE | GATE CS 2008 | Question 77
- GATE | GATE CS 2008 | Question 64
- GATE | GATE CS 2008 | Question 51




