The language {0n 1n 2n | 1 ≤ n ≤ 106} is
2005
The language {0n 1n 2n | 1 ≤ n ≤ 106} is
- A.
regular
- B.
context-free but not regular.
- C.
context-free but its complement is not context-free.
- D.
not context-free
Attempted by 119 students.
Show answer & explanation
Correct answer: A
The language {0^n 1^n 2^n | 1 ≤ n ≤ 10^6} is finite because n has a maximum value of 10^6. Since all finite languages are regular, this language is regular. Therefore, the correct answer is A (regular).