edited by
11,213 views
41 votes
41 votes

Let $L$ be a regular language. Consider the constructions on $L$ below:

  1. $\text{repeat} (L) = \{ww \mid w \in L\}$
  2. $\text{prefix} (L) = \{u \mid \exists v : uv \in L\}$
  3. $\text{suffix} (L) = \{v \mid \exists u: uv \in L\}$
  4. $\text{half} (L) = \{u \mid \exists v: | v | = | u | \text{ and } uv \in L\}$

Which of the constructions could lead to a non-regular language?

  1. Both I and IV
  2. Only I
  3. Only IV
  4. Both II and III

Which choice of $L$ is best suited to support your answer above?

  1. $(a + b)^*$
  2. $\{\epsilon, a, ab, bab\}$
  3. $(ab)^*$
  4. $\{a^nb^n \mid n \geq 0\}$
edited by

4 Answers

Best answer
48 votes
48 votes
  1. $\text{repeat}(L)$ is non regular
    http://www.cs.odu.edu/~toida/nerzic/390teched/regular/reg-lang/non-regularity.html [example 2]
  2. $\text{prefix}(L)$ is regular
    http://www.public.asu.edu/~ccolbou/src/355hw2sols09.pdf [2(a)]
  3. $\text{suffix}(L)$ is regular
    http://www.public.asu.edu/~ccolbou/src/355hw2sols09.pdf [2(b)]
  4. $\text{half}(L)$ is regular
    https://math.stackexchange.com/questions/1539658/automata-prove-that-if-l-is-regular-than-halfl-is-regular-too 

So, in first part of question, option B is correct only (i).

For second part of question:

A is answer.

  • For option $B$  $L = \{\epsilon, a, ab, bab\}$ , $\text{repeat}(L) = \{ \epsilon, aa,abab, babbab\}$ is regular. So, not a suitable example.
  • For option C, regular expression for Repeat(L) will be $(abab)^*$ and hence regular. So, this also is not a suitable example.
  • For option D, $L$ it self is not regular and hence it can not be the answer. 
  • For A, all strings of $\text{repeat(L)}$ is in $L.$ But that does not mean $\text{repeat}(L)$ is regular. For that we also have to ensure all strings in $L$ is in $\text{repeat(L)}$ which is not the case (or all strings not in $\text{repeat(L)}$ is not in $L).$ $\text{repeat(L)}$ here is $\{ww\mid w\in (a+b)^*\}$ which is actually not even context-free.
edited by
16 votes
16 votes

A.repeat (L) = {ww | w ∊ L}   //CSL so non-regular Hence Answer is OptionA

B.prefix (L) = {u | ∃v : uv ∊ L}//can be realized by making NFA where all the states are final states.

i.e. L={abc} then Prefix(L)={^,a,ab,abc} 

C.suffix (L) = {v | ∃u uv ∊ L}

suffix(L)=Reverse(prefix(Reveres(L))) //we know reverse and prefix closed under regular Hence suffix(L) also regular

i.e. L={abc} then suffix(L)={^,c,bc,abc} 

D.half (L) = {u | ∃v : | v | = | u | and uv ∊ L}//https://gateoverflow.in/93981/half-l //Hence Regular

So option A is Ans

edited by
9 votes
9 votes
  • repeat(L) should not be confused with concatenation as there is a specific order to it. Only same strings are concatenated with each other and not all. Moreover, double word language is not even a CFG [non-regular].
  • prefix(L) is a regular language – all the states in L’s DFA could be made final, giving result to a DFA which would accept prefix(L) [regular]
  • suffix(L) is a regular language as a NFA could be constructed which would accept suffix(L). Every state in L’s DFA can get an incident # – edge from start state – this NFA would accept suffix(L) [regular].
  • half(L) is a regular language. It is just a language containing even length strings
  • from above repeat could lead to non-regular language
  • so we should choose option such that it should be regular and it should not follow repeat
  • since L should be regular mention in question . so we can eliminate option d.
  • option c if we repeat it can be (abab)* .even if we repeat it is regular so it is not answer.
  • option b since it is finite even if we repeat still it is regular so it is not answer.
  • so answer for this question is option A
–1 votes
–1 votes
I think option C).
Let me know the correct answer?
Answer:

Related questions

29 votes
29 votes
1 answer
2
Ishrat Jahan asked Oct 31, 2014
7,957 views
Which of the following statements about regular languages is NOT true ?Every language has a regular supersetEvery language has a regular subsetEvery subset of a regular l...
45 votes
45 votes
4 answers
3