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?

Choose one option
Official answer and solution
Official answer
D
From
Official GATE 2021 answer key

Solution

Construct the state transitions of the minimal DFA that detects the pattern 011 at the end of the input string.

The language LL consists of all binary strings ending in 011011. The minimal DFA requires 4 states corresponding to the longest matched prefix of 011011 that appears as a suffix of the input read so far:

  • State q0q_0 (start state): suffix ϵ\epsilon
  • State q1q_1: suffix ending in 00
  • State q2q_2: suffix ending in 0101
  • State q3q_3 (accept state): suffix ending in 011011

Verify the transitions:

  • From q0q_0: on 0 go to q1q_1; on 1 stay in q0q_0.
  • From q1q_1: on 0 stay in q1q_1 (suffix is still 0); on 1 go to q2q_2 (suffix is 01).
  • From q2q_2: on 0 go to q1q_1 (suffix 010 ends in 0); on 1 go to q3q_3 (suffix is 011).
  • From q3q_3: on 0 go to q1q_1 (suffix 0110 ends in 0); on 1 go to q0q_0 (suffix 0111 has no overlap with 011, so it resets to ϵ\epsilon).

DFA diagram D faithfully implements these transitions with q3q_3 as the sole accepting state.

Final answer

D

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2021 Computer Science and Information Technology (CS, Set-1)
Question
48 of 65, printed as CS Q.38
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.