User:Dhruvbird/0n1n

0n1n
0n1n is a Context-Free Language (CFL).

Proof
This language can be easily proved to be Context-Free by noticing that the intersection of a Context-Free Language and a Regular Language is always Context-Free. We know that a language containing an equal number of 0s and 1s is Context-Free. If we intersect it with the Regular Language (0+1)* then we get a Context-Free Language which in this case happens to be 0n1n.

Complement
It is not true that the complement of every CFL is also a CFL. However. the complement of 0n1n is also Context-Free. The proof involves noticing that this language can be acceped by a (Deterministic Push-Down Automata). The complement of a DPDA is also a DPDA. It can be realized by labeling all originally accepting states as non-accepting states and all originally non-accepting states as accepting states.

Other Context-Free Languages

 * wwR
 * Palindromic Languages
 * Language with equal number of 0s and 1s

Languages that are NOT Context-Free

 * 0n1n0n
 * ww