1

I've been doing some work to prove some languages are not regular. I have previously used pumping lemma to prove by contradiction. However I am used to questions which ask to prove languages such as {a^n b^m| n ̸= m} ⊂ {a, b}* are not regular. I would use pumping lemma for these but now I have come across this language.

{w| w ∈ {a, b} * is not a palindrome}

I'm unsure how to prove it is irregular. Can it be done with pumping lemma? Or another method?

sam
  • 77
  • The set of regular languages is closed under taking complements. Hence, your language is regular iff the language $L = {w \in {a,b}^\ast , \mid , w \text{ is a palindrome}}$ is regular. Here, you can use the pumping lemma. What I find much more convenient, however, is the Myhill Nerode theorem (http://en.wikipedia.org/wiki/Myhill%E2%80%93Nerode_theorem). – PhoemueX Nov 23 '14 at 14:00
  • I don't understand how to use the pumping lemma for this? Usually I have a language such as {a^n b^n | n=/=m} to start off with and this just tells me that it isn't a palindrome. – sam Nov 23 '14 at 14:06

1 Answers1

0

Extended hint/instructions:

Let $p$ be a "pumping number" (as in http://en.wikipedia.org/wiki/Pumping_lemma_for_regular_languages#Formal_statement) for the language $L$ given in my prev. comment, i.e. $L$ is the language of all palindromes.

Then $w = a^p bb a^p$. Then $w \in L$. Your task is now to show that we can "pump up" $w$ in such a way that the pumped word is no longer an element of $L$.

How did I arrive at that example? The idea is that the automaton [every regular language is recognized by some DFA] can only "remember" a fixed amount (roughly corresponding to the $p$) of letters and I use a word (which is a palindrom) that is so long that the automaton can not correctly decide the property anymore, because he has "forgotten" too much.

EDIT: You should be able to do something similar for your language directly, without taking the complement.

As I said above, I would also recommend to have a look at the Myhill Nerode theorem!

PhoemueX
  • 35,087
  • So I can say that a language is not regular if the 'opposite' language is also not regular? – sam Nov 23 '14 at 14:24
  • If I can simply say that if the language L={w∈{a,b}∣w is not* a palindrome} is not regular if L={w∈{a,b}∣w is* a palindrome}. Then I have done it, can you confirm that is right?. – sam Nov 23 '14 at 14:32
  • Yes, because if the "opposite" language was regular, then the "opposite opposite" language would also be regular [proof that if $L$ is regular, then so is $L^c$ (the "opposite" language): take a DFA recognising $L$ and interchange all accepting/not-accepting states. The resulting DFA recognises $L^c$. For this it is important for the automaton to be deterministic (why?)] – PhoemueX Nov 23 '14 at 14:35
  • Yes, that is right, see my other comment. – PhoemueX Nov 23 '14 at 14:36
  • @sam if you're using the pumping lemma, it is probably easier to show that the language of palindromes is irregular than to show that the language of non-palindromes is irregular. – MJD Nov 23 '14 at 15:12
  • Thankyou both. It was much clearer once I knew to instead prove that the language of palindromes was irregular. – sam Nov 23 '14 at 15:26
  • @sam If the question has "use the pumping lemma…" then it is almost always "prove that language L is irregular", because the pumping lemma cannot be used to prove that a language is regular. – MJD Nov 23 '14 at 15:27
  • No I meant using the fact that I can prove a palindrome language is irregular to to prove that a !palindrome language is irregular. I wasn't aware it worked that way. – sam Nov 23 '14 at 16:04
  • @PhoemueX I can't seem to figure out why determinism is important here. – actinidia Sep 26 '21 at 22:13