Consider this language:
$K=\{xy \mid x=\{a,b\}^*, y=x^R \text{ or } y=x\}$
I know that these languages are non-regular separately:
$K_1=\{xy \mid x=\{a,b\}^*, y=x^R\}$
$K_2=\{xy \mid x=\{a,b\}^*, y=x\}$
But what about their union?
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this communityConsider this language:
$K=\{xy \mid x=\{a,b\}^*, y=x^R \text{ or } y=x\}$
I know that these languages are non-regular separately:
$K_1=\{xy \mid x=\{a,b\}^*, y=x^R\}$
$K_2=\{xy \mid x=\{a,b\}^*, y=x\}$
But what about their union?
Suppose towards a contradiction that $w$ is regular, let $p$ be its pumping length, and consider the word: $a^pba^pb \in w$.
By the pumping lemma, there is some $k \ge 1$ such that $a^{p + ik}b a^p b \in w$ for all choices of an integer $i \ge -1$. Choosing $i=-1$ we obtain $a^{p-k}b a^p b \in w$. This is a contradiction, therefore $w$ is not regular.