Question

Consider the following statements.

I. If L1∪L2L_1 \cup L_2 is regular, then both L1L_1 and L2L_2 must be regular.
II. The class of regular languages is closed under infinite union.

Which of the above statements is/are TRUE?

Choose one option
Official answer and solution
Official answer
D
From
Official GATE 2020 answer key

Solution

Evaluate closure properties of regular languages using standard counterexamples.

Evaluation of Statement I: 'If L1∪L2L_1 \cup L_2 is regular, then both L1L_1 and L2L_2 must be regular.'

  • Consider the alphabet Σ={a}\Sigma = \{a\}.
  • Let L1={ap∣p is prime}L_1 = \{a^p \mid p \text{ is prime}\}, which is known to be non-regular.
  • Let L2=Σ∗∖L1={ak∣k is composite or 0,1}L_2 = \Sigma^* \setminus L_1 = \{a^k \mid k \text{ is composite or } 0, 1\}, which is also non-regular.
  • Their union is L1∪L2=Σ∗=a∗L_1 \cup L_2 = \Sigma^* = a^*, which is clearly regular.
  • Thus, the union of two non-regular languages can be regular. Statement I is FALSE.

Evaluation of Statement II: 'The class of regular languages is closed under infinite union.'

  • Any arbitrary language L⊆Σ∗L \subseteq \Sigma^* can be expressed as the infinite union of singleton string languages: L=⋃w∈L{w}L = \bigcup_{w \in L} \{w\}.
  • Every singleton language {w}\{w\} is finite and therefore regular.
  • If regular languages were closed under infinite union, every language (including non-regular and undecidable languages like the Halting Problem) would be regular, which is impossible.
  • Thus, regular languages are not closed under infinite union. Statement II is FALSE.

Since both statements are false, the correct option is 'Neither I nor II'.

Final answer

D

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2020 Computer Science and Information Technology (CS)
Question
18 of 65, printed as CS Q.8
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.