Skip to content
GATEiit

GATE CSE 2021 Set 1 Q48: DFA for binary strings ending in 011

Question

Consider the following language.

L={w∈{0,1}∗∣w ends with the substring 011}L = \{w \in \{0, 1\}^* \mid w \text{ ends with the substring } 011\}

Which one of the following deterministic finite automata accepts LL?

Four four-state DFAs labelled (A) to (D) over {0,1} with states for prefixes 0, 01 and 011 (accepting). They differ at the accepting state: (A) loops on 1 and returns to the 0-state on 0; (B) loops on 0,1; (C) goes to the 01-state on 1 and the 0-state on 0; (D) goes back to the start state on 1 and the 0-state on 0
Tap the figure to enlarge

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
Show answer and explanation

Answer: D (official GATE 2021 final answer key)

Concept used: States track the longest suffix that is a prefix of 011; from the accepting state, 0 goes to the "seen 0" state and 1 restarts.

First step: Check each DFA on the accepting state: after 011, reading 1 must leave the accepting state (0111 does not end in 011), reading 0 must go to the "0" state.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2021 Set 1 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key