GATE | GATE IT 2006 | Question 82

Let L be a regular language. Consider the constructions on L below:
repeat (L) = {ww | w ∊ L}
prefix (L) = {u | ∃v : uv ∊ L}
suffix (L) = {v | ∃u uv ∊ L}
half (L) = {u | ∃v : | v | = | u | and uv ∊ L}
Which choice of L is best suited to support your answer above?
(A) (a + b)*
(B) {ϵ, a, ab, bab}
(C) (ab)*
(D) {anbn | n ≥ 0}


Answer: (A)

Explanation:  

A counter example which proves all the conclusions of the last question in one go should have the following properties :

  • L should be regular due to the demand of the question
  • L should be an infinite set of strings, otherwise half(L) would be regular
  • L should have more than one alphabets in its grammar, otherwise repeat(L) would be regular.

Therefore,

  1. (a + b)* is perfect example to support the conclusions of last question. It is regular, has more than one alphabets and is an infinite set.
  2. {ϵ, a, ab, bab} is a finite set, hence wrong.
  3. (ab)* is equivalent to c∗ , which is one alphabet language, hence wrong.
  4. {anbn | n ≥ 0} is not even a regular language, hence wrong.

This solution is contributed by vineet purswani.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.