0

My Introduction to Computation Theory professor talked about how we can write more general grammars (called unrestricted grammars) for languages that are not context-free. For example, the language: $\{0^{2^n} : n\geq0\}$ is not context-free, so it cannot be generated by a context-free grammar.

I am wondering if the language: $\{0^{n^2} : n\ge0\}$ is also not context-free, and what could be the grammar for it?

For this language, we would have to generate $n^2$ zeroes, which seems awkward and difficult to put into grammar form.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
Hid
  • 101
  • 1

0 Answers0