Skip to content
GATEiit

GATE CSE 2017 Session 2 Q26: Language of S → XY, X → aX | a, Y → aYb | ε

Syllabus topic: Context-free grammars and push-down automata

Question

Identify the language generated by the following grammar, where S is the start variable.

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation

Answer: C (official GATE 2017 final answer key)

Concept used: Concatenating the languages of independent non-terminals: X gives ak with k≥1 and Y gives anbn with n≥0.

Concept notes

Loading notes…

First step: Find the language of X and of Y separately, then combine ak⋅anbn.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Context-free grammars and push-down automata

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2017 Session 2 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key