On an exam we got this question:
Let $B = \{w \in \{a,b\}^* : w \neq w^{rev}\}$ Prove $B$ is not regular.
I only got 1 of 4 pts on this question and the teachers comments are below.
My solution:
Assume $B$ is regular then $B$ has a pumping length $P$ such that there is a string $S$, $|S| \geq P$. $S$ can be divided into $xyz$ and these 3 conditions will still hold:
- $x y^i z \in B$ for all $i \geq 0$.
- $|y| > 0$.
- $|xy| \leq P$.
If we got the string $S = abbaab$ We assume $S$ is a regular language with pumping length $P = 4 \rightarrow S=a^4 b^4 b^4 a^4 a^4 b^4 = aaaabbbbbbbbaaaaaaaabbbb$
Teacher: "The word should depend on $P$, you can't choose $P$!"
Case 1: $Y$ contains only $a$ $\rightarrow x=aaaabbbbbbbb ~ y= aaaa ~ z=aaaabbbb$
Teacher: "You don't know how many $a$'s for example $a^P b^P$ ... etc"
For $i = 2$ we get $x=aaaabbbbbbbb ~ y=aaaaaaaa ~ z=aaaabbbb$
Teacher: "You need to know that $x y^i z$ becomes a palindrome for some $i$."
And I also had one case for only $b$ and one case for $a + b$. But they have the same problem.
Can someone explain what went wrong? When I've watched youtube videos about pumping lemma they all put some value in $P$ to get the string but apparently that's not allowed.
I know I should ask the teacher but I have an exam tomorrow so I won't be able to get an answer in time.