Let and be two languages over a finite alphabet, such that and are regular languages.
Which of the following statements is/are always true?
- (A)
is regular
- (B)
is regular
- (C)
is context-free
- (D)
is context-free
Let and be two languages over a finite alphabet, such that and are regular languages.
Which of the following statements is/are always true?
is regular
is regular
is context-free
is context-free
ANSWER
Only option (C) is always true.
Official answer: CSource: Official answer key, GATE 2026 CS1 (IIT Guwahati)
The only facts given are that and are regular. Nothing else is assumed about , so a statement is "always true" only if it holds for every pair that satisfies these two conditions.
Counterexample for : take , which is regular. Let be any language that is not regular. Then is regular, so both hypotheses hold while is arbitrary.
(A) is regular: false. With and , the hypotheses hold but is not regular.
(D) is context-free: false. With and , which is not context-free, the hypotheses hold but is not context-free.
(B) is regular: false. With we get , which is not regular for the chosen . Note that , which is not the same set as .
(C) is context-free: true. Regular languages are closed under complement (swap the accepting and non-accepting states of a complete DFA), so is regular. Every regular language is context-free, so is context-free for every valid choice of and .
Only (C) is always true.
KEY IDEA
The hypotheses constrain only and the intersection, so can be any language, for example when . Only a statement that depends on alone can be always true. Regular languages are closed under complement and are a subset of the context-free languages.
WATCH OUT FOR
Reading regular as a restriction on . Another slip is treating as and concluding (B). The union simplifies to , not .
From the GATE 2026 CS1 paper. Every question of this paper · Download the full paper · All 5 Regular languages questions, with notes