1

Let L be a language and R an infinite regular one. If L intersection R is a regular language, then L is a regular one too?

Asaf Karagila
  • 405,794
gsamaras
  • 423

1 Answers1

0

No. Let $L = \{1^p : p \text{ is prime}\}$. $R = \{1^{2n} : n \in \Bbb N\}$.

Ayman Hourieh
  • 40,828
  • That's my feeling too. :) However, I am a bit confused. As far as I know, the intersection of two regular languages is a regular language too, because of closure. So here, the problem is that R is an infinite one? An example would be very helpful. :) (I saw your edit now) Can you please explain why the example you provided works? :) – gsamaras Feb 04 '14 at 22:21
  • The intersection of two regular languages is regular. But what we have here is a different question: If $L$ is any language, $R$ regular and $L \cap R$ regular, is $L$ regular? The answer is "not necessarily" as demonstrated by my example. – Ayman Hourieh Feb 04 '14 at 22:24
  • And since: The empty language Ø is a regular language, I am convinced, bravo! :) – gsamaras Feb 04 '14 at 22:26
  • Well $2$ is the only even prime number, so $L \cap R = {11}$, which is regular. But you get the idea. – Ayman Hourieh Feb 04 '14 at 22:28
  • Oops missed that. A last thing, why is L non-regular? – gsamaras Feb 04 '14 at 22:32
  • It's a standard example found in many books. Just apply the pumping lemma. See here for example: http://math.stackexchange.com/q/181230 – Ayman Hourieh Feb 04 '14 at 22:47
  • Convinced!Thanks! – gsamaras Feb 04 '14 at 23:00
  • To understand with intuition: simple things cannot give complex things by intersection, but the other way around is possible: complex things can give simpler ones. It is quite natural. – Denis Feb 04 '14 at 23:05