GATE / CS ARCHIVE

SIMILAR QUESTIONS / THEORY OF COMPUTATION

Simplify nested-star regular expressions

4 questions solved the same way, newest first. Back to Theory of Computation

How these are solved

Prove both inclusions by segmenting words into repeated generating blocks and allowing empty factors. Expressions differ, but the operative method is language algebra rather than state minimization.

1 mark · MCQ
Report issue

Equivalent binary regular expressions

Regular Expressions & Languages

Question 14, GATE 2003: Which regular expression denotes the same language as 0*(10*)*? Here + means union. A. (1*0)*1*; B. 0+(0+10)*; C. (0+1)*10(0+1)*; D. None of these.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. For instance, 0010010 splits as 00·100·10 under the given expression. In A it splits into zero-terminated blocks with a final run of ones. B cannot produce the single string 1, and C requires a substring 10 and thus misses ε,0,1. This distinguishes the alternatives without merely appealing to a pattern resemblance.

2. Every binary string can be divided into an initial zero run followed by successive 1-and-zero-run blocks, so 0*(10*)*=Σ*. Likewise(1*0)*1* parses successive zero-terminated blocks followed by a final one run and also gives Σ*. Thus A. The other listed expressions do not cover exactly all binary strings.

Original paper, page 2

1 mark · MCQ
Report issue

Equivalent starred regular expressions

Regular Expressions & Languages

Question 1.4, GATE 2000: Let S=(a+b*)* and T=(a+b)* over {a,b}. Are S and T in a proper-subset relation, equal, or disjoint?
Question 1.4, GATE 2000: Let S=(a+b*)* and T=(a+b)* over {a,b}. Are S and T in a proper-subset relation, equal, or disjoint?
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step 1: Every block allowed inside S is either a or a finite run of b symbols. Concatenating such blocks can produce every word over {a,b}, since individual a and b symbols are both available.

Step 2: No other symbol can appear, so S⊆{a,b}*. The expression T also generates exactly {a,b}*, including ε.

Hence S=T, option C. The inner star on b does not restrict the outer star’s ability to concatenate individual symbols.

Original paper, page 1

1 mark · MCQ
Report issue

Equivalent regular-expression groupings

Regular Expressions & Languages

Question 1.9, GATE 1998: Compare A=(01+1)* and B=((01)*1*)*: proper inclusion, equality, or incomparable?
Tap to enlarge
Your answer
Answer & solution

Answer: D: equality (no official key was published)

Every block in B is a sequence of 01 blocks followed by a sequence of 1 symbols, all of which are permitted individual blocks of A. Thus B⊆A. Conversely B can produce an individual 01 by selecting one occurrence in (01)* and none in 1*, and can produce an individual 1 by the reverse choice. Its outer star concatenates any sequence of these, so A⊆B. Both include the empty string. Therefore A=B, D.

Original paper, page 1

1 mark · MCQ
Report issue

Equivalent unary regular expressions

Regular Expressions & Languages

Question 1.8, GATE 1996: Compare (i)(00)*(ε+0), (ii)(00)*, (iii)0*, and (iv)0(00)*. Which expressions are equivalent?
Tap to enlarge
Your answer
Answer & solution

Answer: C: (i) and (iii) (no official key was published)

Expression (00)* produces every even number of zeros, including zero. Appending either ε or one zero therefore produces every nonnegative length, exactly 0*. Expression (ii) alone excludes odd lengths; expression (iv) produces only odd lengths and excludes ε. Thus only (i) and (iii) describe the same language. Checking both ε and a one-symbol word already distinguishes the parity-restricted alternatives from the full unary language.

Original paper, page 2