SemSure
←Formal Language & Automata · Unit 1NFA → DFA (subset construction)✓ 0/71/78
① Topic

From NFA to DFA

Definition · DFA
A deterministic finite automaton is a 5-tuple where is a finite set of states, is the input alphabet, is the transition function, is the start state and is the set of final states. From every state there is exactly one move on every symbol.
Definition · NFA
A non-deterministic finite automaton has the same five parts, but : on one symbol a state may move to a set of states, possibly empty. The NFA accepts a string if at least one path ends in a final state.
Definition · Subset construction
For an NFA with states , the equivalent DFA has states that are subsets of . Its start state is , its transition is , and a subset is final if it contains at least one final state of the NFA. An NFA with n states gives a DFA with at most states.
Samjho
NFA ek saath kai states mein “ho sakta” hai. DFA us poore group ko ek hi state maan leta hai. Toh DFA ki har state ek set hai, jaise {P,Q}. Bas har set ke liye har symbol pe dekho ki group ke saare members milke kahan jaate hain.
Exam tip This is the most repeated Unit 1 question: 7 of the last 9 papers asked for it, and two different NFAs came back twice each.

Opens chatgpt.com in a new tab with a ready-made prompt for this topic.

② Question

The question as asked

8 marksAsked in: May 2026 Q21b; the same NFA with states a, b, c, d in Nov 2023 Q21a

Construct a DFA equivalent to the NFA where is:

The table is empty. Press Next step to fill it one row at a time (4 steps).

State01

In Nov 2023 the states were named a, b, c, d with finals b and d. Rename a→P, b→Q, c→R, d→S and the answer is identical.

③ Learn · step 1 of 3

The method, one row at a time

The rule: start from . For each subset and each symbol, take the union of the rows of its states. A new subset joins the queue. Stop when the queue is empty. Subsets containing Q or S are final.

1 of 4
③ Learn · step 2 of 3

Every subset, with the union written out

This is the whole construction in one table. Each row takes one subset, and for each symbol writes the union of the NFA rows of its members. Any result not seen before goes into the last column and gets its own row later.

1 of 6
③ Learn · step 3 of 3

Check: NFA and DFA give the same answer

Run a string on the NFA, keeping the set of states it could be in after each symbol. Each set is exactly the DFA state reached by the same prefix, so this doubles as a trace of the DFA.

1 of 5
④ Exam answer

Write this in the booklet

Let the DFA be . Using and starting from , the reachable subsets are:

DFA state01
→ [P][Q,S][Q]
* [Q,S][R][P,Q,R]
* [Q][R][Q,R]
[R][S][P]
* [P,Q,R][Q,R,S][P,Q,R]
* [Q,R][R,S][P,Q,R]
* [S]∅[P]
* [Q,R,S][R,S][P,Q,R]
* [R,S][S][P]
∅ (dead)∅∅

, start state , and , the subsets containing Q or S.

Draw the transition diagram from this table: one circle per row, double circles for the starred rows, and an arrow into [P].

② Question

NFA p, q, r, s (final s) to DFA

8 marksAsked in: Jul 2024 Q21b, Jul 2025 Q21b(i)

Construct a DFA equivalent to the NFA with the transition table:

State01
→ p{p, q}{p}
q{r}{r}
r{s}∅
* s{s}{s}
③ Learn · step 1 of 4

Read the NFA before converting

The start state is p and the only final state is s.

1 of 4
③ Learn · step 2 of 4

Build each subset's moves

For each subset and each symbol, take the union of the rows of its members. A subset seen for the first time is added to the list to process.

1 of 3
③ Learn · step 3 of 4

The DFA table and its final states

Collect the results into the DFA table. Each row is one subset.

1 of 4
③ Learn · step 4 of 4

Check on one string

Run 0100 on both machines. They must agree.

1 of 4
④ Exam answer

Booklet answer · NFA p, q, r, s (final s) to DFA

