Cheat sheets

TOC-04Cheat sheet1 pageIn a paid pack

DFA, NFA and ε-NFA

The formal definitions of DFA, NFA and epsilon-NFA as 5-tuples, the extended transition function and acceptance, complete versus partial DFAs and the dead state, why swapping final states complements a complete DFA but not an NFA or a partial DFA, the equal power of the three models, and Moore and Mealy machines with output lengths and conversions. Every automaton shown was simulated on all strings up to length 10.

Diagrams from TOC-04

TOC-05Cheat sheet1 pageIn a paid pack

Subset and Product Constructions

The subset construction from NFA or epsilon-NFA to DFA built on reachable subsets only, the empty set as the dead state, the 2^n upper bound and the k-th-symbol-from-the-end family that reaches it, the product construction for intersection, union, difference and symmetric difference with its m times n bound, examples where the product is not minimal, and the reversal blow-up. All subsets and state counts were computed by script.

Diagrams from TOC-05

TOC-06Cheat sheet1 pageIn a paid pack

DFA Minimisation and Myhill-Nerode

Minimising a DFA: remove unreachable states, refine the final and non-final partition until stable (Moore), or mark distinguishable pairs round by round (table filling), with a fully worked six-state example including an unreachable state; the Myhill-Nerode relation and why the minimal DFA is unique up to renaming; class counts for standard languages; algorithm costs; complement and equivalence facts; and counting labelled DFAs. Every partition, mark and count is script output.

Diagrams from TOC-06

TOC-07Cheat sheet1 pageIn a paid pack

Designing DFAs and Counting States

How to design DFAs by deciding what the machine must remember: remainder automata for divisibility in base 2 and other bases (with the m plus k rule for even divisors), substring, prefix and suffix automata, length and counting conditions, products of independent conditions, and counting the strings of length n that a DFA accepts by dynamic programming over states. Every minimal state count in the tables is computed by brute-force minimisation.

Diagrams from TOC-07