5

Here I am going to give a proof that L = {w | w is an element of {0,1}* and w has an even number of 1's} is not regular (even though it is regular) and I would like someone to point out what is wrong with my proof.
This is a regular language because I can construct a Deterministic Finite Automaton that recognizes the language:
DFA that recognizes L


Here I choose the string w = 0110
Our pumping length will be p = 3, this satisfies the condition |w| >= p.
The string will be broken up as follows:
x = 0
y = 1
z = 10
this satisfies the condition |y| > 0
as well as |xy| <= p
however, if I pump the string y twice, then we get the string 01110 which is no longer in the language, since we cannot pump y, this is not a regular language.
What is wrong with my proof?

James S
  • 63
  • For the record, $p=2$ is already a pumping length for $L$. Anyways, what you did just means that for your $w$ the $x$, $y$ and $z$ you have chosen are not suitable for pumping lemma: you should have picked some others. I suggest $x=\varepsilon$, $y=0$ and $z=110$. – Sassatelli Giulio Oct 09 '22 at 16:59

2 Answers2

4

You have to exhibit a string for which any admissible partition into $xyz$ has $xy^nz\not\in L$ for some $n$. Your string can be partitioned into $0.11.0$, and $0(11)^n0\in L$ for any $n$. It is not a valid counterexample.

Parcly Taxel
  • 103,344
  • This makes sense, thank you! So I would have to find a string where there doesn't exist any partition that works? Of course I know its not possible in this case. – James S Oct 09 '22 at 17:08
  • 3
    @JamesS Yes. And that is usually the hardest part. – Parcly Taxel Oct 09 '22 at 17:15
1

The pumping lemma says that there exists a split into $x,y,z$ such that $y$ can be repeated arbitrarily. It doesn't say that all splits can have $y$ repeated arbitrarily.