Skip to content
Official PYQ · 2014

GATE CS 2014 Set 1 Q36 — Regular Expressions and Finite Automata

Explain with AI

Which of the regular expressions given below represent the following DFA?

  1. 0∗1(1+00∗1)∗0^*1(1+00^*1)^*
  2. 0∗1∗1+11∗0∗10^*1^*1+11^*0^*1
  3. (0+1)∗1(0+1)^*1
Choose one option
View worked solution

Answer: B

The given DFA accepts the language of all binary strings ending with 11. This language is directly represented by the regular expression III: (0+1)∗1(0+1)^*1.

Let us analyze the equivalence of the other expressions:

  • Expression I: 0∗1(1+00∗1)∗0^*1(1+00^*1)^*
    • Every string generated by this expression must end in 11 because the initial part 0∗10^*1 ends in 11, and any string chosen from the Kleene star (1+00∗1)∗(1+00^*1)^* also ends in 11.
    • It can generate any string ending in 11. For example:
      • 1  ⟹  ϵ⋅1⋅ϵ1 \implies \epsilon \cdot 1 \cdot \epsilon
      • 01  ⟹  0⋅1⋅ϵ01 \implies 0 \cdot 1 \cdot \epsilon
      • 101  ⟹  ϵ⋅1⋅(01)101 \implies \epsilon \cdot 1 \cdot (01)
    • Thus, Expression I is equivalent to (0+1)∗1(0+1)^*1.
  • Expression II: 0∗1∗1+11∗0∗10^*1^*1 + 11^*0^*1
    • Consider the string w=0101w = 0101, which ends in 11 and must be accepted.
    • The first term 0∗1∗10^*1^*1 cannot generate 01010101 because no 00 can appear after a 11.
    • The second term 11∗0∗111^*0^*1 cannot generate 01010101 because it must start with 11.
    • Since 01010101 is not represented, Expression II is incorrect.

Hence, only I and III represent the DFA.

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

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