Introduction to Finite Automata Our First Machine Model Captain Pedro Ortiz Department of Computer Science United States Naval Academy SI-340 Theory of Computing Fall 2012 Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 1 / 11
References Unless otherwise noted, all the information in this presentation was taken from the course notes or the course suggested text http://www.usna.edu/users/cs/portiz/si340 created and maintained by Associate Professor Chris Brown, USNA Kinber, Efim and Smith, Carl, Theory of Computing: A Gentle Introduction. Prentice Hall, Upper Saddle River, NJ, 2001. Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 2 / 11
Outline 1 Finite Automata 2 Diagram Definition 3 Finite Automata Rules 4 JFLAP Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 3 / 11
Assumptions Memory is : Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 4 / 11
Assumptions Memory is : 1 Fixed Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 4 / 11
Assumptions Memory is : 1 Fixed 2 Finite Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 4 / 11
Assumptions Memory is : 1 Fixed 2 Finite 3 Relatively small Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 4 / 11
What is a Finite Automaton? Definition Simple type of computer Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 5 / 11
What is a Finite Automaton? Definition Simple type of computer Input string w over alphabet Σ Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 5 / 11
What is a Finite Automaton? Definition Simple type of computer Input string w over alphabet Σ Memory the current state of the machine Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 5 / 11
What is a Finite Automaton? Definition Simple type of computer Input string w over alphabet Σ Memory the current state of the machine Consists of a finite set of states Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 5 / 11
What is a Finite Automaton? Definition Simple type of computer Input string w over alphabet Σ Memory the current state of the machine Consists of a finite set of states Transitions from state to state as it reads the characters of w Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 5 / 11
States Some definitions to remember: Definition start state or initial state - one state will be designated as the start ( initial ) state. This is the state the machine starts in i.e. before it reads any symbols. Definition accepting state - Some states will be designated as accepting. If a machine M exhausts all its input and is in an accepting state, M accepts that string. The set of strings accepted by M is referred to as the language accepted by M. Notation L(M) = the language accepted by M Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 6 / 11
Diagram Definition Definition Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 7 / 11
Diagram Definition Definition 1 We represent a finite automaton with a directed graph Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 7 / 11
Diagram Definition Definition 1 We represent a finite automaton with a directed graph 2 Vertices represent machine states Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 7 / 11
Diagram Definition Definition 1 We represent a finite automaton with a directed graph 2 Vertices represent machine states 3 Edges represent transitions from state to state Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 7 / 11
Diagram Definition Definition 1 We represent a finite automaton with a directed graph 2 Vertices represent machine states 3 Edges represent transitions from state to state Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 7 / 11
Diagram Definition Definition 1 We represent a finite automaton with a directed graph 2 Vertices represent machine states 3 Edges represent transitions from state to state Edges from one state to another are labeled with characters from Σ Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 7 / 11
Diagram Definition Definition 1 We represent a finite automaton with a directed graph 2 Vertices represent machine states 3 Edges represent transitions from state to state Edges from one state to another are labeled with characters from Σ When the machine is in a one state and it reads a character it goes into state pointed to by the edge with the character Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 7 / 11
Diagram Example 1 Example Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 8 / 11
Diagram Example 1 Example L(M) = {ab, ba} Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 8 / 11
Diagram Example 2 Example Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 9 / 11
Diagram Example 2 Example L(M) = {ɛ, abc, abcabc, abcabcabc,...} Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 9 / 11
Finite Automata Rules Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 10 / 11
Finite Automata Rules 1 Σ must be defines Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 10 / 11
Finite Automata Rules 1 Σ must be defines 2 Each state must have an outbound transition for each character in Σ Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 10 / 11
Finite Automata Rules 1 Σ must be defines 2 Each state must have an outbound transition for each character in Σ 3 States can only have one outbound transition for each character in Σ Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 10 / 11
Finite Automata Rules 1 Σ must be defines 2 Each state must have an outbound transition for each character in Σ 3 States can only have one outbound transition for each character in Σ 4 A machine can have zero or more accepting state, but only one start state Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 10 / 11
JFLAP A tool for exploring machine models Installed in the CS department labs Freely available at www.jflap.org Captain Pedro Ortiz (US Naval Academy) Introduction to Finite Automata SI-340 Fall 2012 11 / 11