Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q35 — Regular Expressions and Finite Automata

Explain with AI

Consider the alphabet Σ={0,1}\Sigma = \{0, 1\}, the null/empty string λ\lambda and the set of strings X0,X1, and X2X_0, X_1, \text{ and } X_2 generated by the corresponding non-terminals of a regular grammar. X0,X1, and X2X_0, X_1, \text{ and } X_2 are related as follows.

  • X0=1X1X_0 = 1 X_1
  • X1=0X1+1X2X_1 = 0 X_1 + 1 X_2
  • X2=0X1+{λ}X_2 = 0 X_1 + \{ \lambda \}

Which one of the following choices precisely represents the strings in X0X_0?

Choose one option
View worked solution

Answer: C

To find the regular expression representing the set of strings X0X_0, we can solve the given system of linear equations using Arden's Theorem.

The given equations are:

  1. X0=1X1X_0 = 1 X_1
  2. X1=0X1+1X2X_1 = 0 X_1 + 1 X_2
  3. X2=0X1+λX_2 = 0 X_1 + \lambda

Step 1: Substitute X2X_2 into the equation for X1X_1

X1=0X1+1(0X1+λ)=0X1+10X1+1=(0+10)X1+1\begin{aligned} X_1 &= 0 X_1 + 1 (0 X_1 + \lambda) \\ &= 0 X_1 + 10 X_1 + 1 \\ &= (0 + 10) X_1 + 1 \end{aligned}

Step 2: Apply Arden's Theorem

Arden's Theorem states that if we have an equation of the form R=PR+QR = P R + Q (where λ∉P\lambda \notin P), then it has a unique solution given by R=P∗QR = P^* Q.

Comparing X1=(0+10)X1+1X_1 = (0 + 10) X_1 + 1 with R=PR+QR = P R + Q:

  • P=(0+10)P = (0 + 10)
  • Q=1Q = 1

Applying the theorem, we get:

X1=(0+10)∗1X_1 = (0 + 10)^* 1

Step 3: Substitute X1X_1 into the equation for X0X_0

X0=1X1=1(0+10)∗1X_0 = 1 X_1 = 1 (0 + 10)^* 1

This matches the expression given in Option C.

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

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