4.6.6 · D5Theory of Computation
Question bank — Regular languages — closed under union, intersection, complement, concatenation, Kleene star
The pictures below show the four constructions these questions probe — glance at the matching figure whenever a prompt talks about "the product machine" or "the -glue."
Product machine (parallel run → union / intersection):

Complement (same DFA, flipped accept states):

Concatenation and star (-glue):

True or false — justify
The empty language and the language of all strings are both regular
True — a 1-state DFA that accepts nothing (no accept states) gives ; make that one state accepting and you get . Both are finite machines, so both are regular.
Regular languages are closed under complement, so the complement of a regular language is always a different language
False — closure says the complement is still regular, not that it differs. Complementing gives , but complementing a language equal to its own complement is impossible over a fixed ; still, "closed" only promises "stays regular."
If and are regular then (strings in but not ) is regular
True — write . Complement of is regular, intersection of two regulars is regular (Product Construction), so the difference is regular.
If is regular, then and must each be regular
False — closure runs one direction only. Take (non-regular) and ; their union is (regular), yet neither piece is regular.
The intersection of infinitely many regular languages is always regular
False — closure is proved only for two (hence any finite number by induction), and the proof does not extend to infinitely many. It happens to often stay regular, but there is no theorem guaranteeing it, so "always" is unjustified; the finite-case machine construction simply gives no machine for an infinite intersection.
Kleene star of a regular language always contains the empty string
True — by definition collects concatenations of strings from for every , and the case (zero copies) is the empty concatenation, which equals — regardless of what is (even gives ).
Concatenation of regular languages is commutative:
False — concatenation glues strings in order (). With , , . It's still regular either way, but not commutative.
If is regular then its reversal (every string spelled backward) is regular
True — flip every transition arrow, swap start and accept roles (via an -start), and you get an NFA for . It's a standard closure result even though it isn't in the "big five."
Spot the error
"To complement an NFA, just swap accept and non-accept states."
Error: an NFA can reach both an accepting and a non-accepting state on the same input via parallel paths, so swapping accepts strings the original also accepted. Fix: run Subset Construction (NFA to DFA) to get a DFA first, then swap.
"For , mark the old start state as accepting so is accepted."
Error: if has incoming loop-back arrows, a string can pass through mid-word without completing a copy of and get wrongly accepted. Fix: add a fresh start/accept state with , and loop back to , not into .
"For concatenation , add an -arrow from one accept state of to 's start."
Error: the prefix could finish at any accept state of , so a single arrow misses valid splits. Fix: add the -arrow from every accept state of (every state in ) to the start of .
" shows union needs intersection, so we can't build union directly."
Error: the De Morgan identity (see De Morgan's Laws) is just a second proof of union closure — a cross-check. Union also has direct constructions (product with accept set , or an -NFA guessing which machine).
"The product DFA for intersection has states."
Error: the product tracks both current states as a pair , so it has states — a product, not a sum. That's the whole point of running the machines in parallel.
"Since is not regular and is regular, intersecting them proves closure fails."
Error: intersection with only produces a non-regular result when the other input is already non-regular. Closure never fails for two regulars; the argument instead proves the other language is non-regular by contradiction (see Pumping Lemma for Regular Languages).
"Union via -NFA needs the two machines to share an alphabet, so different alphabets break it."
Error: you simply take the alphabet to be the union ; both machines then read over the common alphabet (missing transitions go to a dead state). Alphabet mismatch is a bookkeeping step, not a wall.
Why questions
Why does the complement construction require a DFA rather than an NFA?
Because a DFA lands in exactly one state per input, so "accept vs reject" is a clean flip. An NFA's "accept if some path succeeds" has no clean opposite — negating "some path" needs "all paths," which determinization supplies.
Why does the product construction give both intersection and union with the same states?
The product tracks the full pair of states , which is all the information either machine has. Intersection and union differ only in which pairs you call accepting ( for AND, the larger set for OR), not in the machine itself.
Why must concatenation and star use NFAs rather than staying with DFAs?
Both need to guess something a DFA can't: concatenation guesses where to split , and star guesses when one copy of ends. Nondeterminism plus -jumps encode "try every split/restart point at once."
Why is closure under intersection not something we get "for free" the way experienced students expect from union?
We do get it free three ways — product directly, or via (De Morgan), or from complement+union. The point is that any one closure proof plus De Morgan bootstraps the others; none is truly independent.
Why does building a machine for the result prove the result is regular?
Because "regular" is defined as "accepted by some finite automaton" (equivalently, described by a regular expression). Exhibiting a machine is exactly meeting the definition — no separate argument needed.
Why can we prove a language regular by decomposing it, without ever drawing a state diagram?
Closure guarantees that if the pieces are regular and you only combine them with the five operations, the whole stays regular. The construction exists even if we never write it out — existence is all the definition asks.
Edge cases
What is (Kleene star of the empty language)?
— the only way to build a string from zero copies (the case) of a language with no strings is the empty concatenation, which yields . So is not empty.
What is (star of the language containing only the empty string)?
Still — concatenating with itself any number of times just gives again. Star can't manufacture new strings from alone.
Is regular even when is a single infinite regular language?
Yes — the star construction (fresh , loop-back -arrows) works for any regular , finite or infinite. Regularity of depends only on being regular, not on being finite.
If is regular, is still "proved regular" by the product construction?
Yes, trivially — running two copies of the same machine in parallel gives a product DFA, and the accept set recovers . It's a valid (if redundant) instance of closure.
What does concatenating with the empty language give: ?
— since there is no to append, no string can be formed. The -glue construction dead-ends because for has no accept state. It's regular (empty is regular).
Is the complement of a non-regular language ever regular?
It can be — but if were regular, then would be regular too (complement closure). So non-regular forces non-regular; a regular complement is impossible for a non-regular .
Recall One-line summary of every trap
Complement needs a DFA (one path); concatenation needs all accept states of ; star needs a fresh state; the product has states; closure runs input→output, never backward; and , not .