StreakPeaked· Practice

ExamsGATETechnical

Consider the following deterministic finite automaton (DFA) defined over the alphabet \(\Sigma=\{a,b\}\). Identify which of the following language(s) is/are accepted by the given DFA.

  1. The set of all strings containing an even number of b’s.
  2. The set of all strings containing the pattern bab.
  3. The set of all strings ending with the pattern bab.
  4. The set of all strings not containing the pattern aba.

Correct answer: The set of all strings ending with the pattern bab.

Solution

The DFA is structured to accept exactly those strings whose last three symbols are \(bab\). Such automata keep track of the longest relevant suffix seen so far. Therefore the accepted language is the set of strings ending with \(bab\).

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →