IAE Academy

ISRO CS 2025 Q.33: solution and answer

ISRO 2025 · CSQ.33 · 1 mark · MCQ

Which of the following strings will correctly match the Grammar G represented by production rules given?

S → A | B
A → aAb | c
B → bBd | e

  1. (A)

    accbb

  2. (B)

    aacbb

  3. (C)

    abaed

  4. (D)

    aaebb

See the question in the paper

Answer and solution

ANSWER

The string , option (b), is generated by the grammar.

Official answer: BSource: ISRO's final answer key of 15 May 2026

  1. Expand : each use of adds one on the left and one on the right, and ends the derivation. So .

  2. Expand : each use of adds one on the left and one on the right, and ends it. So .

  3. Since , a string is generated only if it has the form or .

  4. (a) has two 's. Every string of has exactly one or exactly one , so it is not generated.

  5. (b) is of the form with . Derivation: . It is generated.

  6. (c) has no , so it is not of the form . It is not of the form either, because it starts with . It is not generated.

  7. (d) mixes 's with . never produces and never produces , so it is not generated.

  8. Only option (b) is derivable from .

KEY IDEA

Work out the language of each non-terminal separately. gives and gives . Then check each string against the two forms.

WATCH OUT FOR

Treating the symbols as freely mixable, for example accepting or . In this grammar 's pair only with and 's, and only comes with 's and 's. Each string also has exactly one or one .

From the ISRO CS 2025 paper. Every question of this paper · The full paper (PDF, ISRO) · All 6 ISRO CFG & PDA questions, with notes

More ISRO CFG & PDA questions