Exercise 4 (Homework 3).
(pumping lemma,
hard exercise)
Palindromes and partial palindromes
Show that the language \{w\in \{a,b\}^* \mid w=w^R\} is not regular.
Show that the language \{ww^R\mid w\in \{a,b\}^*\} is not regular.
Show that the language \{ww\mid w\in \{a,b\}^*\} is not regular.
(hard) Show that the language \{ww^Rx\mid w,x\in \{a,b\}^+\} is not regular.
CautionFor this last point, the pumping lemma cannot be used to show non-regularity. Why?
HintSuppose, towards a contradiction, that the language is regular and there is a DFA with N states recognizing it. Test the behaviour of the automata against all the words w_i=aba^2b^2\cdots a^ib^i, for i=1,2,\dots, N+1.