Given: .

Subset construction. Start with . For each new subset S and symbol a, compute .

DFA stateOn 0On 1
→ [p][p,q][p]
[p,q][p,q,r][p,r]
[p,q,r][p,q,r,s][p,r]
[p,r][p,q,s][p]
* [p,q,r,s][p,q,r,s][p,r,s]
* [p,q,s][p,q,r,s][p,r,s]
* [p,r,s][p,q,s][p,s]
* [p,s][p,q,s][p,s]

Final states: every subset containing s, that is [p,q,r,s], [p,q,s], [p,r,s], [p,s].

Result: the DFA has 8 states, start state [p], and no dead state because p is in every subset. Draw the diagram from the table, with double circles on the final states.

② Question

NFA for second-last symbol 1, to DFA, with tests

8 marksAsked in: Nov 2024 Q21a, Jul 2025 (P2) Q21b

Construct an NFA that accepts all strings over {0,1} whose second-last symbol is 1, convert it to a DFA, and test the strings 100010 and 100000.

③ Learn · step 1 of 5

Design the NFA by guessing

An NFA can guess. q0 reads any prefix and loops on 0 and 1.

1 of 5
③ Learn · step 2 of 5

Subset construction

Name the subsets A, B, C, D in the order they are found.

1 of 3
③ Learn · step 3 of 5

The DFA

DFA stateSubset of NFA statesOn 0On 1
→ A{q0}AB
B{q0, q1}CD
* C{q0, q2}AB
* D{q0, q1, q2}CD
1 of 4
③ Learn · step 4 of 5

Test 100010

The table is empty. Press Next step to fill it one row at a time (7 steps).

StepStateReadNext stateMeaning of the next state

It ends in C, a final state, so 100010 is accepted. Its second-last symbol is indeed 1.

③ Learn · step 5 of 5

Test 100000

The table is empty. Press Next step to fill it one row at a time (7 steps).

StepStateReadNext stateMeaning of the next state

It ends in A, which is not final, so 100000 is rejected. Its second-last symbol is 0.

Common mistake The final state q2 must have no outgoing moves in the NFA. If q2 looped on 0 and 1, the NFA would accept every string that has a 1 anywhere before the end.
④ Exam answer

Booklet answer · NFA for second-last symbol 1, to DFA, with tests

NFA: with , , , and no moves from .

0,110,1q0q1q2
NFA: the second-last symbol is 1

Equivalent DFA by subset construction:

DFA stateSubset of NFA statesOn 0On 1
→ A{q0}AB
B{q0, q1}CD
* C{q0, q2}AB
* D{q0, q1, q2}CD
01010101ABCD
DFA: C and D are final because they contain q2

Tests. 100010: A → B → C → A → A → B → C, ends in a final state, accepted. 100000: A → B → C → A → A → A → A, ends in A, rejected.

① Topic

Finite automata with output

Definition · Moore machine
A Moore machine is a 6-tuple where is the output alphabet and gives an output for each state. For an input of length n it produces n + 1 outputs, the first one from the start state.
Definition · Mealy machine
A Mealy machine is the same 6-tuple, but gives an output for each transition. For an input of length n it produces exactly n outputs.
PointMooreMealy
Output depends onpresent state onlypresent state and present input
Output writteninside the state, q/0on the edge, a/0
Length of outputn + 1 for input of length nn
Number of statesusually moreusually fewer
Reaction to inputoutput changes one clock lateroutput changes immediately
ConversionMoore → Mealy keeps the state countMealy → Moore may split states
Samjho
Moore mein output state ke andar likha hota hai, isliye state mein ghuste hi output aa jata hai. Mealy mein output arrow pe likha hota hai, yaani input aate hi output mil jata hai. Mealy se Moore banate waqt jis state mein alag-alag output wale arrows aate hain, use tod dena padta hai.

Opens chatgpt.com in a new tab with a ready-made prompt for this topic.

