IAE Academy

GATE 2020 CS Q.8: solution and answer

GATE 2020 · CSQ.8 · 1 mark · MCQ

Consider the following statements.
I. If is regular, then both and must be regular.
II. The class of regular languages is closed under infinite union.
Which of the above statements is/are TRUE?

  1. (A)

    I only

  2. (B)

    II only

  3. (C)

    Both I and II

  4. (D)

    Neither I nor II

See the question in the paper

Answer and solution

ANSWER

Neither I nor II is true, so the answer is (D).

Official answer: DSource: Official answer key, GATE 2020 CS (IIT Delhi)

  1. Statement I: take , which is regular, and over , which is not regular (pumping lemma).

  2. Then is regular, but is not regular. So Statement I is FALSE.

  3. Statement II: closure of regular languages under union is guaranteed only for finitely many languages. It follows by induction from the two-language case, and induction does not extend to infinite unions.

  4. Counterexample for an infinite union: each singleton is finite, hence regular.

  5. The union over all is , which is not regular. So Statement II is FALSE.

  6. Both statements are false, so the answer is (D) Neither I nor II.

KEY IDEA

Regular languages are closed under finite union only. Any language is a union of its singleton strings, and every singleton is regular, so closure under infinite union would make every language regular. Also, a union can be regular while a part of it is not, because absorbs anything.

WATCH OUT FOR

Assuming that closure under union extends to infinite unions, or that a regular union forces both parts to be regular.

From the GATE 2020 CS paper. Every question of this paper · Download the full paper · All 5 Regular languages questions, with notes

More Regular languages questions