GATE / CS ARCHIVE

GATE CSE 2015 SET 2 / QUESTION 60

GATE CSE 2015 Set 2 Q60

Theory of Computation · Regular Expressions & Languages · Full GATE CSE 2015 Set 2 paper

GATE 2015 Set 2, Q60 2 marks · MCQ
Report issue

Regular Expressions & Languages

Question 60, GATE 2015: Solve language equations X0=1X1, X1=0X1+1X2, X2=0X1+{ε}, where concatenation and union have their regular-expression meanings. Determine X0; option C is 1(0+10)*1. Options: A 10(0*+(10)*)1; B 10(0*+(10)*)*1; C 1(0+10)*1; D 10(0+10)*1+110(0+10)*1.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Substitute X2=0X1+{epsilon} into X1=0X1+1X2 to obtain X1=(0+10)X1+1. Since the repeated-prefix language excludes epsilon, Arden’s lemma gives X1=(0+10)*1. Then X0=1X1=1(0+10)*1, C. The source’s X2 right side is 0X1, not 0X2.

Substitute X2 into X1: X1=0X1+1(0X1+ε)=(0+10)X1+1. Arden’s lemma says X=AX+B has unique solution A*B when ε is not in A. Here A={0, 10} excludes ε, giving X1=(0+10)*1. Prefixing the initial equation by 1 yields X0=1(0+10)*1. This expression includes 11 via zero repetitions and may add either 0 or 10 in the middle; using the wrong variable in the X2 equation would yield a different language.

Original paper, page 49 · Answer key