Skip to content
Official PYQ · 2016

GATE CS 2016 Set 2 Q18 — Regular and Context-free Languages

Explain with AI

Consider the following types of languages: L1L_{1}: Regular, L2L_{2}: Context-free, L3L_{3}: Recursive, L4L_{4}: Recursively enumerable. Which of the following is/are TRUE ?

  1. L3‾∪L4\overline{L_{3}} \cup L_{4} is recursively enumerable.
  2. L2‾∪L3\overline{L_{2}} \cup L_{3} is recursive.
  3. L1∗∩L2L^{*} _{1} \cap L_{2} is context-free.
  4. L1∪L2‾L_{1} \cup \overline{L_{2}} is context-free.
Choose one option
View worked solution

Answer: D

To determine which statements are true, let us analyze the closure properties of the given language classes:

  • L1L_1: Regular
  • L2L_2: Context-free (CFL)
  • L3L_3: Recursive (Decidable)
  • L4L_4: Recursively Enumerable (RE / Turing-recognizable)

Statement I: L3‾∪L4\overline{L_3} \cup L_4 is recursively enumerable.

  • Since L3L_3 is recursive, its complement L3‾\overline{L_3} is also recursive.
  • Every recursive language is also recursively enumerable (RE), so L3‾\overline{L_3} is RE.
  • Since L4L_4 is RE and the class of RE languages is closed under union, the union L3‾∪L4\overline{L_3} \cup L_4 is recursively enumerable.
  • Therefore, Statement I is TRUE.

Statement II: L2‾∪L3\overline{L_2} \cup L_3 is recursive.

  • Every context-free language is recursive (L2⊆L3L_2 \subseteq L_3). Thus, L2L_2 is recursive.
  • Since recursive languages are closed under complementation, L2‾\overline{L_2} is recursive.
  • Since both L2‾\overline{L_2} and L3L_3 are recursive, and recursive languages are closed under union, L2‾∪L3\overline{L_2} \cup L_3 is recursive.
  • Therefore, Statement II is TRUE.

Statement III: L1∗∩L2L_1^* \cap L_2 is context-free.

  • Since L1L_1 is regular, its Kleene closure L1∗L_1^* is also regular.
  • L2L_2 is context-free.
  • The intersection of a regular language and a context-free language is always context-free (CFL∩Regular=CFLCFL \cap Regular = CFL).
  • Therefore, Statement III is TRUE.

Statement IV: L1∪L2‾L_1 \cup \overline{L_2} is context-free.

  • L2L_2 is context-free, but context-free languages are not closed under complementation. Thus, L2‾\overline{L_2} is not necessarily context-free.
  • If we choose L1=∅L_1 = \emptyset (which is regular), then L1∪L2‾=L2‾L_1 \cup \overline{L_2} = \overline{L_2}, which may not be context-free.
  • Therefore, Statement IV is FALSE.

Since statements I, II, and III are true, the correct option is D.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular and Context-free Languages questions