Is the language $\{wxw^Rx^R \mid w,x \in \{0,1\}^* \}$ context-free
My thoughts, Let $x = \epsilon$ and we get $ww^R$, which is context-free. Hence the given language must be context-free.
Am I right?
Is the language $\{wxw^Rx^R \mid w,x \in \{0,1\}^* \}$ context-free
My thoughts, Let $x = \epsilon$ and we get $ww^R$, which is context-free. Hence the given language must be context-free.
Am I right?
Denote your language by $L$, and consider $$ L' = L \cap 10^*1110^*10^*10^+11. $$ Any word in $L'$ is of the form $$ 10^a1110^b10^c10^d11, $$ where $d > 0$. Also, it is of the form $wxw^Rx^R$. Since both $wx$ and $w^Rx^R$ contain the same number of $1$'s, necessarily \begin{align} wx &= 10^a1110^{b_1} \\ w^Rx^R &= 0^{b_2}10^c10^d11 \end{align} where $b_1 + b_2 = b$. We see that $x^R$ ends with $110$ (since $d>0$), and so $x$ starts with $110$. Hence $w = 10^a1$ and $x=110^{b_1}$, implying that $w^Rx^R = 10^a10^{b_1}11$. This shows that $b_2 = 0$ hence $b_1 = b$, and furthermore $c = a$ and $d = b$. That is, the word is of the form $$ 10^a1110^b10^a10^b11, $$ where $b > 0$. Conversely, every word of this form is in $L'$ (take $w = 10^a1$ and $x = 110^b$).
Let $h\colon \{1,2,3,4,5\} \to \{0,1\}$ be the homomorphism given by $h(1) = 1$ and $h(2) = h(3) = h(4) = h(5) = 0$, and let $d\colon \{1,2,3,4,5\} \to \{2,3,4,5\}$ be the homomorphism that deletes $1$. Then $$ d(h^{-1}(L') \cap 12^*1113^*14^*15^*11) \cup \{2^n4^n : n \geq 0\} = \{2^n3^m4^n5^m : n,m \geq 0\}. $$ The latter language is well-known not to be context-free. Since all our operations preserve being context-free, we conclude that $L$ is also not context-free.