The GATE Grind

GATE 2012 CS (CS1) – Question 35

Theory of Computation · Regular Expressions and Finite Automata · 1 mark · Multiple choice

L={ab,aa,baa}. Which strings belong to L*? 1: abaabaaabaa; 2: aaaabaaaa; 3: baaaaabaaaab; 4: baaaaabaa.

  1. 1,2,3
  2. 2,3,4
  3. 1,2,4
  4. 1,3,4

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) 1,2,4

Explanation

Strings 1,2,4 admit tokenizations: ab·aa·baa·ab·aa; aa·aa·baa·aa; baa·aa·ab·aa respectively. String 3 has no valid factorization into ab,aa,baa (checking possible next tokens exhausts the prefixes). Hence 1,2,4, C. Each chosen token must belong to L.

More Regular Expressions and Finite Automata questions

All Regular Expressions and Finite Automata questions →