• edited by
16,362 views
41 41 votes

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

  1. repeat $(L) = \{ww \mid  w \in  L\}$
  2. prefix $(L) = \{u \mid ∃v : uv \in L\}$
  3. suffix $(L) = \{v \mid  ∃u : uv \in L\}$
  4. half $(L) = \{u \mid ∃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

4 Answers

Best answer
29 29 votes

Correct answer is B. Only $I$.

Repeat $(L) = \{ww \mid w \in L\}$ is non regular language

Half$(L)$, suffix$(L)$, and prefix$(L)$ are regular languages

Reference:

https://gateoverflow.in/3637/gate2006-it_81

• edited by
26 26 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
  • so answer is B
4 4 votes

Let $L$ be a regular language. We examine the four constructions to determine which may produce a non-regular language.

I. $\text{repeat}(L) = { ww \mid w \in L }$

This operation is not closed under regular languages. Take $L = {a,b}^*$, which is regular. Then

$$
\text{repeat}(L) = { ww \mid w \in {a,b}^* }.
$$

This language is not regular: a finite automaton cannot verify that the first half of the input equals the second half. By the Myhill–Nerode theorem, the strings $a^i$ and $a^j$ (for $i \neq j$) are distinguishable using the suffix $a^i$, yielding infinitely many equivalence classes.Hence, I can yield a non-regular language.

 

II. $\text{prefix}(L) = { u \mid \exists v : uv \in L }$

Regular languages are closed under prefix. Given a DFA for $L$, making all states reachable from the start state accepting yields a DFA for $\text{prefix}(L)$.
Thus, II always produces a regular language.

 

III. $\text{suffix}(L) = { v \mid \exists u : uv \in L }$

Regular languages are closed under suffix. An NFA for $\text{suffix}(L)$ is obtained by adding $\varepsilon$-transitions from a new start state to every state of a DFA for $L$, preserving the original final states. Therefore, III always yields a regular language.

 

IV. $\text{half}(L) = { w \mid \exists v : |v| = |w| \text{ and } wv \in L }$

This operation preserves regularity.
Although it may appear to require unbounded memory, a finite automaton can recognize $\text{half}(L)$ by simulating the original DFA on $w$ while simultaneously tracking, via a product construction, whether there exists a path of length $|w|$ from the resulting state to an accepting state. (boils down to even length string) 
Equivalently, one can construct an NFA that guesses the second half $v$ symbol-by-symbol in lockstep with reading $w$, using nondeterminism to verify that $wv \in L$.
This construction is standard and confirms that IV always yields a regular language.

For example, if $a^*b^*$, then $\text{half}(L) = a^*b^*$ if $L = \Sigma^*$, then $\text{half}(L) = \Sigma^*$; in all cases, the result is regular.

 

$$
\boxed{\text{B. Only I}}
$$

Answer:
Position:
Show:

Related questions

57 57 votes
5 answers 5 answers
18.7k
18.7k views
Ishrat Jahan asked Nov 1, 2014
18,706 views
Let $L$ be a regular language. Consider the constructions on $L$ below:$\text{repeat} (L) = \{ww \mid w \in L\}$$\text{prefix} (L) = \{u \mid \exists v : uv \in L\}$$\tex...
41 41 votes
2 answers 2 answers
12.5k
12.5k views
Ishrat Jahan asked Oct 31, 2014
12,524 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...
65 65 votes
5 answers 5 answers
14.8k
14.8k views
Ishrat Jahan asked Oct 31, 2014
14,819 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
15.0k
15.0k views
Ishrat Jahan asked Oct 31, 2014
15,026 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...