GateAI
Regular Expressions and Finite Automata

GATE CSE 2021 Set 2 · Q17

NAT1 markEasy

Time

Consider the following deterministic finite automaton (DFA). The number of strings of length 8 accepted by the above automaton is ________.

GATE CSE 2021 Set 2 Q17 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 256

Regular Expressions and Finite Automata

Let us trace the DFA from the start state q0q_0:

  1. Step 1 (Length 1): On reading the first symbol (00 or 11), the automaton transitions from the start state to one of the two level-1 states.

  2. Step 2 (Length 2): On reading the second symbol (00 or 11), transitions from any level-1 state lead to one of the two level-2 states.

  3. Step 3 (Length 3): On reading the third symbol (00 or 11), every transition from either level-2 state leads to the single final/accepting state (with the double circle).

  4. Steps 4 to 8: The final state has a self-loop on both input symbols {0,1}\{0, 1\}. Once reached, the automaton remains in the accepting state for any subsequent symbol.

Thus, every binary string of length ≥3\ge 3 is accepted by this DFA.

The total number of binary strings of length 8 is:

28=2562^8 = 256

Since all of them are accepted, the answer is 256.

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 Regular Expressions and Finite Automata previous year question is Q17 of the GATE CSE 2021 Set 2 paper. Find more GATE CSE PYQs on Regular Expressions and Finite Automata in Theory of Computation, 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 Regular Expressions and Finite Automata 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.

Regular Expressions and Finite Automata in GATE CSE

Regular Expressions and Finite Automata has 41 GATE CSE PYQs across 24 papers from 2011 to 2026. 5 of them are 1-mark NAT questions like this one, and GATE CSE 2021 Set 2 has 3.

How GATE tests Regular Expressions and Finite Automata

More from GATE CSE 2021 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2021 Set 2 · Q17 · NAT

Consider the following deterministic finite automaton (DFA). The number of strings of length 8 accepted by the above automaton is …

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.