SlideShare une entreprise Scribd logo
1  sur  53
CSE322
Finite Automata
Lecture #1
Terminologies
• Symbols:
– Symbols are an entity or individual objects, which can be any letter,
alphabet or any picture.
– Example: 1, a, b, #
• Alphabets:
– Alphabets are a finite set of symbols. It is denoted by ∑.
– Examples: ∑ = {a, b} , ∑ = {A, B, C, D} , ∑ = {0, 1, 2}, ∑ = {#, β, Δ}
• String:
• It is a finite collection of symbols from the alphabet. The string is
denoted by w.
• Example 1:
• If ∑ = {a, b}, various string that can be generated from ∑ are {ab,
aa, aaa, bb, bbb, ba, aba.....}.
• A string with zero occurrences of symbols is known as an empty
string. It is represented by ε.
• The number of symbols in a string w is called the length of a
string. It is denoted by |w|.
Definition
An automaton is defined as a system where energy, materials and
information are transformed, transmitted and used for
performing some functions without direct participation of man.
Definition
• An automaton is an abstract model of a digital computer.
• Every automaton includes some essential features.
• It has a mechanism for reading input.
– This input mechanism can read the input from left to right
– One symbol at a time
– Can also detect the end of the input string
• An automaton can produce output of some sort.
• It may have a temporary storage device.
• An automaton has a control unit which can be in any one of
finite number of internal states and which can change state in
some defined manner.
Finite Automaton
Input
“Accept”
or
“Reject”
String
Finite
Automaton
Output
Formal Definition
• Finite Automaton (FA)
 
F
q
Q
M ,
,
,
, 0



• Finite Automaton (FA)
 
F
q
Q
M ,
,
,
, 0



Q


0
q
F
: set of states
: input alphabet
: transition function
: initial state
: set of accepting states
DESCRIPTION: DETERMINISTIC FINITE AUTOMATON
Topics
 Acceptability of a String by a Finite Automaton
 Transition Graph and Properties of Transition Functions
Transition System Definition
• The transition function which maps
Q x ∑* into Q
(i.e. maps a state and a string of input symbols
including the empty string into a state) is called the
indirect transition function.
Transition Graph
initial
state
accepting
state
state
transition
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
 
b
a,


b
a,
Input alphabet
Initial Configuration
1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
Input String
a b b a
b
a,
0
q
Reading the Input
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
a b b a
b
a,
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
a b b a
b
a,
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
a b b a
b
a,
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
a b b a
b
a,
0
q 1
q 2
q 3
q 4
q
a b b a
accept
5
q
a a b
b
b
a,
a b b a
b
a,
Input finished
Rejection (other than abba)
1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
a b a
b
a,
0
q
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
a b a
b
a,
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
a b a
b
a,
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
a b a
b
a,
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
reject
a b a
b
a,
Input finished
Another Rejection on empty string
1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
0
q

1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
0
q
reject

Another Example for accepting
a
b b
a,
b
a,
0
q 1
q 2
q
a b
a
a
b b
a,
b
a,
0
q 1
q 2
q
a b
a
a
b b
a,
b
a,
0
q 1
q 2
q
a b
a
a
b b
a,
b
a,
0
q 1
q 2
q
a b
a
a
b b
a,
b
a,
0
q 1
q 2
q
a b
a
accept
Input finished
Rejection Example
a
b b
a,
b
a,
0
q 1
q 2
q
a
b b
a
b b
a,
b
a,
0
q 1
q 2
q
a
b b
a
b b
a,
b
a,
0
q 1
q 2
q
a
b b
a
b b
a,
b
a,
0
q 1
q 2
q
a
b b
a
b b
a,
b
a,
0
q 1
q 2
q
a
b b
reject
Input finished
Languages Accepted by FAs
FA
Definition:
The language contains
all input strings accepted by
= { strings that bring
to an accepting state}
M
 
M
L
M
M
 
M
L
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
   
abba
M
L  M
accept
Example ( being null string)
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
   
abba
ab
M
L ,
,

 M
accept
accept
accept
Example
a
b b
a,
b
a,
0
q 1
q 2
q
  }
