GATE / CS ARCHIVE

GATE CSE 1999 / QUESTION 6(a)

Regular union does not determine a summand

Theory of Computation · Closure Properties & Language Hierarchy · Full GATE CSE 1999 paper

GATE 1999, Q6(a) 2 marks · Descriptive
Report issue

Closure Properties & Language Hierarchy

Question 6(a), GATE 1999: Given that language A is regular and A∪B is regular, must B be regular? Justify.
Question 6(a), GATE 1999: Given that language A is regular and A∪B is regular, must B be regular? Justify.
Tap to enlarge
Shared context

Given that language A is regular and A∪B is regular, must B be regular? Justify.

Answer & solution

Answer: No: take A={0,1}* and B={0ⁿ1ⁿ:n≥0}. (no official key was published)

Let the alphabet be {0,1}. Choose A={0,1}*, a regular language, and B={0ⁿ1ⁿ:n≥0}, which is not regular. Because B⊆A, the union A∪B equals A and is regular.

For completeness, B is nonregular by the pumping lemma: for pumping length p, any allowed pumped substring in 0ᵖ1ᵖ lies among the initial p zeros, and pumping it down changes the number of zeros without changing the p ones. The resulting word is not in B.

Closure under difference only proves (A∪B)\A=B\A is regular. It gives no control over the possibly nonregular part B∩A. This is precisely why reversing union closure fails.

Original paper, page 6