# Is L={0^n 1^n ∣n≥0} context free language?

I looked through many sources which give this as an example for cfl. It also makes sense according to this: But it fails the pumping lemma test. Let's take n=5. According to the Pumping Lemma, we can decompose s into uvxyz like: u=0, v=0, x=0,y=01, z=111

If we pump it, it clearly fails. So, is 0^n1^n context free or not?

• You don't get to choose the pumping length and you don't get to choose the decomposition. Nov 13 at 10:12

You have just shown that the given language does not meet the condition of the pumping lemma for $$n=5$$ and one particular decomposition.
To conclude that $$L$$ is not context free you need to show that the language does not meet the condition of the pumping lemma for some word of sufficiently large length $$n$$ and all decompositions of such word (within the constraints of the pumping lemma).
It turns out that the words of $$L = \{0^n 1^n \mid n \ge 0\}$$ admit a valid decomposition as soon as $$n \ge 1$$. Here is a decomposition of $$0^5 1^5$$ into $$uvxyz$$ that can be pumped: $$u=0^4$$, $$v=0$$, $$x=\varepsilon$$, $$y=1$$, $$z=1^4$$.
This is not surprising, since $$L$$ is indeed context-free as the argument in your question shows.