GATE / CS ARCHIVE

SIMILAR QUESTIONS / THEORY OF COMPUTATION

Disprove the converse of regular union closure

2 questions solved the same way, newest first. Back to Theory of Computation

How these are solved

A regular operand and regular union do not force the other operand regular. Use a regular superset such as the universal language to absorb a nonregular subset.

2 marks · Descriptive
Report issue

Asked again GATE 1994, Q19(b) (same question)

Regular union does not determine a summand

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

Descriptive
Report issue

Asked again GATE 1999, Q6(a) (same question)

A regular union does not determine its operand

Regular Expressions & Languages

Question 19(b), GATE 1994: If L1 and L1∪L2 are regular, must L2 be regular? Prove the answer.
Tap to enlarge
Answer & solution

Answer: No. Take L1={a,b}* and L2={a^n b^n:n≥0}. (no official key was published)

Choose the common alphabet Σ={a,b}, let L1=Σ*, and let L2={an bn:n≥0}. L1 is recognized by a single accepting state with a loop on each alphabet symbol. Since L2⊆L1, their union is Σ*, also regular. Nevertheless L2 is not regular.

To verify the last assertion, suppose a pumping length p exists. The word ap bp must have a decomposition xyz with |xy|≤p and |y|>0. Consequently y consists of k≥1 copies of a. Pumping y zero times gives ap−kbp, which is not in L2 because the numbers of a and b differ. This contradicts the pumping lemma.

The tempting subtraction argument is invalid: (L1∪L2) minus L1 equals L2 minus L1, not necessarily L2. Regularity of the union controls the portion of L2 outside L1, but places no constraint on its arbitrary portion inside L1. Our counterexample puts all of L2 inside L1, making that gap explicit.

Original paper, page 6