ISRO Computer Science (CSE) 2026 - Question 30

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 2026

Topic: Theory of Computation

The language generated by S → 0S1 | 01 is

  • A. {0ⁿ1ⁿ | n ≥ 0}
  • B. {0ⁿ1ᵐ | n,m ≥ 1}
  • C. {0ⁿ1ⁿ0ⁿ | n ≥ 1}
  • D. {0ⁿ1ⁿ | n ≥ 1}

Answer: D. {0ⁿ1ⁿ | n ≥ 1}

Explanation: The production rule $S \rightarrow 0S1$ generates matching pairs of $0$s and $1$s recursively. The base case $S \rightarrow 01$ terminates the derivation and ensures that there is at least one pair of $01$. Thus, the grammar generates the strings 01, 0011, 000111, etc. This exactly describes the Context-Free language $L = \{0^n1^n \mid n \ge 1\}$.

| | All questions of ISRO Computer Science (CSE) 2026