Deterministic Finite Automata And Regular Languages
Deterministic Finite Automaton (DFA) Input Tape String Output “Accept” or “Reject” Finite Automaton
Transition Graph initial state accepting state transition state
Alphabet For every state, there is a transition for every symbol in the alphabet
Initial Configuration head Input Tape Input String Initial state
Scanning the Input
Input finished accept
A Rejection Case Input String
Input finished reject
Another Rejection Case Tape is empty Input Finished reject
Language Accepted:
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
Another Example Accept state Accept state Accept state
Empty Tape Input Finished accept
Another Example trap state Accept state
Input String
Input finished accept
A rejection case Input String
Input finished reject
Language Accepted:
Another Example Alphabet: Language Accepted:
Formal Definition Deterministic Finite Automaton (DFA) : set of states : input alphabet : transition function : initial state : set of accepting states
Set of States Example
Input Alphabet :the input alphabet never contains Example
Initial State Example
Set of Accepting States Example
Transition Function Describes the result of a transition from state with symbol
Example:
Transition Table for symbols states
Extended Transition Function Describes the resulting state after scanning string from state
Example:
Special case: for any state
implies that there is a walk of transitions In general: implies that there is a walk of transitions states may be repeated
Language Accepted by DFA Language of DFA : it is denoted as and contains all the strings accepted by We say that a language is accepted (or recognized) by DFA if
For a DFA Language accepted by :
Language rejected by :
More DFA Examples Empty language All strings
Language of the empty string
= { all strings with prefix } accept
= { all binary strings containing substring }
= { all binary strings without substring }
Regular Languages Definition: A language is regular if there is a DFA that accepts it ( ) The languages accepted by all DFAs form the family of regular languages
Example regular languages: { all strings in {a,b}* with prefix } { all binary strings without substring } There exist automata that accept these languages (see previous slides).
There exist languages which are not Regular: There is no DFA that accepts these languages (we will prove this in a later class)
This Summary is an Online Content from this Book: Michael Sipser, Introduction to the Theory of Computation, 2ndEdition It is edited for Computation Theory Course 6803415-3 by: T.Mariah Sami Khayat Teacher Assistant @ Adam University College For Contacting: mskhayat@uqu.edu.sa Kingdom of Saudi Arabia Ministry of Education Umm AlQura University Adam University College Computer Science Department المملكة العربية السعودية وزارة التعليم جامعة أم القرى الكلية الجامعية أضم قسم الحاسب الآلي