Question 71Asked in Bihar STET Paper 2 Computer Science (Class 11-12), 12 Sep 2023, Shift 2

The context free grammar S → SS | 0S1 | 1S0 | ɛ generates

  1. AEqual number of 0’s and 1’s
  2. BUnequal number of 0’s and 1’s
  3. CAny number of 0’s followed by any number of 1’s
  4. DNone of these
Show answerHide answer

Correct answer: (A) Equal number of 0’s and 1’s

Explanation

Every rule adds one 0 and one 1 together (0S1, 1S0) or concatenates such strings (SS), so all generated strings have equal numbers of 0s and 1s.

From Bihar STET Paper 2 Computer Science (Class 11-12) PYQ, 12 Sep 2023, Shift 2

This is question 71 of Bihar STET Paper 2 Computer Science (Class 11-12) PYQ, 12 Sep 2023, Shift 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.