GateAI
Combinatorics

GATE CSE 2015 Set 1 · Q49

MCQ2 marksMedium

Time

Let ana_n represent the number of bit strings of length nn containing two consecutive 1s. What is the recurrence relation for ana_n?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) an-2 + an-1 + 2n-2

Combinatorics

To construct a bit string of length nn containing two consecutive 1s, we can condition on how the string ends:

  1. The string ends in 00: The remaining prefix of length n−1n-1 must contain two consecutive 1s. The number of such strings is an−1a_{n-1}.

  2. The string ends in 0101: The remaining prefix of length n−2n-2 must contain two consecutive 1s. The number of such strings is an−2a_{n-2}.

  3. The string ends in 1111: The condition of having two consecutive 1s is already satisfied by the suffix 11. Hence, the preceding n−2n-2 bits can be any arbitrary bit string. The number of such strings is 2n−22^{n-2}.

Summing these mutually exclusive and exhaustive cases, we get the recurrence relation:

an=an−1+an−2+2n−2a_n = a_{n-1} + a_{n-2} + 2^{n-2}

Hence, option A is the correct answer.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Combinatorics previous year question is Q49 of the GATE CSE 2015 Set 1 paper. Find more GATE CSE PYQs on Combinatorics in Engineering Mathematics, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Combinatorics PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Combinatorics in GATE CSE

Combinatorics has 19 GATE CSE PYQs across 15 papers from 2012 to 2025. 5 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2015 Set 1.

How GATE tests Combinatorics

More from GATE CSE 2015 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 1 · Q49 · MCQ

Let an represent the number of bit strings of length n containing two consecutive 1s. What is the recurrence relation for an?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.