② Question

The question as asked

8 marksAsked in: May 2026 Q21a

Convert the following Mealy machine to a Moore machine.

a/1b/0a/1, b/1a/0b/1a/1b/1q1q2q4q3
The given Mealy machine (input on the left of /, output on the right)
③ Learn · step 1 of 3

Split states by incoming output

Step 1: transition table of the Mealy machine.

1 of 4
③ Learn · step 2 of 3

The split, state by state

Step 2 in a table. List every arrow that enters each state, with the output printed on it. A Moore state can print only one output, so a state that receives two different outputs has to be copied, once per output.

1 of 4
③ Learn · step 3 of 3

Check: both machines print the same thing

Feed the same input to both machines. The Moore machine prints one extra symbol at the start (the output of its start state); after that, each Moore output must equal the Mealy output of the same step.

1 of 3
④ Exam answer

Write this in the booklet

Incoming outputs: q1 receives only 1, q2 receives 0 and 1, q3 receives 0 and 1, q4 receives only 1. So q2 splits into and q3 splits into .

Moore stateabOutput λ
→ q1q1q201
q20q4q40
q21q4q41
q30q21q310
q31q21q311
q4q30q11

The Moore machine is with the table above. Draw each state as a circle labelled state/output, for example .

Common mistake The start state q1 has output 1 here, so the Moore machine prints 1 even for the empty input. If the examiner wants the empty input to give no meaningful output, add a new start state with the same outgoing moves as q1 and mention it.
② Question

Moore machine for 'ends in 10 / 11', then convert to Mealy

8 marksAsked in: Nov 2024 Q21b

Design a Moore machine over {0,1} that outputs a if the input ends in 10, b if it ends in 11, and c otherwise. Convert it to a Mealy machine.

③ Learn · step 1 of 4

Decide what each state remembers

The output depends only on the last two symbols, so the states remember just enough of them.

StateMeaningOutput
q0start, or ends in 0 but not in 10c
q1ends in 1 but not in 11c
q2ends in 10a
q3ends in 11b
③ Learn · step 2 of 4

Fill in the moves

From q1 (last symbol 1): a 0 makes the ending 10, so go to q2. A 1 makes it 11, so go to q3.

1 of 5
③ Learn · step 3 of 4

Check the Moore machine

Run 1011. The last output should be b, because 1011 ends in 11.

1 of 3
③ Learn · step 4 of 4

Convert to Mealy

Rule: the output on an arrow into state q is , the output of the state it enters.

1 of 6
④ Exam answer

Booklet answer · Moore machine for 'ends in 10 / 11', then convert to Mealy

Moore machine with , :

State01λ
→ q0q0q1c
q1q2q3c
q2q0q1a
q3q2q3b
01010101q0/cq1/cq2/aq3/b
Moore machine: the output is written inside each state

Conversion to Mealy: each arrow into q gets output . Rows of q0 and q2 coincide, as do q1 and q3, giving the 2-state Mealy machine:

State01
→ AA, cB, c
BA, aB, b

Check with 1011: Moore prints c c a c b, Mealy prints c a c b, the same once the start output is dropped.

② Question

Moore machine for divisibility by 3

8 marksAsked in: May 2025 Q21b(1)

Compare Mealy and Moore machines, and construct a Moore machine that computes divisibility of a binary number by 3.

③ Learn · step 1 of 4

Mealy versus Moore

PointMealy machineMoore machine
Output depends onthe state and the input symbolthe state only
Output is writtenon the arrows (a/x)inside the states (q/x)
Outputs for an input of length nnn + 1 (the start state also prints)
Number of statesusually fewerusually more
Reaction to inputimmediate, in the same stepone step later, on entering the state

Each type can be converted into the other, so they compute the same functions.

③ Learn · step 2 of 4

Remember the remainder

Read the binary number from the most significant bit. Keep only the remainder r of the number read so far, divided by 3.

