Last session was about finite state automata (FSA).
As a special form of FSA, we introduced
deterministic state
automata (DSA).
Can we model complex pattern using DFA?
Goddard (2024)
This matches all strings that end with ‘00’.
Goddard (2024)
Each of its transitions is uniquely determined by its source state and input symbol, and reading an input symbol is required for each state transition.
Goddard (2024)
This matches all strings that end with ‘101’.
Goddard (2024)
This is also a nondeterministic finite-state machine (NFA).
What is the difference to the DFA?
Each NFA can be translated to an DFA.
A DFA can be seen as a special kind of NFA.
The main difference between DFA and NFA is in transition function \(\delta\):
\(\delta : Q \times \Sigma \rightarrow P(Q)\)
\(\delta\) now allows a set of possible states to transition to.
In other words, NFA can have zero, one, or multiple transitions corresponding to a particular symbol.
A NFA \(M\) is a 5-tuple, \(( Q, \Sigma, \delta , q_0 , F)\), consisting of
The conditions for when a NFA matches remain the same:
Goddard
(2024)
\(a^\ast +(ab)^\ast\)
Where the NFA has more than one possible transitions, it branches
Nondeterminism can be thought of a tree growing downwards:
Goddard
(2024)
If at least one branch leads to an accept state, the input is accepted.
Goddard
(2024)
FSA enable automation.
Acknowledgement:
This script is inspired by Goddard (2024).