Skip to content
GATEiit

GATE CSE 2017 Session 2 Q14: Closure of context-free languages: union, complement, minus regular, intersection

Syllabus topic: Regular and context-free languages; pumping lemma

Question

Let L1, L2 be any two context-free languages and R be any regular language. Then which of the following is/are CORRECT?

I. L1∪L2 is context-free. II. L1‾ is context-free. III. L1−R is context-free. IV. L1∩L2 is context-free.

Try it: multiple choice: exactly one correct option

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

Answer: B (official GATE 2017 final answer key)

Concept used: CFLs are closed under union and under intersection with a regular language, but not under complement or intersection with another CFL.

Concept notes

Loading notes…

First step: Rewrite L1−R as L1∩R‾ and note that R‾ is regular.

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 Regular and context-free languages; pumping lemma

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