GATE CSE · Theory Of Computation
Generate GATE-level questions covering formation of regular expressions, equivalence of regular expressions, and conversion between regular expressions and finite automata. Include expression simplification and construction problems.
Concept summary for GATE CSE 2027 · 38 practice questions available
A regular expression (RE) is a formal notation for describing regular languages using algebraic operations on alphabets.
Base cases (over alphabet Σ):
Recursive cases: if R and S are regular expressions:
(high to low): * > concatenation > + (union)
| Language | Regular Expression |
|---|---|
| All strings over {a,b} | (a+b)* |
| Strings starting with a | a(a+b)* |
| Strings ending with b | (a+b)b |
| Strings containing ab | (a+b)ab(a+b) |
| Even length strings | ((a+b)(a+b)) |
| Strings with even number of a's | (baba)b |
| No two consecutive a's | (b+ab)(a+ε) |
| Strings NOT containing aa | (b+ab)(ε+a) |
RE to NFA (Thompson's construction):
DFA to RE (State elimination):
RE for "strings with even number of a's": b*(abab)* or (baba)b - both equivalent. Simplify using algebraic laws before constructing NFA. (R+ε)* = R* is a key identity. RE equivalence: two REs equivalent iff they describe same language (construct DFAs and check equivalence). L((a+b)(aa+bb)(a+b)) = strings containing aa or bb as substring.