1 of 4
③ Learn · step 3 of 4

Compute every move

The table is empty. Press Next step to fill it one row at a time (3 steps).

StateOn 0On 1Output λ

The number is divisible by 3 exactly when the machine ends in q0, that is when the last output is 0.

③ Learn · step 4 of 4

Check on 110 and 1011

110 is 6, which is divisible by 3:

1 of 6
④ Exam answer

Booklet answer · Moore machine for divisibility by 3

Mealy vs Moore: in a Mealy machine the output depends on the state and the input and is written on the arrows; in a Moore machine it depends on the state only and is written in the states. A Moore machine gives n + 1 outputs for n inputs, a Mealy machine n. Each can be converted to the other.

Divisibility by 3: state means the number read so far leaves remainder r. Reading bit b gives .

StateOn 0On 1Output λ
→ q0 (r = 0)(2·0 + 0) mod 3 = 0 → q0(2·0 + 1) mod 3 = 1 → q10
q1 (r = 1)(2·1 + 0) mod 3 = 2 → q2(2·1 + 1) mod 3 = 0 → q01
q2 (r = 2)(2·2 + 0) mod 3 = 1 → q1(2·2 + 1) mod 3 = 2 → q22

The output of the last state is the remainder; the number is divisible by 3 if and only if it ends in . Example: 110 (six) goes q0 → q1 → q0 → q0, output 0.

② Question

Mealy machine for the 2's complement

4 marksAsked in: Jul 2025 Q21a(ii)

Construct a Mealy machine that gives the 2's complement of any binary input (the last carry is neglected).

③ Learn · step 1 of 3

The rule, read from the right

Read the number from the least significant bit, which is the right end.

1 of 4
③ Learn · step 2 of 3

Two states

q0 means no 1 has been seen yet. q1 means a 1 has been seen.

1 of 3
③ Learn · step 3 of 3

Check on 01100

01100 is 12. Read it from the right: 0, 0, 1, 1, 0.

1 of 4
④ Exam answer

Booklet answer · Mealy machine for the 2's complement

Reading from the least significant bit, the 2's complement copies bits up to and including the first 1 and inverts the rest. States: (no 1 seen) and (1 seen).

State01
→ q0q0, 0q1, 1
q1q1, 1q1, 0
0/01/10/1, 1/0q0q1
Mealy machine for the 2's complement (input read from the right)

Example: 01100 read from the right gives 0 0 1 0 1, i.e. 10100, and 01100 + 10100 = 100000 (carry dropped).

② Question

Outputs of a Moore machine for aabab and ababb

4 marksAsked in: Jul 2025 Q21b(ii)

For the Moore machine q0/0 (a → q1, b → q0), q1/0 (a → q1, b → q2), q2/1 (a → q1, b → q0), find the outputs for aabab and ababb.

③ Learn · step 1 of 3

How a Moore machine prints

The machine prints the output of the start state first.

1 of 3
③ Learn · step 2 of 3

Run aabab

Read(start)aabab
Stateq0q1q1q2q1q2
Output000101

The output for aabab is 000101.

③ Learn · step 3 of 3

Run ababb

Read(start)ababb
Stateq0q1q2q1q2q0
Output001010

The output for ababb is 001010.

④ Exam answer

Booklet answer · Outputs of a Moore machine for aabab and ababb

A Moore machine prints λ(q0) first, then the output of every state entered.

Read(start)aabab
Stateq0q1q1q2q1q2
Output000101
Read(start)ababb
Stateq0q1q2q1q2q0
Output001010

Outputs: aabab → 000101, ababb → 001010.

① Topic

Design a DFA from a description

Definition · Language of a DFA
The extended transition function is defined by and . The language of the DFA is . A language is regular if and only if some DFA accepts it.

