Skip to content
Official PYQ · 2023

GATE CS 2023 Q4 — Regular Expressions and Finite Automata

Explain with AI

Consider the Deterministic Finite-state Automaton (DFA\text{DFA}) A\mathcal{A} shown below. The DFA\text{DFA} runs on the alphabet {0,1}\{0,1\}, and has the set of states {s,p,q,r}\{s, p, q, r\}, with ss being the start state and pp being the only final state.

Which one of the following regular expressions correctly describes the language accepted by A?\mathcal{A}? 

Choose one option
View worked solution

Answer: C

To find the regular expression accepted by the DFA A\mathcal{A}, let us analyze the state transitions from the diagram:

  • Start State: ss
  • Final State: pp
  • Trap State: rr (any transition to rr cannot reach the final state pp)

Let's trace the transitions step-by-step:

  1. Initial step: To reach the final state pp from the start state ss, the first symbol must be 11 (δ(s,1)=p\delta(s, 1) = p). If the first symbol is 00, the DFA transitions to the trap state rr. Thus, every accepted string must start with 11.
  2. Behavior at state pp: Once we are at the final state pp, we can loop back to pp in two ways:
    • By reading a 00 directly: δ(p,0)=p\delta(p, 0) = p.
    • By reading 1111: δ(p,1)=q\delta(p, 1) = q and then δ(q,1)=p\delta(q, 1) = p.
    Any other transition from qq (such as reading a 00) leads to the trap state rr.

Thus, from state pp, we can repeat any sequence of 00 or 1111 any number of times and remain in the final state pp. This loop behavior is represented by the regular expression (0+11)∗(0 + 11)^*.

Combining the initial step and the loop behavior, the regular expression for the language accepted by the DFA is:

1(0+11)∗1(0 + 11)^*

Therefore, the correct option is C.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions