Back to the 2022 paper

Module 1: Introduction & Regular Languages

20222m

The minimum number of transitions to reach the final state as per the regular expression:

{a,b}∗baaa \{a, b\}^* baaa

is:

(i) 4
(ii) 5
(iii) 6
(iv) 3

Worked SolutionAI Assisted

Answer

Correct Option: (i) 4

Explanation

Regular expression: {a,b}∗baaa\{a,b\}^* baaa — language is all strings over {a,b}\{a,b\} ending with suffix baaa.

To accept, a DFA must detect suffix b a a a (length 4).

Minimal DFA (suffix automaton)

States represent longest suffix of processed prefix that is prefix of baaa:

  • q0q_0: no part matched (or last bb irrelevant)
  • q1q_1: suffix b
  • q2q_2: suffix ba
  • q3q_3: suffix baa
  • q4q_4: suffix baaa (accepting)

Transitions: each new character extends/collapses the match. From q0q_0, on b → q1q_1, on a → q0q_0; etc.

Number of transitions on the shortest path from start q0q_0 to final q4q_4 is 4 (b→a→a→a).

Number of states =5, transitions to reach final =4. Some keys count states=5 as “transitions”, but minimum edge traversals is 4.

Final Answer

4 transitions (5 states) to reach final — Option (i) 4. If counting states, answer is 5.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.