0
:
{ 
 n
b
a
M
L n
accept trap state
Transition Function 
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
Q
Q 


:

b
a,
  1
0, q
a
q 

2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
0
q 1
q
  5
0, q
b
q 

1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
0
q
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
  3
2, q
b
q 

Transition Function
0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
 a b
0
q
1
q
2
q
3
q
4
q
5
q
1
q 5
q
5
q 2
q
5
q 3
q
4
q 5
q
b
a,
5
q
5
q
5
q
5
q
Extended Transition Function *

Q
Q 

 *
:
*

0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
  2
0,
* q
ab
q 

3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
0
q 1
q 2
q
  4
0,
* q
abba
q 

0
q 1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
  5
0,
* q
abbbaa
q 

1
q 2
q 3
q 4
q
a b b a
5
q
a a b
b
b
a,
b
a,
0
q
Deterministic Final Automata
• DFA refers to deterministic finite automata.
– Deterministic refers to the uniqueness of the computation. The finite
automata are called deterministic finite automata if the machine reads
an input string one symbol at a time.
• In DFA, given the current state we know what the next step
will be.
• In DFA, there is only one path for specific input from the
current state to the next state.
• DFA does not accept the null move, i.e., the DFA cannot
change state without any input character.
• DFA accepts zero length string i.e. {}
• DFA can contain multiple final states. It is used in Lexical
Analysis in Compiler.
QUESTIONS
1. Draw a DFA which accept 00 and 11 at the end
of a string containing 0, 1 in it, e.g., 01010100
but not 000111010.
2. Construct a DFA which accepts set of all
strings over Σ={a,b} of length ≤2
3. Create a DFA which accepts strings of even
length.
4. Design a DFA in which start and end symbol
must be different
Given: Input alphabet, Σ={a, b}
QUESTIONS
5. Design a DFA in which every 'a' should be
followed by 'b'
Given: Input alphabet, Σ={a, b}
6. Design a DFA such that:
L = {anbm | n,m ≥ 1} Given: Input alphabet, Σ={a,
b}
Language L = {ab, aab, aaab, abbb, aabb,
aaaabbbb, ...}

Contenu connexe

Similaire à Lecture12_16717_Lecture1.ppt

Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Srimatre K
 
Phttp://www.cw360ms.com/pmsurveyresults/index.aspda
Phttp://www.cw360ms.com/pmsurveyresults/index.aspdaPhttp://www.cw360ms.com/pmsurveyresults/index.aspda
Phttp://www.cw360ms.com/pmsurveyresults/index.aspda
Hafeez Rehman
 

Similaire à Lecture12_16717_Lecture1.ppt (20)

Pda
PdaPda
Pda
 
introduction-190804060837.pptx
introduction-190804060837.pptxintroduction-190804060837.pptx
introduction-190804060837.pptx
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
Lecture03 (1).ppt
Lecture03 (1).pptLecture03 (1).ppt
Lecture03 (1).ppt
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
PDA (pushdown automaton)
PDA (pushdown automaton)PDA (pushdown automaton)
PDA (pushdown automaton)
 
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
 
Toc 1 | gate | Theory of computation
Toc 1 | gate | Theory of computationToc 1 | gate | Theory of computation
Toc 1 | gate | Theory of computation
 
Automata
AutomataAutomata
Automata
 
Phttp://www.cw360ms.com/pmsurveyresults/index.aspda
Phttp://www.cw360ms.com/pmsurveyresults/index.aspdaPhttp://www.cw360ms.com/pmsurveyresults/index.aspda
Phttp://www.cw360ms.com/pmsurveyresults/index.aspda
 
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramNFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
 
Introduction to fa and dfa
Introduction to fa  and dfaIntroduction to fa  and dfa
Introduction to fa and dfa
 
Finite automata
Finite automataFinite automata
Finite automata
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
DFA Minimization
DFA MinimizationDFA Minimization
DFA Minimization
 
PUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINEPUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINE
 
Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata
 

Plus de Venneladonthireddy1 (10)

02 Hadoop.pptx HADOOP VENNELA DONTHIREDDY
02 Hadoop.pptx HADOOP VENNELA DONTHIREDDY02 Hadoop.pptx HADOOP VENNELA DONTHIREDDY
02 Hadoop.pptx HADOOP VENNELA DONTHIREDDY
 
CG Lecture 1.pptx GRAPHIS VENNELA DONTHIREDDY
CG Lecture 1.pptx GRAPHIS VENNELA DONTHIREDDYCG Lecture 1.pptx GRAPHIS VENNELA DONTHIREDDY
CG Lecture 1.pptx GRAPHIS VENNELA DONTHIREDDY
 
CG Lecture0.pptx
CG Lecture0.pptxCG Lecture0.pptx
CG Lecture0.pptx
 
Supervised Learning-classification Part-3.ppt
Supervised Learning-classification Part-3.pptSupervised Learning-classification Part-3.ppt
Supervised Learning-classification Part-3.ppt
 
unit3.ppt
unit3.pptunit3.ppt
unit3.ppt
 
EOD Continued.pdf
EOD Continued.pdfEOD Continued.pdf
EOD Continued.pdf
 
lecture 1234.ppt
lecture 1234.pptlecture 1234.ppt
lecture 1234.ppt
 
VLAN _SLAN and VSAN.pptx
VLAN _SLAN and VSAN.pptxVLAN _SLAN and VSAN.pptx
VLAN _SLAN and VSAN.pptx
 
Tableau Prep.pptx
Tableau Prep.pptxTableau Prep.pptx
Tableau Prep.pptx
 
fashion.pptx
fashion.pptxfashion.pptx
fashion.pptx
 

Dernier

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 

Lecture12_16717_Lecture1.ppt

  • 2. Terminologies • Symbols: – Symbols are an entity or individual objects, which can be any letter, alphabet or any picture. – Example: 1, a, b, # • Alphabets: – Alphabets are a finite set of symbols. It is denoted by ∑. – Examples: ∑ = {a, b} , ∑ = {A, B, C, D} , ∑ = {0, 1, 2}, ∑ = {#, β, Δ} • String: • It is a finite collection of symbols from the alphabet. The string is denoted by w. • Example 1: • If ∑ = {a, b}, various string that can be generated from ∑ are {ab, aa, aaa, bb, bbb, ba, aba.....}. • A string with zero occurrences of symbols is known as an empty string. It is represented by ε. • The number of symbols in a string w is called the length of a string. It is denoted by |w|.
  • 3. Definition An automaton is defined as a system where energy, materials and information are transformed, transmitted and used for performing some functions without direct participation of man.
  • 4. Definition • An automaton is an abstract model of a digital computer. • Every automaton includes some essential features. • It has a mechanism for reading input. – This input mechanism can read the input from left to right – One symbol at a time – Can also detect the end of the input string • An automaton can produce output of some sort. • It may have a temporary storage device. • An automaton has a control unit which can be in any one of finite number of internal states and which can change state in some defined manner.
  • 6. Formal Definition • Finite Automaton (FA)   F q Q M , , , , 0    • Finite Automaton (FA)   F q Q M , , , , 0    Q   0 q F : set of states : input alphabet : transition function : initial state : set of accepting states
  • 8.
  • 9.
  • 10. Topics  Acceptability of a String by a Finite Automaton  Transition Graph and Properties of Transition Functions
  • 12. • The transition function which maps Q x ∑* into Q (i.e. maps a state and a string of input symbols including the empty string into a state) is called the indirect transition function.
  • 14. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a,   b a,   b a, Input alphabet
  • 15. Initial Configuration 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, Input String a b b a b a, 0 q
  • 16. Reading the Input 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, a b b a b a,
  • 17. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, a b b a b a,
  • 18. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, a b b a b a,
  • 19. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, a b b a b a,
  • 20. 0 q 1 q 2 q 3 q 4 q a b b a accept 5 q a a b b b a, a b b a b a, Input finished
  • 21. Rejection (other than abba) 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, a b a b a, 0 q
  • 22. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, a b a b a,
  • 23. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, a b a b a,
  • 24. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, a b a b a,
  • 25. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, reject a b a b a, Input finished
  • 26. Another Rejection on empty string 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a, 0 q 
  • 27. 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a, 0 q reject 
  • 28. Another Example for accepting a b b a, b a, 0 q 1 q 2 q a b a
  • 32. a b b a, b a, 0 q 1 q 2 q a b a accept Input finished
  • 37. a b b a, b a, 0 q 1 q 2 q a b b reject Input finished
  • 38. Languages Accepted by FAs FA Definition: The language contains all input strings accepted by = { strings that bring to an accepting state} M   M L M M   M L
  • 39. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a,     abba M L  M accept
  • 40. Example ( being null string) 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a,     abba ab M L , ,   M accept accept accept
  • 41. Example a b b a, b a, 0 q 1 q 2 q   } 0 : {   n b a M L n accept trap state
  • 42. Transition Function  0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, Q Q    :  b a,
  • 43.   1 0, q a q   2 q 3 q 4 q a b b a 5 q a a b b b a, b a, 0 q 1 q
  • 44.   5 0, q b q   1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a, 0 q
  • 45. 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a,   3 2, q b q  
  • 46. Transition Function 0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a,  a b 0 q 1 q 2 q 3 q 4 q 5 q 1 q 5 q 5 q 2 q 5 q 3 q 4 q 5 q b a, 5 q 5 q 5 q 5 q
  • 47. Extended Transition Function *  Q Q    * : *  0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a,
  • 48.   2 0, * q ab q   3 q 4 q a b b a 5 q a a b b b a, b a, 0 q 1 q 2 q
  • 49.   4 0, * q abba q   0 q 1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a,
  • 50.   5 0, * q abbbaa q   1 q 2 q 3 q 4 q a b b a 5 q a a b b b a, b a, 0 q
  • 51. Deterministic Final Automata • DFA refers to deterministic finite automata. – Deterministic refers to the uniqueness of the computation. The finite automata are called deterministic finite automata if the machine reads an input string one symbol at a time. • In DFA, given the current state we know what the next step will be. • In DFA, there is only one path for specific input from the current state to the next state. • DFA does not accept the null move, i.e., the DFA cannot change state without any input character. • DFA accepts zero length string i.e. {} • DFA can contain multiple final states. It is used in Lexical Analysis in Compiler.
  • 52. QUESTIONS 1. Draw a DFA which accept 00 and 11 at the end of a string containing 0, 1 in it, e.g., 01010100 but not 000111010. 2. Construct a DFA which accepts set of all strings over Σ={a,b} of length ≤2 3. Create a DFA which accepts strings of even length. 4. Design a DFA in which start and end symbol must be different Given: Input alphabet, Σ={a, b}
  • 53. QUESTIONS 5. Design a DFA in which every 'a' should be followed by 'b' Given: Input alphabet, Σ={a, b} 6. Design a DFA such that: L = {anbm | n,m ≥ 1} Given: Input alphabet, Σ={a, b} Language L = {ab, aab, aaab, abbb, aabb, aaaabbbb, ...}

Notes de l'éditeur

  1. Input alphabet