0
$\begingroup$

$L_1=\{a^n\mid n\ge1\}$ is regular and $L_2=\{a^{n^2}\mid n\ge1\}$ is non-regular. We know that $L_1\cap L_2$ is regular but, here $L_1\cap L_2=L_2$; and $L_2$ is not regular. How is this possible?

David Richerby
82.6k26 gold badges146 silver badges240 bronze badges
asked Dec 24, 2014 at 10:25
$\endgroup$
4
  • 3
    $\begingroup$ We don't know that when $L_1$ is regular and $L_2$ isn't, their intersection is always regular. Consider $L_1=\Sigma^*$. $\endgroup$ Commented Dec 24, 2014 at 11:17
  • $\begingroup$ @reinierpost Actually, the example in the question is $L_1=\Sigma^*$ for $\Sigma=\{a\}$. $\endgroup$ Commented Dec 24, 2014 at 12:04
  • $\begingroup$ @David Richerby: Yes, my remark is a clumsy way to clarify that the resulting language can always be equal to whatever you pick $L_2$ to be. $\endgroup$ Commented Dec 25, 2014 at 23:01
  • $\begingroup$ In your specific case, $L_1 \cap L_2 = L_2,ドル non-regular. $\endgroup$ Commented Feb 9, 2020 at 20:39

2 Answers 2

3
$\begingroup$

To expand a bit on David's answer, you are confusing between the next two claims.

Claim 1 if $L_1,L_2$ are regular, then $L_1 \cap L_2$ is also regular.
(proof: construct the product DFA, e.g., here)

Claim 2 if $L_1$ is regular, but $L_2$ is not, then $L_1\cap L_2$ can be either regular or not-regular.
(proof: Let $L_2$ be some non-regular language. If $L_1=\Sigma^*$ then $L_1\cap L_2=L_2$ which is non-regular by its definition. On the other hand, if $L_1=\emptyset$ then $L_1\cap L_2=L_1=\emptyset$ which is regular)

answered Dec 24, 2014 at 18:24
$\endgroup$
1
  • $\begingroup$ thanx dear for clearig my point,its cod'n is either or, but not necessary..,thnk u. $\endgroup$ Commented Dec 26, 2014 at 7:39
1
$\begingroup$

If $L$ and $L'$ are both regular then, yes, $L\cap L'$ is regular. But, if $L'$ is not regular, then all the bets are off, as your example shows.

answered Dec 24, 2014 at 12:03
$\endgroup$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.