Skip to content
Official PYQ · 2007

GATE CS 2007 Q7 — Regular and Context-free Languages

Explain with AI

Which of the following is TRUE?

Choose one option
View worked solution

Answer: B

Let us analyze each option to determine its correctness:

  • Option A: Every subset of a regular set is regular.
    False. Consider the regular language L=a∗b∗L = a^*b^*. Its subset L′={anbn∣n≥0}L' = \{a^n b^n \mid n \ge 0\} is non-regular.
  • Option B: Every finite subset of a non-regular set is regular.
    True. Every finite set is regular because we can always construct a DFA or write a regular expression for any finite set of strings. Since any finite subset of a non-regular set is, by definition, a finite set, it must be regular.
  • Option C: The union of two non-regular sets is not regular.
    False. Let L1={anbn∣n≥0}L_1 = \{a^n b^n \mid n \ge 0\} and its complement L2=L1‾L_2 = \overline{L_1}. Both are non-regular, but their union L1∪L2=Σ∗L_1 \cup L_2 = \Sigma^* is regular.
  • Option D: Infinite union of finite sets is regular.
    False. Any language (including non-regular ones) can be represented as an infinite union of singleton (finite) sets. For example, {anbn∣n≥0}=⋃n=0∞{anbn}\{a^n b^n \mid n \ge 0\} = \bigcup_{n=0}^{\infty} \{a^n b^n\} is non-regular.

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

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