Use . The context-free grammar generates exactly , so it is a context-free language. It is not a regular language: if is a pumping length, any allowed decomposition of has a nonempty pumped segment consisting only of 's. Pumping down leaves fewer 's than 's, contradicting the pumping lemma for regular languages. Thus is a context-free language but not a regular language.
Use . A halting algorithm checks that a word consists of three consecutive blocks in the correct order and compares their lengths, so is a decidable language. If it were a context-free language, apply the pumping lemma for context-free languages to . The segment containing both pumped pieces has length at most , so it cannot meet both the and blocks. Pumping down therefore changes at least one block count but leaves another equal to , or destroys the required block order. Either way the resulting word is not in , a contradiction. Thus is a decidable language but not a context-free language.
Articles by others on the same topic
There are currently no matching articles.