600 likes | 965 Views
Deterministic Finite Automaton (DFA). Input Tape. String. Output. “Accept” or “Reject”. Finite Automaton. Formal Definition. Deterministic Finite Automaton (DFA). : set of states. : input alphabet. : transition function. : initial state. : set of accepting states.
E N D
Deterministic Finite Automaton (DFA) Input Tape String Output “Accept” or “Reject” Finite Automaton Costas Busch - RPI
Formal Definition • Deterministic Finite Automaton (DFA) : set of states : input alphabet : transition function : initial state : set of accepting states Costas Busch - RPI
Language Accepted: Costas Busch - RPI
Transition Graph initial state accepting state transition state Costas Busch - RPI
For every state, there is a transition for every symbol in the alphabet Costas Busch - RPI
Set of States Example Costas Busch - RPI
Input Alphabet :the input alphabet never contains Example Costas Busch - RPI
Initial State Example Costas Busch - RPI
Set of Accepting States Example Costas Busch - RPI
Transition Function Describes the result of a transition from state with symbol Costas Busch - RPI
Example: Costas Busch - RPI
Transition Table for symbols states Costas Busch - RPI
To accept a string: all the input string is scanned and the last state is accepting To reject a string: all the input string is scanned and the last state is non-accepting Costas Busch - RPI
Initial Configuration head Input Tape Input String Initial state Costas Busch - RPI
Scanning the Input Costas Busch - RPI
Input finished accept Costas Busch - RPI
A Rejection Case Input String Costas Busch - RPI
Input finished reject Costas Busch - RPI
Another Rejection Case Tape is empty Input Finished reject Costas Busch - RPI
Extended Transition Function Describes the resulting state after scanning string from state Costas Busch - RPI
Example: Costas Busch - RPI
Another Example Accept state Accept state Accept state Costas Busch - RPI
Empty Tape Input Finished accept Costas Busch - RPI
Another Example trap state Accept state Costas Busch - RPI
Input String Costas Busch - RPI
Input finished accept Costas Busch - RPI
A rejection case Input String Costas Busch - RPI
Input finished reject Costas Busch - RPI
Language Accepted: Costas Busch - RPI
Another Example Alphabet: Language Accepted: Costas Busch - RPI
More DFA Examples Empty language All strings Costas Busch - RPI
Language of the empty string Costas Busch - RPI
= { all strings with prefix } Costas Busch - RPI
={ all binary strings containing substring } Costas Busch - RPI
={ all binary strings without substring } Costas Busch - RPI