Download presentation
Presentation is loading. Please wait.
1
An Introduction to Finite Automata
By Andrew Milne Mentor: Professor Cindy Fry February 1, 2008
2
A Finite Automaton… 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
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 / accepting states (a subset of Q)
4
d d is a total function from Q x E to Q called the transition function. 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 = q0, q1 E = {0, 1} F = q2 d(q0, 0) = q1 d(q0, 1) = q0 d(q1, 0) = q0 d(q1, 1) = q1
6
DFA State Diagram Consider as input ‘1001’ The input is not accepted
[q0, ‘1001’] |- [q0, ‘001’] [q0, ‘001’] |- [q1, ‘01’] [q1, ‘01’] |- [q1, ‘1’] [q1, ‘1’] |- [q0, ‘’] The input is not accepted
7
Nondeterministic Finite Automata
An NFA can have several possible paths from a single node. An NFA 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
The d of the NFA d(q0, ew) = { q0, q1, … qn }
The transitions of an NFA are very similar to those of a DFA, except that each [state, input] pair has a set of result states, not just one.
9
An NFA State Diagram This NFA determines whether an input string from the language {a, b} contains the string ‘abba.’
10
Nondeterministic Finite Automata
Two NFA can be joined by using the lambda-arc. Processing follows a lambda-arc no matter what its input is (even null input)
11
An NFA With a Lambda-Arc
12
Reference: Sudkamp, Thomas A Languages and Machines, 3rd Edition
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.