Regular Expression Equivalence: Which Pairs Generate the Same Language?
When two regular expressions and are equivalent, they generate the same language: .
We will decide equivalence for each pair by reasoning from the formal meaning of Kleene star: is the set of all concatenations of zero or more strings from , hence it always includes .
We consider the choices:
(i) and
(ii) and
(iii) and
(iv) All of the above
Footnotes
-
Regular expression — Wikipedia. https://en.wikipedia.org/wiki/Regular_expression - Discusses meaning of equivalence via same denoted language and methods to decide equivalence by automata. ↩
-
2 Regular Languages (Kleene star definition, inclusion) — UIUC CS 374 notes PDF. https://courses.grainger.illinois.edu/cs374al1/fa2025/notes/models/02-regular.pdf - Defines Kleene star formally and notes is included via zero concatenations. ↩
Regular Expression Equivalence via Automata (intuition)
Key definitions and tools
- keyword Two regular expressions are equivalent if they generate the same language.
- keyword is the set of all strings matched/generated by regular expression .
- keyword For language , is all concatenations of zero or more strings from .
We’ll repeatedly use the star expansion property:
Footnotes
-
2 Regular Languages (Kleene star definition, inclusion) — UIUC CS 374 notes PDF. https://courses.grainger.illinois.edu/cs374al1/fa2025/notes/models/02-regular.pdf - Defines Kleene star formally and notes is included via zero concatenations. ↩
Decide equivalence for each pair (i)–(iii)
- 1Step 1
Translate each regular expression into the form “zero or more repetitions of a block,” then list structural constraints (e.g., must end with x, must alternate patterns, etc.).
- 2Step 2
To prove non-equivalence, find a string in one language but not the other. To prove equivalence, show every valid string in one can be decomposed into the other’s pattern.
- 3Step 3
If every listed pair is equivalent, the correct answer is (iv); otherwise it is one of (i)–(iii) or none.
Pair (i): and
What language does each side describe?
- is , because star allows zero repetitions.
- means: take any string from , then append an extra .
So and does not include .
Immediate counterexample
- but (because always has the final appended ).
Therefore, and are not equivalent.
Conclusion for (i): NOT equivalent.
(Claim justified because includes .)
Footnotes
-
2 Regular Languages (Kleene star definition, inclusion) — UIUC CS 374 notes PDF. https://courses.grainger.illinois.edu/cs374al1/fa2025/notes/models/02-regular.pdf - Defines Kleene star formally and notes is included via zero concatenations. ↩ ↩2
Pair (ii): and
Let and .
Analyze $1(01)^*`
A string in looks like:
- start with
1 - followed by repetitions of the block
01, for (since star allows ). So for : string is1
for :101
for :10101
So generally:
Analyze $(10)^*1`
A string in looks like:
- take repetitions of
10, for $k\ge 0` - then end with
1. So for : string is1
for :101
for :10101
So generally:
Structural alignment
Notice that: (You can verify by expanding both sides for ; they match exactly.)
Thus and the two regular expressions are equivalent.
Conclusion for (ii): Equivalent.
Pair (iii): and
Let and .
Expand
Strings look like:
- start with a single
- then append repetitions of
xx(for k=0k=1:xxxfor $k=2:xxxxx
So:
Expand
Strings look like:
- append repetitions of
xx - then finish with an .
So:
Same lengths, same form
But concatenation is associative, so: Therefore every string in one set equals a string in the other set (same ).
Conclusion for (iii): Equivalent.
(Uses the definition of Kleene star allowing and repetition structure.)
Footnotes
-
2 Regular Languages (Kleene star definition, inclusion) — UIUC CS 374 notes PDF. https://courses.grainger.illinois.edu/cs374al1/fa2025/notes/models/02-regular.pdf - Defines Kleene star formally and notes is included via zero concatenations. ↩
Final decision: Which option is correct?
- (i) is not equivalent.
- (ii) is equivalent.
- (iii) is equivalent.
So not all of the above are equivalent; therefore (iv) is false.
Answer: Only (ii) and (iii) are equivalent.
Equivalence results for (i)–(iii)
Whether the two regular expressions generate the same language.
Pro Tip: use $\varepsilon$ as a quick discriminator
If one regular expression’s star can generate (because star includes zero repetitions), but the other forces at least one symbol via concatenation, the languages can’t be equal. This immediately settles many equivalence questions.
Warning: do not treat regular expressions syntactically
Even if two expressions look similar (e.g., moving a symbol from the right to the left), the language can change. Equivalence is semantic: compare the generated set of strings, not the text form.
Footnotes
-
Regular expression — Wikipedia. https://en.wikipedia.org/wiki/Regular_expression - Discusses meaning of equivalence via same denoted language and methods to decide equivalence by automata. ↩
Common equivalence-check strategies
Knowledge Check
Which of the following is true about (i) and ?
Explore Related Topics
Classical Behaviourism: Learning Through Stimulus-Response Association
Evaluating ER-to-Relational Mapping Statements
The content explains how standard ER‑to‑relational mapping rules validate three statements about weak entities, partial keys, and many‑to‑many relationships, and shows that the fourth claim—every generated relation has only one candidate key—is false.
- Weak entities depend on a strong owner and are identified by the owner’s primary key plus a partial (discriminator) key.
- A partial key is allowed for weak entities, forming a composite primary key with the owner key.
- Binary relationships are mapped to a separate associative relation containing the participating primary keys.
- A generated relation may have multiple candidate keys; one is chosen as the primary key, so statement (iv) is false.
Ambiguity of the Grammar $S \rightarrow SS \mid aSb \mid bSa \mid \epsilon$