Deterministic and nondeterministic finite automata, subset construction, regular expressions and their identities, conversions between them (Arden's theorem), and DFA minimisation. GATE asks minimal DFA state counts, the language of a regex and equivalences.
A DFA is a 5-tuple : finite states , input alphabet , transition function , start state and accepting states . Each state has exactly one move on each symbol. The extended function follows the string symbol by symbol; is accepted if . The set of accepted strings is , and a language is regular if some DFA accepts it.
Design by meaning of states. Decide what each state must remember about the input read so far.
Language over
What a state remembers
Minimal DFA states
number of 's
count mod
ends in
longest suffix that is a prefix of
3
contains
progress towards
4
length and even number of 's
(length mod 3, -count mod 2)
6
binary numbers divisible by
value mod
at most
For the value of a binary string mod : reading bit in state moves to .
A dead (trap) state is a non-accepting state with all moves to itself. Questions that ask for a DFA usually expect a complete DFA, so count the dead state if the language needs one (for example, strings that start with ).
Minimal DFA over {a, b} for strings ending in ab. q0: no progress, q1: just read a, q2 (accepting): just read ab
2. NFA, epsilon moves and the subset construction
An NFA may have zero, one or many moves on a symbol: . An -NFA can also move without reading input. A string is accepted if some path of choices ends in an accepting state.
NFAs, -NFAs and DFAs accept exactly the same class: the regular languages. The subset construction converts an NFA to a DFA:
The DFA start state is .
From a set on symbol , move to .
A DFA state is accepting if it contains any NFA accepting state.
Only reachable subsets need to be built. An -state NFA can need up to DFA states. The standard witness: strings whose -th symbol from the end is have an NFA with states but a minimal DFA with states, because the DFA must remember the last symbols.
For the NFA in the figure (), the reachable subsets are : 4 DFA states, the last two accepting.
Closure properties of regular languages: union, intersection, complement, difference, concatenation, Kleene star, reversal and homomorphism. Product construction runs two DFAs in parallel on pairs of states (for intersection or union). Complement swaps accepting and non-accepting states of a complete DFA; doing it on an NFA is wrong.
NFA for strings whose second-last symbol is a: it guesses which a is second from the end
3. Regular expressions and their identities
Regular expressions over : , and each symbol are regular expressions; if are, so are (union), (concatenation) and (zero or more). Precedence: star, then concatenation, then union. So means .
Kleene's theorem: a language is regular if and only if some regular expression denotes it.
Identity
Note
,
kills concatenation
, ,
,
one or more
all strings
shifting rule
is in the left only
To check a claimed equality, test short strings, especially and strings like , , . One string in one language but not the other settles it.
Useful patterns: strings with no two consecutive 's are ; strings with an even number of 's are ; strings whose second-last symbol is are .
4. Converting automata to expressions and minimising DFAs
Arden's theorem. If does not contain , the equation has the unique solution . To get a regular expression from a DFA, write one equation per state: a state equals the sum over its incoming edges (source state times symbol), plus for the start state. Solve by substitution and Arden's rule, then add the expressions of the accepting states. (State elimination gives the same answer by removing states one at a time and relabelling edges with expressions.)
RE to NFA (Thompson's construction) builds an -NFA with small pieces for union, concatenation and star.
Minimisation. Two states are equivalent if for every string , . To minimise:
Remove states unreachable from the start.
Split into accepting and non-accepting groups.
Repeatedly split a group if two of its states go, on some symbol, to different groups.
When nothing splits, each group is one state of the minimal DFA.
The minimal DFA is unique up to renaming states. By the Myhill–Nerode theorem, its number of states equals the number of classes of the relation iff, for all , . To prove a DFA needs at least states, find strings that are pairwise distinguishable by some suffix.
Two regular expressions or automata are equivalent exactly when their minimal DFAs are the same.
Formulas to remember
DFA
NFA transition
Subset construction bound
Arden's theoremWhen
Binary value mod n
Product DFA sizeFor intersection or union of two DFAs
Common mistakes
Forgetting the dead state when the question asks for a complete DFA, for example for strings that start with a fixed prefix.
Complementing an NFA by swapping its accepting states; that works only on a complete DFA.
Reading as ; star binds tighter than concatenation.
Assuming ; the right side has no string with both letters.
Applying Arden's rule when contains ; the solution is then not unique.
Merging states in minimisation only because they have the same accept status; their moves must also lead to the same groups.
Worked examples
Try each step yourself, then reveal the working.
Example 1: Minimal DFA for strings ending in ab
numerical
Over , design the minimal DFA for strings that end in and count its states.
Step 1: Decide what each state remembers.
Try it on paper first.
Example 2: Subset construction
numerical
Convert the NFA in the figure (second-last symbol is ) into a DFA. How many reachable DFA states are there, and which accept?
Step 1: Start from the start set.
Try it on paper first.
Example 3: Regular expression from a DFA by Arden's theorem
numerical
Use Arden's theorem on the DFA of the figure to find a regular expression for its language.
Step 1: Write one equation per state.
Try it on paper first.
Example 4: Minimising a DFA
numerical
A DFA over has start , accepting , and moves (on 0, on 1): : , : , : , : , : . Minimise it.
Step 1: Make the first split.
Try it on paper first.
Previous year questions
25 official GATE CSE questions on this topic, newest first.
10 questions: up to 4 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.
Mark as mastered
Loading your progress…
My revision notes
Notes written by the GATEiit team against the official GATE CSE syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.