The GATE Grind

GATE 2020 CS – Question 18

Theory of Computation · Regular and Context-Free Languages, Pumping Lemma · 1 mark · Multiple choice

Consider the following statements.

I. If $L_1\cup L_2$ is regular, then both $L_1$ and $L_2$ must be regular.

II. The class of regular languages is closed under infinite union.

Which of the above statements is/are TRUE?

  1. I only
  2. II only
  3. Both I and II
  4. Neither I nor II

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) Neither I nor II

Explanation

I is false: $L_1=\{a^nb^n\}$ and $L_2$ its complement give a regular union $\Sigma^*$. II is false: the infinite union of $\{a^nb^n\}$'s singletons is non-regular.