IAE Academy

Theory of Computation formula sheet

28 formulas in 5 topics, each with when to use it. Each is explained in the topic notes.

Print the whole sheet

COMPLEMENT OF A DFA LANGUAGE

Valid only for a complete DFA. Swapping the accepting states of an NFA does not in general complement its language.

PRODUCT CONSTRUCTION (UNION, INTERSECTION, DIFFERENCE)

Run complete DFAs with and states together; states are pairs. Accept when both components accept (intersection), at least one accepts (union), the first accepts and the second does not (difference), or exactly one accepts (symmetric difference).

COMPLEMENT OF A REGULAR LANGUAGE

Applies to a total DFA only. If some transitions are missing, first add a dead (trap) state and send every missing transition to it. The complement DFA has the same states, so the minimal total DFAs of and have the same number of states. Swapping accepting states in an NFA does not complement it: convert the NFA to a DFA first (the subset construction can need up to states for an -state NFA).

PRODUCT CONSTRUCTION

For total DFAs with and states, the product has states. A pair is accepting when both components accept for intersection, when either accepts for union, and when the first accepts and the second does not for difference.

DERIVATION LENGTH IN CHOMSKY NORMAL FORM

For and any derivation of from in a CNF grammar: steps use and steps use . In the parse tree there are variable nodes with two variable children and variable nodes whose only child is a terminal leaf, so variable nodes, one per step.

DERIVATION LENGTH IN GREIBACH NORMAL FORM

For ; each step adds exactly one terminal.

INTERSECTION WITH A REGULAR LANGUAGE

Proved by running a PDA and a DFA together; the same holds for DCFLs. Hence is a CFL, but need not be.

PUMPING LEMMA FOR CONTEXT-FREE LANGUAGES

A necessary condition only: it can prove a language is not context-free, never that it is. If L is generated by a Chomsky normal form grammar with k variables, works.

LANGUAGE OF A TURING MACHINE

Only accepted strings count; strings on which M loops or rejects are outside L(M).

RECURSIVE = RE AND CO-RE

Here the complement is taken with respect to . To decide, run both recognisers in parallel (alternating steps); exactly one of them accepts: the one for if , the one for otherwise.