Question

Consider the alphabet Σ={0,1}\Sigma = \{0, 1\}, the null/empty string λ\lambda and the sets of strings X0,X1X_0, X_1, and X2X_2 generated by the corresponding non-terminals of a regular grammar. X0,X1X_0, X_1, and X2X_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
Official answer and solution
Official answer
C
From
Official GATE 2015 answer key

Solution

Solve the system of regular grammar equations using Arden's Theorem.

The system of equations is:

  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\}

Substitute equation (3) into equation (2):

X1=0X1+1(0X1+λ)X_1 = 0 X_1 + 1(0 X_1 + \lambda)
X1=0X1+10X1+1X_1 = 0 X_1 + 10 X_1 + 1
X1=(0+10)X1+1.X_1 = (0 + 10) X_1 + 1.

Applying Arden's Theorem (X=AX+B  ⟹  X=A∗BX = AX + B \implies X = A^*B since λ∉A\lambda \notin A):

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

Now substitute X1X_1 into equation (1):

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

This matches option C.

Final answer

C

Common trap

Incorrectly distributing (0+10)∗(0 + 10)^* into 0∗+(10)∗0^* + (10)^*, which is not equivalent to (0+10)∗.(0 + 10)^*.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 2
Question
45 of 65, printed as CS Q.35
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.