A reliable recipe for every design question:

  1. Decide what the machine must remember (a parity, a remainder, how much of a pattern has been seen).
  2. Make one state for each possible value of that memory, and write in words what each state means.
  3. Fill the transition for every state on every symbol, adding a dead state if some inputs can never lead to acceptance.
  4. Mark the final states and test two accepted and two rejected strings.
Samjho
DFA ke paas sirf states hi memory hain. Isliye pehle socho “mujhe kya yaad rakhna hai”, jaise 0s even hain ya odd. Jitni possible values, utni states.

Opens chatgpt.com in a new tab with a ready-made prompt for this topic.

② Question

The question as asked

8 marksAsked in: May 2024 Q21a
Construct a DFA that accepts all strings over {0,1} with an odd number of 1s and an even number of 0s.
③ Learn · step 1 of 2

Two parities, four states

The machine must remember two things: whether the number of 0s seen so far is even or odd, and the same for 1s. That gives four combinations, so four states. Reading a 0 flips only the 0-parity; reading a 1 flips only the 1-parity.

11110000EEEOOEOO
First letter: parity of 0s, second letter: parity of 1s (E even, O odd). Final state: EO.
Samjho
Ek square socho. Horizontal arrows 1 padhne pe, vertical arrows 0 padhne pe. Final wahi corner hai jahan 0 even aur 1 odd hai.
Understand it on YouTube
③ Learn · step 2 of 2

Filling the table, one cell at a time

Every cell follows one rule: a 0 flips the first letter, a 1 flips the second letter.

1 of 6
④ Exam answer

Write this in the booklet

Let the states record (parity of 0s, parity of 1s): . Then , where:

State01
→ qEEqOEqEO
* qEOqOOqEE
qOEqEEqOO
qOOqEOqOE

Check. 1: qEE →1 qEO, accepted (zero 0s, one 1). 001: qEE →0 qOE →0 qEE →1 qEO, accepted. 01: ends in qOO, rejected. 11: ends in qEE, rejected.

② Question

Formal description of DFA and NFA; DFA that never contains xxy

8 marksAsked in: May 2025 Q21a

(1) Illustrate the formal description of a DFA and an NFA with suitable examples. (2) Construct a DFA that accepts all strings over {x,y} that never contain the substring xxy.

③ Learn · step 1 of 4

Part 1: the two 5-tuples

Definition · DFA
A DFA is : Q a finite set of states, Σ the input alphabet, the transition function, the start state and the final states.
1 of 3
③ Learn · step 2 of 4

Part 1: one example of each

DFA example: the machine built in part 2 below, where every state has exactly one arrow on x and one on y.

1 of 3
③ Learn · step 3 of 4

Part 2: track how much of xxy has been read

q0 means no part of xxy is pending. q1 means we just read one x. q2 means we just read two or more x's.

1 of 4
③ Learn · step 4 of 4

Part 2: the diagram and two tests

yxyxxyx,yq0q1q2q3
Final states: q0, q1, q2. q3 is the trap state.
1 of 5
④ Exam answer

Booklet answer · Formal description of DFA and NFA; DFA that never contains xxy

(1) DFA: with . NFA: the same tuple with . Example DFA: the machine in (2). Example NFA: strings whose second-last symbol is 1, where .

(2) States record the longest pending prefix of xxy.

StateOn xOn yWhat the state remembers
→ * q0q1q0no part of xxy pending
* q1q2q0just read one x
* q2q2q3just read xx or more x's
q3q3q3xxy has appeared: dead
yxyxxyx,yq0q1q2q3
Final states: q0, q1, q2. q3 is the trap state.

F = {q0, q1, q2}; q3 is the trap state reached exactly when xxy occurs.

② Question

Minimal DFA for aⁿbᵐ, n ≥ 2, m ≥ 1

8 marksAsked in: Nov 2025 Q21a

Construct a minimal DFA for .

③ Learn · step 1 of 4

What the machine must check

At least two a's come first.

1 of 4
③ Learn · step 2 of 4

