2. Introduction to Finite Automata
2
Finite Automata
▶ Has some number of states
▶ Has a start state and at least one end state
▶ Accepts input that advances it through its states
▶ Can be Deterministic (DFA) or Non Deterministic(NFA)
3. Deterministic Finite Automata
3
▶ A DFA can be written as a quintuple M = (Q, E, d, q0, F)
Q- A finite set of states
E- A finite set known as the alphabet
q0- The start state (an element of Q)
F- The final or accepting states(a subset of Q)
4. d- It is a total function from Q x E to Q called the transition function
4
Total Function – There exists a function f such that for each
element of E, e, as input to f, there is an element of Q, q,
such that [q, e] is an element of f.
From any state there is a path for each possible input .
5. Representing Finite Automata
▶ Finite Automata can be represented visually by state
diagrams
▶ M
▶ Q = s0, s1
▶ E = {0, 1}
▶ F = s2
d(q0, 0) = q1
d(q0, 1) = q0
d(q1, 0) = q0
d(q1, 1) = q1
5
6. Non-Deterministic Finite Automata
6
▶ An NFA can have several possible paths from a single node .
▶ An NF
A processes all possible paths to attempt to find an accepting state.
▶ A string is accepted by an NFA if there is at least one possible path that
-Processes the entire string, and
-Ends in an accepting state
8. Non-Deterministic Finite Automata
8
▶ Two NFA can be joined by using the lambda arc.
▶ Processing follows a lambda arc no matter what it’s input is (even null input )