GateAI
Regular Expressions and Finite Automata

GATE CSE 2024 Set 2 · Q41

MCQ2 marksMedium

Time

Let MM be the 5-state NFA with ϵ\epsilon-transitions shown in the diagram below. Which one of the following regular expressions represents the language accepted by MM ?

GATE CSE 2024 Set 2 Q41 diagram

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) 0* + (1 + 0(00)*)(11)*

Regular Expressions and Finite Automata

To determine the regular expression for the language accepted by the NFA MM, we analyze the paths from the start state 11 to each of the accepting states 22 and 55 [1]:

  1. Paths reaching state 22:

    • The start state 11 reaches state 22 via an ϵ\epsilon-transition (1→ϵ21 \xrightarrow{\epsilon} 2).

    • From state 22, we can alternate between state 22 and state 33 via 2→03→022 \xrightarrow{0} 3 \xrightarrow{0} 2, which corresponds to the loop (00)∗(00)^*.

    • Thus, the set of strings accepted at state 22 is (00)∗(00)^*.

  2. Paths reaching state 55:

    • Via state 44: 1→ϵ4→151 \xrightarrow{\epsilon} 4 \xrightarrow{1} 5, giving string 11. Once at state 55, there is a loop 5→14→155 \xrightarrow{1} 4 \xrightarrow{1} 5, giving (11)∗(11)^*. The strings reaching state 55 along this path are represented by 1(11)∗1(11)^*.

    • Via state 22 and state 33: 1→ϵ2→(00)∗2→03→ϵ51 \xrightarrow{\epsilon} 2 \xrightarrow{(00)^*} 2 \xrightarrow{0} 3 \xrightarrow{\epsilon} 5. This produces strings of the form 0(00)∗0(00)^*. From state 55, looping gives (11)∗(11)^*, so strings along this path are represented by 0(00)∗(11)∗0(00)^*(11)^*.

    • Combining both paths to state 55, we get (1+0(00)∗)(11)∗(1 + 0(00)^*)(11)^*.

  3. Total language accepted by MM: L(M)=L(at state 2)+L(at state 5)=(00)∗+(1+0(00)∗)(11)∗=(00)∗+1(11)∗+0(00)∗(11)∗=(00)∗+0(00)∗+1(11)∗+0(00)∗(11)+=0∗+(1+0(00)∗)(11)∗\begin{aligned} L(M) &= L(\text{at state } 2) + L(\text{at state } 5) \\ &= (00)^* + (1 + 0(00)^*)(11)^* \\ &= (00)^* + 1(11)^* + 0(00)^*(11)^* \\ &= (00)^* + 0(00)^* + 1(11)^* + 0(00)^*(11)^+ \\ &= 0^* + (1 + 0(00)^*)(11)^* \end{aligned}

Hence, the correct regular expression is **0∗+(1+0(00)∗)(11)∗0^* + (1 + 0(00)^*)(11)^*, which corresponds to option (B)** [1].

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 Q41 of the GATE CSE 2024 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. 10 of them are 2-mark MCQs like this one, and GATE CSE 2024 Set 2 has 3.

How GATE tests Regular Expressions and Finite Automata

More from GATE CSE 2024 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2024 Set 2 · Q41 · MCQ

Let M be the 5-state NFA with -transitions shown in the diagram below. Which one of the following regular expressions represents the language accepted by M ?

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.