One state per stage

StateOn aOn bWhat the state remembers
→ q0q1qdnothing read
q1q2qdone a
q2q2q3two or more a's
* q3qdq3a's then at least one b (final)
qdqdqddead: pattern broken
1 of 3
③ Learn · step 3 of 4

Test two strings

The table is empty. Press Next step to fill it one row at a time (5 steps).

StepStateReadNext stateMeaning of the next state
1 of 4
③ Learn · step 4 of 4

Why no state can be removed

A DFA is minimal when every pair of states can be told apart by some string. For each pair, here is the shortest such string:

1 of 3
④ Exam answer

Booklet answer · Minimal DFA for aⁿbᵐ, n ≥ 2, m ≥ 1

States: q0 (start), q1 (one a), q2 (two or more a's), q3 (a's followed by at least one b, final) and qd (dead).

StateOn aOn b
→ q0q1qd
q1q2qd
q2q2q3
* q3qdq3
qdqdqd
aaabbbbaa,bq0q1q2q3qd
Minimal DFA for aⁿbᵐ with n ≥ 2, m ≥ 1

Minimality: every pair of states is distinguishable (for example q2 and q1 by the string b, q3 and qd by ε), so no two states can be merged. The minimal DFA has 5 states.

① Topic

NFA with ε-moves

Definition · ε-NFA
An ε-NFA is an NFA whose transition function is , so it may change state without reading any input.
Definition · ε-closure
is the set of states reachable from q using only ε-moves, including q itself. For a set S, .

Conversion to a DFA: the start state is , and . A DFA state is final if it contains an ε-NFA final state.

Samjho
Formula yaad karne ka shortcut: “closure, move, closure”. Pehle ε se jahan ja sakte ho wahan jao, phir symbol padho, phir dobara ε se jahan ja sakte ho wahan jao.

Opens chatgpt.com in a new tab with a ready-made prompt for this topic.

② Question

The question as asked

8 marks (with a 4-mark Mealy part)Asked in: Jul 2025 Q21a(i)

For the ε-NFA below, (1) compute the ε-closure of each state and (2) convert it to a DFA.

The table is empty. Press Next step to fill it one row at a time (3 steps).

Stateεabc
③ Learn

Closure, move, closure, step by step

Part 1, ε-closures. Start at the state, then follow ε-arrows as far as they go. Include the state itself, because taking zero ε-moves is allowed.

1 of 4
④ Exam answer

Worked answer

(1) , , .

(2) Start state .

.

.

.

, , .

for every x, and D is a dead state.

DFA stateabc
→* A = {p,q,r}ABA
* B = {q,r}ACA
* C = {r}DDD
D = ∅DDD

A, B and C contain the final state r, so all three are final.

① Topic

Minimising a DFA

Definition · Equivalent states
Two states p and q are equivalent if for every string w, and are either both final or both non-final. Otherwise they are distinguishable. Merging all equivalent states gives the unique minimal DFA.

Table-filling (Myhill–Nerode) algorithm:

  1. Remove states that cannot be reached from the start state.
  2. Draw a triangle of all pairs. Mark every pair with one final and one non-final state (round 0).
  3. For each unmarked pair (p, q) and each symbol a, if the pair is already marked, mark (p, q).
  4. Repeat step 3 until a full round marks nothing. Unmarked pairs are equivalent; merge them.
Samjho
Do states tab tak “same” hain jab tak koi string unhe alag na kar de. Final aur non-final pehle hi alag hain. Phir har round mein dekho ki kisi symbol pe pair kisi already alag pair pe to nahi jaata.
Understand it on YouTube

Opens chatgpt.com in a new tab with a ready-made prompt for this topic.

② Question

The question as asked

8 marksAsked in: Jul 2025 Q22a

Use the table-filling algorithm to minimise the DFA below (start q0, final q2).

The table is empty. Press Next step to fill it one row at a time (8 steps).

