All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · November 2021

Any string of terminals generated by the CFG S → XY, X → 0X | 1X | 0, Y → Y0 | Y1 | 0 (S is the start symbol)

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. has at least two 0's

Explanation

X always ends with 0 and Y always starts with 0, so every string contains at least two 0's. Strings like 00 show A and C fail, and 001 shows B fails.

More Theory of Computation and Compilers questions