Assignment 2
Natural Language Processing
Due 2025
, COS4861/2025 Assignment 2: Natural
Language Processing (NLP)
Question 1: Theory of Automata (40 Marks)
1.1 Deterministic Finite State Automaton (DFSA)
A Deterministic Finite State Automaton (DFSA) is defined as a 5-tuple:
M = (Q, Σ, δ, q0 , F )
where:
– Q: A finite set of states
– Σ: A finite input alphabet
– δ: A transition function δ : Q × Σ → Q
– q0 ∈ Q: The start state
– F ⊆ Q: A set of accepting states
Each input symbol causes the automaton to make a unique transition to the next state.
Example: A DFSA that accepts binary strings ending in 01:
Q = {q0 , q1 , q2 }, Σ = {0, 1}, q0 = start state, F = {q2 }
δ(q0 , 0) = q1 , δ(q1 , 1) = q2
0 1
start q0 q1 q2
1