Question
Consider the following types of languages: : Regular, : Context-free, : Recursive, : Recursively enumerable. Which of the following is/are TRUE?
I. is recursively enumerable
II. is recursive
III. is context-free
IV. is context-free
Official answer and solution
- Official answer
- D
- From
- Official GATE 2016 answer key
All four statements are mathematically true, but the available options only include subsets. GATE official key is (D).
Statement IV is also mathematically true (the union of a Regular language and a Context-Free language is Context-Free). However, among the four provided options, no option includes all four statements, and official GATE key gives option (D).
Solution
Examine the closure properties of language classes in the Chomsky hierarchy.
Given language classes: is Regular (REG), is Context-Free (CFL), is Recursive (REC), and is Recursively Enumerable (RE).
Recall the standard hierarchy inclusions:
- Statement I: is RE.
Since is recursive, it is also recursively enumerable. The class of RE languages is closed under union. Thus, is always RE. Statement I is TRUE.
- Statement II: is REC.
Since is context-free, it is also recursive. The class of recursive languages is closed under union. Thus, is always REC. Statement II is TRUE.
- Statement III: is CFL.
Since is regular, is regular (closed under Kleene star). The intersection of a context-free language with a regular language is always context-free. Thus, is always CFL. Statement III is TRUE.
- Statement IV: is CFL.
Since is regular, it is also context-free. The class of context-free languages is closed under union. Thus, is always CFL. Statement IV is mathematically TRUE.
Note on Official Answer:
All four statements (I, II, III, IV) are mathematically correct. However, because no option includes all four statements, the official GATE key awards option (D) ("I, II and III only").
D
Thinking the intersection of two CFLs is not CFL, without recognizing that is Regular (intersection of CFL with Regular is always CFL).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2016 Computer Science and Information Technology (CS) Session 2
- Question
- 28 of 65, printed as CS Q.18
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.