• edited by
18,096 views
56 56 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\}$

4 Answers

Best answer
62 62 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
17 17 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
12 12 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 –1 vote
I think option C).
Let me know the correct answer?
1 flag:
✌ Edit necessary (js__)
Answer:
Position:
Show:

Related questions

40 40 votes
3 answers 3 answers
15.9k
15.9k views
Ishrat Jahan asked Nov 1, 2014
15,940 views
Let $L$ be a regular language. Consider the constructions on $L$ below:repeat $(L) = \{ww \mid w \in L\}$prefix $(L) = \{u \mid ∃v : uv \in L\}$suffix $(L) = \{v \mid ...
40 40 votes
1 answers 1 answer
12.3k
12.3k views
Ishrat Jahan asked Oct 31, 2014
12,282 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...
64 64 votes
5 answers 5 answers
14.3k
14.3k views
Ishrat Jahan asked Oct 31, 2014
14,324 views
For a state machine with the following state diagram the expression for the next state $S^+$ in terms of the current state $S$ and the input variables $x$ and $y$ is$S^+ ...
44 44 votes
7 answers 7 answers
14.4k
14.4k views
Ishrat Jahan asked Oct 31, 2014
14,438 views
In the context-free grammar below, $S$ is the start symbol, $a$ and $b$ are terminals, and $\epsilon$ denotes the empty string.$S \to aSAb \mid \epsilon$$A \to bA \mid \e...