-1
$\begingroup$

This question already has an answer here:

I'm new to regular languages and I've been struggling to solve one for a while. The question is:

If there exists a regular language L1 which has an alphabet {0,1}, prove that L2 is also a regular language if L2 comprises of strings x where x = ABC where B is an element in L1 and A and C are strings comprised of 0's and 1's.

I intuitively believe that since we know L1 is a regular language, we know that any string of 0's and 1's is a regular language. Hence, L2 should be a regular language as it is comprised of only 0's and 1's (by definition). Apparently, this is the wrong approach. Can someone assist me in solving this problem?

Thank you!

EDIT:

I realize my explanation was off. We know that L1 is a regular language composed of strings of "0" and "1", for example, "000111", "010101", could exist as elements in this language. If there are finite elements inside the language, then clearly by mutlipying it by two constant strings, we will get a finite output (hence regular). However, if it is not finite, that means it must have a regular expression that describes the language. Thus, any concatenation with two similar strings will still be that same regular expression with two constants added on top of it (hence still represented by a reg ex and thus a regular language).

Where is my logic flawed?

Thank you!

$\endgroup$

marked as duplicate by David Richerby, Evil, Juho, Gilles Sep 24 '16 at 21:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ What are definition(s) do you have for "regular language"? ​ What things have you shown about them? ​ ​ ​ ​ $\endgroup$ – user12859 Sep 15 '16 at 8:28
  • 1
    $\begingroup$ "We know that any string of 0's and 1's is a regular language." No. That statement doesn't type-check. A language is a set of strings, so a string cannot be a language. "Hence, L2 should be a regular language as it is comprised of only 0's and 1's" Every language can be written as strings of 0s and 1s. That doesn't make every language regular. Not by a long way. $\endgroup$ – David Richerby Sep 15 '16 at 8:46
  • $\begingroup$ To give more clarification on @DavidRicherby 's point, consider that if we are saying that "any string of 0's and 1's is a regular language", we are saying that the language $L=0^n1^n$ is also regular, which it is not. $\endgroup$ – px06 Sep 15 '16 at 8:50
  • $\begingroup$ @DavidRicherby , I modified my question above to remove that flawed argument. I still think the logic is there, but apparently this is not the correct way to prove it. $\endgroup$ – Akshay Sep 15 '16 at 9:34
  • 1
    $\begingroup$ Hint: use the defining closure properties. $\endgroup$ – Raphael Sep 15 '16 at 11:04
0
$\begingroup$

Hint. The language $L_2$ is the concatenation of the languages $U$ and $L_1$, namely $L_2 = U\circ L_1\circ U$, where $U$ is the set of all strings over $\{0,1\}$.

  • Is $U$ a regular language?
  • If so, what do you know about the concatenation of regular languages?
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.