recategorized by
6,378 views
23 votes
23 votes

The language $\{0^n 1^n 2^n \mid 1 \leq n \leq 10^6\}$ is

  1. regular
  2. context-free but not regular
  3. context-free but its complement is not context-free
  4. not context-free
recategorized by

1 Answer

Best answer
32 votes
32 votes
Regular (in fact finite). Since $n$ is finite, we have a finite set of strings satisfying the given conditions. So, we can easily make a finite automata for those strings.
edited by
Answer:

Related questions

41 votes
41 votes
3 answers
3