State01

The paper gives this as a diagram; this table is read directly from it.

③ Learn · step 1 of 2

Round by round, every pair checked

Below, every unmarked pair is checked in every round, including the ones that stay unmarked, so you can see exactly why each pair is or is not marked.

1 of 8
③ Learn · step 2 of 2

Building the minimal DFA from the classes

Name the classes A = {q0, q4}, B = {q1, q7}, C = {q2}, D = {q5}, E = {q6}. Fill each row using any one member of the class:

1 of 3
④ Exam answer

Write this in the booklet

q3 is unreachable and is deleted. After round 0 (pairs with q2), round 1 (11 pairs) and round 2 ((q0,q6) and (q4,q6)), the unmarked pairs are (q0,q4) and (q1,q7). So and .

Minimal state01
→ A = {q0,q4}BD
B = {q1,q7}EC
* C = {q2}AC
D = {q5}CE
E = {q6}EA
0101010101ABCDE

The minimal DFA has 5 states instead of 8.

① Topic

Mathematical induction

Definition · Principle of mathematical induction
To prove a statement for every integer : (1) basis, prove ; (2) inductive step, assume for an arbitrary (the inductive hypothesis) and prove . Then holds for all .
Samjho
Domino jaisa: pehla domino giro (basis), aur dikhao ki koi bhi domino gire to agla bhi girega (step). Bas, saare gir jayenge.

Opens chatgpt.com in a new tab with a ready-made prompt for this topic.

② Question

The question as asked

8 marksAsked in: Jul 2024 Q21a
Prove that for all positive integers n.
③ Learn

Every line of the algebra explained

First, check small cases so you trust the formula: n = 2 gives 1 + 4 = 5 and ; n = 3 gives 1 + 4 + 9 = 14 and .

1 of 8
④ Exam answer

Write this in the booklet

Let .

Basis (n = 1). LHS . RHS . So P(1) is true.

Inductive hypothesis. Assume P(k) is true for some : .

Inductive step. Then

which is P(k + 1). By the principle of mathematical induction, P(n) holds for all positive integers n.

Exam tip The key factorisation is . Write it as a separate line so the examiner sees it.
Practice

Part A quick check

AskedAnswerWhy
DFA transition functionone next state for each (state, symbol)
A DFA cannot be represented asan undirected graphtransitions have a direction
From each DFA state, on each symbolexactly one transitionthat is what deterministic means
NFA with N states → DFA has at mostone DFA state per subset
NFA, ε-NFA and DFAaccept the same class (regular languages)each converts to a DFA
A language is regular iffsome DFA accepts itdefinition used in this syllabus
NOT a property of a finite automatonit has a stacka stack belongs to a PDA
Main limitation of an FAno unbounded memory (cannot count)only finitely many states
States needed to simulate 3 words × 8 bitsevery bit pattern is a state
Moore machineFA with output attached to statesλ: Q → Δ
Mealy machine output depends onpresent state and inputλ: Q × Σ → Δ
Compiler phase that uses finite automatalexical analysistokens are regular
Min DFA (with dead state): 3rd symbol from the left is 15 statesq0, q1, q2, accept, dead
Min DFA: no two consecutive a's over {a,b}3 stateslast not a, last a, dead
Reverse of a DFAreverse arrows, swap start and finalthe result is in general an NFA
ε-closure of a state always containsthe state itselfzero ε-moves is allowed
Subset construction: DFA final statessubsets containing an NFA final stateacceptance needs one accepting path

Opens chatgpt.com in a new tab with a ready-made prompt for this topic.

Unit 1 checklist

Before you move on, can you do each of these without looking?

0 of 7 topics complete

Not sure about one? Go back to it in the topic list and press Next step through the worked question once more. Ticks are saved in this browser. Final checklist for the subject →

Unit complete. Up next: Unit 2, Regular Expressions & Context-Free Grammars.

All units