SlideShare a Scribd company logo
The theory of Automata
Lecture no 1
Syed Asif Ali
 E–mail: aasyed@smiu.edu.pk
asifkhi@hotmail.com
 Course Title: Theory of Computer Science [AUTOMATA]
 Prerequisites: Discrete Mathematic
 Degree(s): BCS
 Duration: 18 weeks in Fifth semester
 Lectures: 48 in total, 3 per week, including some examples.
 Laboratories: none
Course Description:
 Finite Automata.
 Deterministic Finite automata (DFA).
 Non-Deterministic Finite Automata (NFA).
 Regular Expression & Language.
 Properties of Regular Languages.
 Context–Free Grammar & Language.
 Properties of Context–Free Languages.
 Push–Down Automata.
 Turing Machines.
Reference Books:
K.L.P. Mishra, N.
Chandrasekaran,
Theory of Computer Science
(Automata, Languages &
Computation), Second Edition,
Prentice Hall of India, 1999
Textbooks:
Daniel I.A. Cohen
Introduction to Computer Theory
Reference Books:
John.E. Hopcroft, R. Motwani, and J.D.
Ullman, Introduction to Automata
Theory, Language and Computation,
Second Edition, Pearson Education
Asia, 2001.
Reference Books:
J.C. Martin, Introduction to
Languages and Theory of
Computation, Second Edition,
McGraw Hill 1991.
Marks Distribution
Class Attendance 05
Class–
Tests/Presentation
15
Quizzes 20
Mid–Term Examination 20
Final Examination 40
Total 100
AUTOMATA
 Automata is Greek letters .Automata is a word
formulated from automation, which means machine
designing or replacing human beings with machines.
 Every machine design requires some hardware part
and some software part.
 A machine could be a finite state machine ,a Turing
Machine, a pushdown automata, or any other
restricted version of a Turing machine.
 Input File
 Sequence of symbols
 Internal State
 of Control Unit
 Next-State Transition Function
 May have Temporary Storage
Input File
Storage
Control Unit
Output
Automata
Automata
Theory
Sets
Theory
Graph
Theory
Sets
 Sets are collections in which order of elements and duplication of
elements do not matter.
 {1,a,1,1} = {a,a,a,1} = {a,1}
Size
 Size of set mean number of elements in set e.g. |{a,b,c}| = 3
Special Sets
 Empty Set 
 Universal Set U
Set Relations
 Subset {a,c}  {a,b,c}
 Proper Subset {a,c}  {a,b,c}
 is-element-of b  {a,b,c}
Set Operations
Union X  Y
Intersection X  Y
Difference X – Y
Complement X (always with respect to Universe)
Disjoint S1  S2 = 
• Powerset 2x
• Is it possible for |S| = |2S|?
A x B = {(a,b): for all a  A and b  B}
DeMorgan’s Laws
 S1  S2 = S1  S2
 S1  S2 = S1  S2
Functions : S1  S2
S1 = Domain
S2 = Range
S1 may be same as S2
Equivalence Relations
Reflexive
Symmetric
Transitive
a, b  S, we write a  b if a is equivalent to b
What is a graph?
 It's an abstract notion, used to represent the idea of some
kind of connection between pairs of objects.
A graph consists of:
 A collection of "vertices", draw as small circles.
 A collection of "edges", each connecting some two vertices.
Mathematical Definition
G = (V, E)
 V = {v1,v2,…,vn} = Vertices
 E = {e1, e2, …, em} = Edges
Graph Terminology
 Walk = Sequence of edges
 Path = Walk with no repeated edges
 Simple Path = No vertices repeated
 Cycle = Path from vi back to vi
 Simple Cycle = Cycle with no vertices repeated
Character or Alphabet: An alphabet S is a set of symbols (characters, letters).
or
A finite set of symbols/ An abstract set of distinct symbols over which a
language is defined
String :A string (or word) over S is a sequence of symbols. The empty string is
the string containing no symbols at all, and is denoted by ε.
Length/Size of String: The length of a string is the number of symbols that it
contains (repetitions allowed). Absolute values are used to denote length.
The length of a string w is denoted |w|.
For example |00100| = 5
|aab| = 3
| epsilon | = 0
Concatenation : The concatenation of two strings is the string
resulting from putting them together from left to right.
 If u=one and v=two then u · v=onetwo and
 v · u=twoone.
Dot is usually omitted; just write uv for u · v.
 Laws:
u · (v · w) = (u · v) · w
u · ε = u
ε · u = u
|u · v| = |u| + |v|
Regular Expression/Relational Expression
• Let Σ be an alphabet. The regular expressions(regex) are
defined inductively as follows:
– ø is a regular expression denoting {},
– ε is a regular expression denoting {},
– for each a Є Σ¸ a is a regular expression denoting
{a},
– Assume r and s are regular expressions denoting
sets R and S, then
. rs denotes RS,
. r + s denoted R υ S,
. r* denotes R*
Positive Kleene a+
a*= {a ,aa ,aaa ,aaaa ,aaaaa ,………..}
Kleene Star a*
a*= {ε,a ,aa ,aaa ,aaaa ,aaaaa ……………..}
Proof of Kleene Star
Let L0 and Li =L.L i-1 where i>=1 then Kleene closure of
L
is L*.L* is the set such that L* =Ui=0 Li i=0
L0={ε}
Solution
Suppose L={01,10}
L* = L0 U L1 U L2 U ………Ln
Its given that L0={ε}
Take i=1
L1 =L L 1-1
L1 =L L0
L1={01,10}.{ε}
L1={01 ε,10 ε}
L1={01,10}
Now Take i=2
L2 =L.L 2-1
L2 =L.L1
L2={01,10}. {01,10}
L2={0101,0110,1001,1010}
Now L*=L0 U L1 U L2 ….U Ln
L*={ε} U {01,10} U {0101,0110,1001,1010}…….
In a Kleene Star form it may be written as L*={01,10}*
Regular Language/Rational Language, Recognizable
Language.
A regular, rational, or recognizable language is one
that fulfils
one of the following equivalent criteria:
 L is defined by a regular expression.
 There are a finite number of L-cones.
 L is recognized by a finite state automaton or FSA.
Language Expression Meaning Transition
Graph/Automata
L={0,1} r.e=(0+1)
r.e=(0/1)
r.e=(0 1)
choosing
from r1 or r2
L={0,1} r.e=(0.1)
r.e=(01)
r.e=(o∩1)
concatenati
on of r1 and
r2
L={0} r*=(0) zero or
more times
(Kleene
closure)
L={0} r+ =(0) one or more
times
0
1
0 1
0
0
0 0
Types of Automata
Automata
Finite Automata Push Down Automata Turing Machine
(FA) (PDA) (TM)
Deterministic Non-Deterministic
Finite Automata (DFA) Finite Automata (NFA)
FINITE AUTOMATA (FA)
NON-DETERMINISTIC FINITE
AUTOMATA
(NFA)
DETERMINISTIC FINITE
AUTOMATA
(DFA)
FINITE AUTOMATA
(FA)
What is the difference between the
two?
Is there a single DFA for a
corresponding NFA?
Why do we want to do this anyway?
Deterministic Finite Automata
 For every state and every alphabet symbol there is exactly one
move that the machine can make
Mathematical Definition
 A Deterministic Finite Automata is a 5-tuple (Q, Σ, δ, qo, F)
where
Q→Total numbers of State(s)
Σ→Input(s)/Alphabets(s)
δ→Transition Function QXΣ
q0→Initial State(s)
F→Final State(s)
Finite Automata State Graphs
 An Input
 A state
 The start state
 An accepting state
 A transition a
a,b,…0,1,2…
Example r.e =a.b
Q→Total numbers of State(s) = {q0,q1,q2}
Σ→Input(s)/Alphabets(s)={a,b}
q0→Initial State(s)={q0}
F→Final State(s)={q2}
δ→Transition Function QXΣ
QXΣ Input a Input b
q0 q1 є
q1 є q2
q2 є є
q0
q1 q2
a b
q2
Acceptance State
/Final State
Initial
State
Nondeterministic Finite Automata
 At each state, for each symbol, the machine can move into
0 or more states.
Mathematical Definition
 A Non-Deterministic Finite Automata is a 5-tuple (Q,Σ,δ, qo,
F)
where
Q→Total numbers of State(s)
Σ→Input(s)/Alphabets(s)
δ→Transition Function 2 pow Q
q0→Initial State(s)
F→Final State(s)
Nondeterministic Finite Automata
Two non-deterministic elements:
Lambda transitions or epsilon
transitions
2 out arcs with same symbol
Non-Deterministic Finite Automata
Example L={a}
a
a
a
1q 2q
3q
0q No transition:
the automaton hangs
Acceptance state/Final State
Two choices
QX Σ Input a
q0 q1 U q3
q1 q2
q2 є
q3 є
Nondeterministic Finite Automata
 Non-determinism
When machine is in a given state and reads a
symbol, the machine will have a choice of
where to move to next.
There may be states where, after reading a
given symbol, the machine has nowhere to go.
Applying the transition function will give, not 1
state, but 0 or more states.
Non-Deterministic Finite Automata
1q 2q
3q
a
a
a
0q
No transition:
the automaton hangs
“accept”Two choices
Example: L = {a}
Non-Deterministic Finite Automata
Example: L corresponds to the regular expression
{11 + 110}*0
1
q1
q2 q3
q0 q4
1 1
1 0
0
start
Non-Deterministic Finite Automata
 L = set of strings ending in ab
q0 q1 q2start
a b
a,b
REGULAR EXPRESSION
Regular
Expressions
Nondeterministic
Finite Automata
(NFA)
Deterministic
Finite Automata
(DFA)
Implementation
Of DFA
REGULAR EXPRESSION
 Theorem If L is accepted by a DFA, then L is
denoted by a regular expression.
The language of FA (regular language) is the set of
strings that label paths that go from the start state
to some accepting state.
The languages accepted by DFA, NFA,
e-NFA, Regular Expressions are called
regular languages
REGULAR EXPRESSION
 The regular expressions over  are the
smallest set of expressions including
where
where A,B are rexp over
" " "
where A is a rexp over
‘c’
A+B
AB
A*
e
c 


Regular Expression Notation
 a: an ordinary letter
 ε: the empty string
 r1 | r2: choosing from r1 or r2
 r1r2 : concatenation of r1 and r2
 r*: zero or more times (Kleene closure)
 r+: one or more times
NFA to DFA Conversion
What is the difference between the two?
Is there a single DFA for a corresponding
NFA?
Why do we want to do this anyway?
Nondeterministic Finite Automata
 Non-determinism
When machine is in a given state and reads a
symbol, the machine will have a choice of
where to move to next.
There may be states where, after reading a
given symbol, the machine has nowhere to go.
Applying the transition function will give, not 1
state, but 0 or more states.
Nondeterministic Finite Automata
 At each state, for each symbol, the machine can
move into 0 or more states.
 A Non-Deterministic Finite Automata is a
5-tuple (Q, S, d, qo, F) where
Input alphabet, i.e.
Transition function 2 pow Q
Initial state i.e.
Final states i.e.
:Q
:
:
:0q
:F
Set of states, i.e. { q0, q1, q2, q3, q4}
{1,0}
{q0}
{q4}
Nondeterministic Finite Automata
 Two non-deterministic elements:
Lambda transitions or epsilon transitions
2 out arcs with same symbol
 For every state and every alphabet symbol
there is exactly one move that the machine can
make
 A Deterministic Finite Automata is a
5-tuple (Q, S, d, qo, F) where
Deterministic Finite Automata
:Q
:
:
:0q
:F
Input alphabet
Transition function Q x I
Initial state
Final states
Set of states
DFA CYCLE
Regular Expression
NFA (e-move)
NFA (without e-move)
DFA
Regular Expressions to NFA
 For each kind of rexp, define an NFA
Notation: NFA for rexp M
•For e
•For input a
M
e
a
NFA Empty Move
 For A B
A B
e
For A | B
A
B
e
e
e
e
NFA Empty Move
 For A*
A
ee
e
e
 For re=r1*
e
e
e r1 eS A B Fstart
r1 r1
S BAF Astart
r1
NFA (e-move)
DFA
States/
input
r1
S BFBA=BAF
A BAF
B 
F 
BAF BAF
Transaction table:
r1*BAFS
r1
start
r1
NFA ->DFA (EXAMPLE-1)
NFA ->DFA (EXAMPLE-2)
 For re=r1.r2
NFA (e-move)
For r1 For r2
For r1.r2
A B
r1
start C D
r2
start
A B C D
er1 r2
start
NFA ->DFA (EXAMPLE-2 cont….)
State
s/
input
r1 r2
A BC 
B  
C  D
D  
BC  D
DFA
Transaction table:
A BC Dr2r1
start
CA BC D
r2r1 r2
start
r1.r2
NFA ->DFA (EXAMPLE-3)
 For re=r1+r2
For r1 For r2
C D
r2
startA B
r1
start
e e
A B
r1
C D
r2
start S F
ee
For r1+r2
NFA ->DFA (EXAMPLE-3 cont….)
FD
State
s/inpu
t
r1 r2
S BF DF
A BF 
B  
C  DF
D  
F  
BF  
DF  
Transaction table:
DFA
BDFstart
r1/r2
S
r1+r2
r1r1
BF A
DF Cr2
start S
r2
BF
DF
start S
r1
r2
NFA ->DFA (EXAMPLE-1)
q0 q1 q2start
a b
a,b
q0 q0q1 q0q2start
a b
b
a
a
b
States
/
input
a b
q0 q1q0 q0
q1  q2
q2  
q1q0 q1q0 q0q
2
q0q2 q1q2 q0
Transaction table:
NFA
Equivalent DFA
NFA ->DFA (EXAMPLE-2)
B A
C
start
0
0
1
10
B ABCstart
0
0
1
AC
1
A
B ABCstart
0
0
1
AC
1
NFA
Equivalent DFA
States
/
input
0 1
B BAC 
A  AC
C  
ABC ABC AC
AC  AC
Transaction table:

More Related Content

What's hot

Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design
MAHASREEM
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
Pda
PdaPda
Knowledge Engineering in FOL.
Knowledge Engineering in FOL.Knowledge Engineering in FOL.
Knowledge Engineering in FOL.
Megha Sharma
 
Fuzzy Logic
Fuzzy LogicFuzzy Logic
Fuzzy Logic
Rishikese MR
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
Rahul Narang
 
FORESTS
FORESTSFORESTS
Automata theory
Automata theoryAutomata theory
Automata theory
Pardeep Vats
 
Automata
AutomataAutomata
Automata
Gaditek
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
Ratnakar Mikkili
 
1.9. minimization of dfa
1.9. minimization of dfa1.9. minimization of dfa
1.9. minimization of dfa
Sampath Kumar S
 
1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets
Sampath Kumar S
 
K-Nearest Neighbor Classifier
K-Nearest Neighbor ClassifierK-Nearest Neighbor Classifier
K-Nearest Neighbor Classifier
Neha Kulkarni
 
Unsupervised learning
Unsupervised learningUnsupervised learning
Unsupervised learning
amalalhait
 
Time complexity.ppt
Time complexity.pptTime complexity.ppt
Time complexity.ppt
YekoyeTigabuYeko
 
Compiler Design Lecture Notes
Compiler Design Lecture NotesCompiler Design Lecture Notes
Compiler Design Lecture Notes
FellowBuddy.com
 
Dempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th Sem
DigiGurukul
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal forms
Akila Krishnamoorthy
 

What's hot (20)

Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Pda
PdaPda
Pda
 
Knowledge Engineering in FOL.
Knowledge Engineering in FOL.Knowledge Engineering in FOL.
Knowledge Engineering in FOL.
 
Fuzzy Logic
Fuzzy LogicFuzzy Logic
Fuzzy Logic
 
Undecidabality
UndecidabalityUndecidabality
Undecidabality
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
FORESTS
FORESTSFORESTS
FORESTS
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
Automata
AutomataAutomata
Automata
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
1.9. minimization of dfa
1.9. minimization of dfa1.9. minimization of dfa
1.9. minimization of dfa
 
1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets
 
K-Nearest Neighbor Classifier
K-Nearest Neighbor ClassifierK-Nearest Neighbor Classifier
K-Nearest Neighbor Classifier
 
Unsupervised learning
Unsupervised learningUnsupervised learning
Unsupervised learning
 
Time complexity.ppt
Time complexity.pptTime complexity.ppt
Time complexity.ppt
 
Compiler Design Lecture Notes
Compiler Design Lecture NotesCompiler Design Lecture Notes
Compiler Design Lecture Notes
 
Dempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th Sem
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal forms
 

Similar to Automata

QB104541.pdf
QB104541.pdfQB104541.pdf
QB104541.pdf
MrRRajasekarCSE
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
dawod yimer
 
Thoery of Computaion and Chomsky's Classification
Thoery of Computaion and Chomsky's ClassificationThoery of Computaion and Chomsky's Classification
Thoery of Computaion and Chomsky's Classification
PrafullMisra
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5
Dr. Maamoun Ahmed
 
5. NFA & DFA.pdf
5. NFA & DFA.pdf5. NFA & DFA.pdf
5. NFA & DFA.pdf
TANZINTANZINA
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
RaviAr5
 
Module 1 TOC.pptx
Module 1 TOC.pptxModule 1 TOC.pptx
Module 1 TOC.pptx
MohitJain21BCE1523
 
Chapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdfChapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdf
DrIsikoIsaac
 
Flat
FlatFlat
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurEnd semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Vivekananda Samiti
 
compiler Design course material chapter 2
compiler Design course material chapter 2compiler Design course material chapter 2
compiler Design course material chapter 2
gadisaAdamu
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
adugnanegero
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFA
Maulik Togadiya
 
RegularExpressions.pdf
RegularExpressions.pdfRegularExpressions.pdf
RegularExpressions.pdf
ImranBhatti58
 
Automata_Theory_and_compiler_design_UNIT-1.pptx.pdf
Automata_Theory_and_compiler_design_UNIT-1.pptx.pdfAutomata_Theory_and_compiler_design_UNIT-1.pptx.pdf
Automata_Theory_and_compiler_design_UNIT-1.pptx.pdf
TONY562
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
Prof. Dr. K. Adisesha
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
Prof. Dr. K. Adisesha
 
Class1
 Class1 Class1
Class1issbp
 
Context free grammer.ppt
Context free grammer.pptContext free grammer.ppt
Context free grammer.ppt
PawanChoudhary71
 

Similar to Automata (20)

QB104541.pdf
QB104541.pdfQB104541.pdf
QB104541.pdf
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
 
Thoery of Computaion and Chomsky's Classification
Thoery of Computaion and Chomsky's ClassificationThoery of Computaion and Chomsky's Classification
Thoery of Computaion and Chomsky's Classification
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5
 
5. NFA & DFA.pdf
5. NFA & DFA.pdf5. NFA & DFA.pdf
5. NFA & DFA.pdf
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
Module 1 TOC.pptx
Module 1 TOC.pptxModule 1 TOC.pptx
Module 1 TOC.pptx
 
Chapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdfChapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdf
 
FLAT.pdf
FLAT.pdfFLAT.pdf
FLAT.pdf
 
Flat
FlatFlat
Flat
 
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurEnd semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
compiler Design course material chapter 2
compiler Design course material chapter 2compiler Design course material chapter 2
compiler Design course material chapter 2
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFA
 
RegularExpressions.pdf
RegularExpressions.pdfRegularExpressions.pdf
RegularExpressions.pdf
 
Automata_Theory_and_compiler_design_UNIT-1.pptx.pdf
Automata_Theory_and_compiler_design_UNIT-1.pptx.pdfAutomata_Theory_and_compiler_design_UNIT-1.pptx.pdf
Automata_Theory_and_compiler_design_UNIT-1.pptx.pdf
 
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
 
Class1
 Class1 Class1
Class1
 
Context free grammer.ppt
Context free grammer.pptContext free grammer.ppt
Context free grammer.ppt
 

More from Gaditek

Digital marketing strategy and planning | About Business
Digital marketing strategy and planning | About BusinessDigital marketing strategy and planning | About Business
Digital marketing strategy and planning | About Business
Gaditek
 
Intro to social network analysis | What is Network Analysis? | History of (So...
Intro to social network analysis | What is Network Analysis? | History of (So...Intro to social network analysis | What is Network Analysis? | History of (So...
Intro to social network analysis | What is Network Analysis? | History of (So...
Gaditek
 
Marketing ethics and social responsibility | Criticisms of Marketing
Marketing ethics and social responsibility | Criticisms of MarketingMarketing ethics and social responsibility | Criticisms of Marketing
Marketing ethics and social responsibility | Criticisms of Marketing
Gaditek
 
understanding and capturing customer value | What Is a Price?
understanding and capturing customer value | What Is a Price?understanding and capturing customer value | What Is a Price?
understanding and capturing customer value | What Is a Price?
Gaditek
 
The marketing environment | Suppliers | Marketing intermediaries
The marketing environment | Suppliers | Marketing intermediariesThe marketing environment | Suppliers | Marketing intermediaries
The marketing environment | Suppliers | Marketing intermediaries
Gaditek
 
strategic planning | Customer Relationships | Partnering to Build
strategic planning | Customer Relationships | Partnering to Build strategic planning | Customer Relationships | Partnering to Build
strategic planning | Customer Relationships | Partnering to Build
Gaditek
 
Digital marketing | what is marketing?
Digital marketing | what is marketing?Digital marketing | what is marketing?
Digital marketing | what is marketing?
Gaditek
 
Fundamentals of Computer Design including performance measurements & quantita...
Fundamentals of Computer Design including performance measurements & quantita...Fundamentals of Computer Design including performance measurements & quantita...
Fundamentals of Computer Design including performance measurements & quantita...
Gaditek
 
Dealing with exceptions Computer Architecture part 2
Dealing with exceptions Computer Architecture part 2Dealing with exceptions Computer Architecture part 2
Dealing with exceptions Computer Architecture part 2
Gaditek
 
Dealing with Exceptions Computer Architecture part 1
Dealing with Exceptions Computer Architecture part 1Dealing with Exceptions Computer Architecture part 1
Dealing with Exceptions Computer Architecture part 1
Gaditek
 
Pipelining of Processors
Pipelining of ProcessorsPipelining of Processors
Pipelining of Processors
Gaditek
 
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)
Gaditek
 
differential equation Lecture#14
differential equation  Lecture#14differential equation  Lecture#14
differential equation Lecture#14
Gaditek
 
differential equation Lecture#12
differential equation Lecture#12differential equation Lecture#12
differential equation Lecture#12
Gaditek
 
differential equation Lecture#11
differential equation Lecture#11differential equation Lecture#11
differential equation Lecture#11
Gaditek
 
differential equation Lecture#13
differential equation Lecture#13differential equation Lecture#13
differential equation Lecture#13
Gaditek
 
differential equation Lecture#10
differential equation Lecture#10differential equation Lecture#10
differential equation Lecture#10
Gaditek
 
differential equation Lecture#9
differential equation  Lecture#9differential equation  Lecture#9
differential equation Lecture#9
Gaditek
 
differential equation Lecture#8
differential equation Lecture#8differential equation Lecture#8
differential equation Lecture#8
Gaditek
 
differential equation Lecture#7
differential equation Lecture#7differential equation Lecture#7
differential equation Lecture#7
Gaditek
 

More from Gaditek (20)

Digital marketing strategy and planning | About Business
Digital marketing strategy and planning | About BusinessDigital marketing strategy and planning | About Business
Digital marketing strategy and planning | About Business
 
Intro to social network analysis | What is Network Analysis? | History of (So...
Intro to social network analysis | What is Network Analysis? | History of (So...Intro to social network analysis | What is Network Analysis? | History of (So...
Intro to social network analysis | What is Network Analysis? | History of (So...
 
Marketing ethics and social responsibility | Criticisms of Marketing
Marketing ethics and social responsibility | Criticisms of MarketingMarketing ethics and social responsibility | Criticisms of Marketing
Marketing ethics and social responsibility | Criticisms of Marketing
 
understanding and capturing customer value | What Is a Price?
understanding and capturing customer value | What Is a Price?understanding and capturing customer value | What Is a Price?
understanding and capturing customer value | What Is a Price?
 
The marketing environment | Suppliers | Marketing intermediaries
The marketing environment | Suppliers | Marketing intermediariesThe marketing environment | Suppliers | Marketing intermediaries
The marketing environment | Suppliers | Marketing intermediaries
 
strategic planning | Customer Relationships | Partnering to Build
strategic planning | Customer Relationships | Partnering to Build strategic planning | Customer Relationships | Partnering to Build
strategic planning | Customer Relationships | Partnering to Build
 
Digital marketing | what is marketing?
Digital marketing | what is marketing?Digital marketing | what is marketing?
Digital marketing | what is marketing?
 
Fundamentals of Computer Design including performance measurements & quantita...
Fundamentals of Computer Design including performance measurements & quantita...Fundamentals of Computer Design including performance measurements & quantita...
Fundamentals of Computer Design including performance measurements & quantita...
 
Dealing with exceptions Computer Architecture part 2
Dealing with exceptions Computer Architecture part 2Dealing with exceptions Computer Architecture part 2
Dealing with exceptions Computer Architecture part 2
 
Dealing with Exceptions Computer Architecture part 1
Dealing with Exceptions Computer Architecture part 1Dealing with Exceptions Computer Architecture part 1
Dealing with Exceptions Computer Architecture part 1
 
Pipelining of Processors
Pipelining of ProcessorsPipelining of Processors
Pipelining of Processors
 
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)
 
differential equation Lecture#14
differential equation  Lecture#14differential equation  Lecture#14
differential equation Lecture#14
 
differential equation Lecture#12
differential equation Lecture#12differential equation Lecture#12
differential equation Lecture#12
 
differential equation Lecture#11
differential equation Lecture#11differential equation Lecture#11
differential equation Lecture#11
 
differential equation Lecture#13
differential equation Lecture#13differential equation Lecture#13
differential equation Lecture#13
 
differential equation Lecture#10
differential equation Lecture#10differential equation Lecture#10
differential equation Lecture#10
 
differential equation Lecture#9
differential equation  Lecture#9differential equation  Lecture#9
differential equation Lecture#9
 
differential equation Lecture#8
differential equation Lecture#8differential equation Lecture#8
differential equation Lecture#8
 
differential equation Lecture#7
differential equation Lecture#7differential equation Lecture#7
differential equation Lecture#7
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

Automata

  • 1. The theory of Automata Lecture no 1 Syed Asif Ali  E–mail: aasyed@smiu.edu.pk asifkhi@hotmail.com
  • 2.  Course Title: Theory of Computer Science [AUTOMATA]  Prerequisites: Discrete Mathematic  Degree(s): BCS  Duration: 18 weeks in Fifth semester  Lectures: 48 in total, 3 per week, including some examples.  Laboratories: none
  • 3. Course Description:  Finite Automata.  Deterministic Finite automata (DFA).  Non-Deterministic Finite Automata (NFA).  Regular Expression & Language.  Properties of Regular Languages.  Context–Free Grammar & Language.  Properties of Context–Free Languages.  Push–Down Automata.  Turing Machines.
  • 4. Reference Books: K.L.P. Mishra, N. Chandrasekaran, Theory of Computer Science (Automata, Languages & Computation), Second Edition, Prentice Hall of India, 1999
  • 6. Reference Books: John.E. Hopcroft, R. Motwani, and J.D. Ullman, Introduction to Automata Theory, Language and Computation, Second Edition, Pearson Education Asia, 2001.
  • 7. Reference Books: J.C. Martin, Introduction to Languages and Theory of Computation, Second Edition, McGraw Hill 1991.
  • 8. Marks Distribution Class Attendance 05 Class– Tests/Presentation 15 Quizzes 20 Mid–Term Examination 20 Final Examination 40 Total 100
  • 9. AUTOMATA  Automata is Greek letters .Automata is a word formulated from automation, which means machine designing or replacing human beings with machines.  Every machine design requires some hardware part and some software part.  A machine could be a finite state machine ,a Turing Machine, a pushdown automata, or any other restricted version of a Turing machine.
  • 10.  Input File  Sequence of symbols  Internal State  of Control Unit  Next-State Transition Function  May have Temporary Storage Input File Storage Control Unit Output Automata
  • 12. Sets  Sets are collections in which order of elements and duplication of elements do not matter.  {1,a,1,1} = {a,a,a,1} = {a,1} Size  Size of set mean number of elements in set e.g. |{a,b,c}| = 3 Special Sets  Empty Set   Universal Set U
  • 13. Set Relations  Subset {a,c}  {a,b,c}  Proper Subset {a,c}  {a,b,c}  is-element-of b  {a,b,c} Set Operations Union X  Y Intersection X  Y Difference X – Y Complement X (always with respect to Universe) Disjoint S1  S2 =  • Powerset 2x • Is it possible for |S| = |2S|? A x B = {(a,b): for all a  A and b  B}
  • 14. DeMorgan’s Laws  S1  S2 = S1  S2  S1  S2 = S1  S2 Functions : S1  S2 S1 = Domain S2 = Range S1 may be same as S2 Equivalence Relations Reflexive Symmetric Transitive a, b  S, we write a  b if a is equivalent to b
  • 15. What is a graph?  It's an abstract notion, used to represent the idea of some kind of connection between pairs of objects. A graph consists of:  A collection of "vertices", draw as small circles.  A collection of "edges", each connecting some two vertices. Mathematical Definition G = (V, E)  V = {v1,v2,…,vn} = Vertices  E = {e1, e2, …, em} = Edges
  • 16. Graph Terminology  Walk = Sequence of edges  Path = Walk with no repeated edges  Simple Path = No vertices repeated  Cycle = Path from vi back to vi  Simple Cycle = Cycle with no vertices repeated
  • 17. Character or Alphabet: An alphabet S is a set of symbols (characters, letters). or A finite set of symbols/ An abstract set of distinct symbols over which a language is defined String :A string (or word) over S is a sequence of symbols. The empty string is the string containing no symbols at all, and is denoted by ε. Length/Size of String: The length of a string is the number of symbols that it contains (repetitions allowed). Absolute values are used to denote length. The length of a string w is denoted |w|. For example |00100| = 5 |aab| = 3 | epsilon | = 0
  • 18. Concatenation : The concatenation of two strings is the string resulting from putting them together from left to right.  If u=one and v=two then u · v=onetwo and  v · u=twoone. Dot is usually omitted; just write uv for u · v.  Laws: u · (v · w) = (u · v) · w u · ε = u ε · u = u |u · v| = |u| + |v|
  • 19. Regular Expression/Relational Expression • Let Σ be an alphabet. The regular expressions(regex) are defined inductively as follows: – ø is a regular expression denoting {}, – ε is a regular expression denoting {}, – for each a Є Σ¸ a is a regular expression denoting {a}, – Assume r and s are regular expressions denoting sets R and S, then . rs denotes RS, . r + s denoted R υ S, . r* denotes R*
  • 20. Positive Kleene a+ a*= {a ,aa ,aaa ,aaaa ,aaaaa ,………..} Kleene Star a* a*= {ε,a ,aa ,aaa ,aaaa ,aaaaa ……………..}
  • 21. Proof of Kleene Star Let L0 and Li =L.L i-1 where i>=1 then Kleene closure of L is L*.L* is the set such that L* =Ui=0 Li i=0 L0={ε} Solution Suppose L={01,10} L* = L0 U L1 U L2 U ………Ln Its given that L0={ε} Take i=1 L1 =L L 1-1
  • 22. L1 =L L0 L1={01,10}.{ε} L1={01 ε,10 ε} L1={01,10} Now Take i=2 L2 =L.L 2-1 L2 =L.L1 L2={01,10}. {01,10} L2={0101,0110,1001,1010} Now L*=L0 U L1 U L2 ….U Ln L*={ε} U {01,10} U {0101,0110,1001,1010}……. In a Kleene Star form it may be written as L*={01,10}*
  • 23. Regular Language/Rational Language, Recognizable Language. A regular, rational, or recognizable language is one that fulfils one of the following equivalent criteria:  L is defined by a regular expression.  There are a finite number of L-cones.  L is recognized by a finite state automaton or FSA.
  • 24. Language Expression Meaning Transition Graph/Automata L={0,1} r.e=(0+1) r.e=(0/1) r.e=(0 1) choosing from r1 or r2 L={0,1} r.e=(0.1) r.e=(01) r.e=(o∩1) concatenati on of r1 and r2 L={0} r*=(0) zero or more times (Kleene closure) L={0} r+ =(0) one or more times 0 1 0 1 0 0 0 0
  • 25. Types of Automata Automata Finite Automata Push Down Automata Turing Machine (FA) (PDA) (TM) Deterministic Non-Deterministic Finite Automata (DFA) Finite Automata (NFA)
  • 26. FINITE AUTOMATA (FA) NON-DETERMINISTIC FINITE AUTOMATA (NFA) DETERMINISTIC FINITE AUTOMATA (DFA) FINITE AUTOMATA (FA)
  • 27. What is the difference between the two? Is there a single DFA for a corresponding NFA? Why do we want to do this anyway?
  • 28. Deterministic Finite Automata  For every state and every alphabet symbol there is exactly one move that the machine can make Mathematical Definition  A Deterministic Finite Automata is a 5-tuple (Q, Σ, δ, qo, F) where Q→Total numbers of State(s) Σ→Input(s)/Alphabets(s) δ→Transition Function QXΣ q0→Initial State(s) F→Final State(s)
  • 29. Finite Automata State Graphs  An Input  A state  The start state  An accepting state  A transition a a,b,…0,1,2…
  • 30. Example r.e =a.b Q→Total numbers of State(s) = {q0,q1,q2} Σ→Input(s)/Alphabets(s)={a,b} q0→Initial State(s)={q0} F→Final State(s)={q2} δ→Transition Function QXΣ QXΣ Input a Input b q0 q1 є q1 є q2 q2 є є q0 q1 q2 a b q2 Acceptance State /Final State Initial State
  • 31. Nondeterministic Finite Automata  At each state, for each symbol, the machine can move into 0 or more states. Mathematical Definition  A Non-Deterministic Finite Automata is a 5-tuple (Q,Σ,δ, qo, F) where Q→Total numbers of State(s) Σ→Input(s)/Alphabets(s) δ→Transition Function 2 pow Q q0→Initial State(s) F→Final State(s)
  • 32. Nondeterministic Finite Automata Two non-deterministic elements: Lambda transitions or epsilon transitions 2 out arcs with same symbol
  • 33. Non-Deterministic Finite Automata Example L={a} a a a 1q 2q 3q 0q No transition: the automaton hangs Acceptance state/Final State Two choices QX Σ Input a q0 q1 U q3 q1 q2 q2 є q3 є
  • 34. Nondeterministic Finite Automata  Non-determinism When machine is in a given state and reads a symbol, the machine will have a choice of where to move to next. There may be states where, after reading a given symbol, the machine has nowhere to go. Applying the transition function will give, not 1 state, but 0 or more states.
  • 35. Non-Deterministic Finite Automata 1q 2q 3q a a a 0q No transition: the automaton hangs “accept”Two choices Example: L = {a}
  • 36. Non-Deterministic Finite Automata Example: L corresponds to the regular expression {11 + 110}*0 1 q1 q2 q3 q0 q4 1 1 1 0 0 start
  • 37. Non-Deterministic Finite Automata  L = set of strings ending in ab q0 q1 q2start a b a,b
  • 39. REGULAR EXPRESSION  Theorem If L is accepted by a DFA, then L is denoted by a regular expression. The language of FA (regular language) is the set of strings that label paths that go from the start state to some accepting state. The languages accepted by DFA, NFA, e-NFA, Regular Expressions are called regular languages
  • 40. REGULAR EXPRESSION  The regular expressions over  are the smallest set of expressions including where where A,B are rexp over " " " where A is a rexp over ‘c’ A+B AB A* e c   
  • 41. Regular Expression Notation  a: an ordinary letter  ε: the empty string  r1 | r2: choosing from r1 or r2  r1r2 : concatenation of r1 and r2  r*: zero or more times (Kleene closure)  r+: one or more times
  • 42. NFA to DFA Conversion What is the difference between the two? Is there a single DFA for a corresponding NFA? Why do we want to do this anyway?
  • 43. Nondeterministic Finite Automata  Non-determinism When machine is in a given state and reads a symbol, the machine will have a choice of where to move to next. There may be states where, after reading a given symbol, the machine has nowhere to go. Applying the transition function will give, not 1 state, but 0 or more states.
  • 44. Nondeterministic Finite Automata  At each state, for each symbol, the machine can move into 0 or more states.  A Non-Deterministic Finite Automata is a 5-tuple (Q, S, d, qo, F) where Input alphabet, i.e. Transition function 2 pow Q Initial state i.e. Final states i.e. :Q : : :0q :F Set of states, i.e. { q0, q1, q2, q3, q4} {1,0} {q0} {q4}
  • 45. Nondeterministic Finite Automata  Two non-deterministic elements: Lambda transitions or epsilon transitions 2 out arcs with same symbol
  • 46.  For every state and every alphabet symbol there is exactly one move that the machine can make  A Deterministic Finite Automata is a 5-tuple (Q, S, d, qo, F) where Deterministic Finite Automata :Q : : :0q :F Input alphabet Transition function Q x I Initial state Final states Set of states
  • 47. DFA CYCLE Regular Expression NFA (e-move) NFA (without e-move) DFA
  • 48. Regular Expressions to NFA  For each kind of rexp, define an NFA Notation: NFA for rexp M •For e •For input a M e a
  • 49. NFA Empty Move  For A B A B e For A | B A B e e e e
  • 50. NFA Empty Move  For A* A ee e e
  • 51.  For re=r1* e e e r1 eS A B Fstart r1 r1 S BAF Astart r1 NFA (e-move) DFA States/ input r1 S BFBA=BAF A BAF B  F  BAF BAF Transaction table: r1*BAFS r1 start r1 NFA ->DFA (EXAMPLE-1)
  • 52. NFA ->DFA (EXAMPLE-2)  For re=r1.r2 NFA (e-move) For r1 For r2 For r1.r2 A B r1 start C D r2 start A B C D er1 r2 start
  • 53. NFA ->DFA (EXAMPLE-2 cont….) State s/ input r1 r2 A BC  B   C  D D   BC  D DFA Transaction table: A BC Dr2r1 start CA BC D r2r1 r2 start r1.r2
  • 54. NFA ->DFA (EXAMPLE-3)  For re=r1+r2 For r1 For r2 C D r2 startA B r1 start e e A B r1 C D r2 start S F ee For r1+r2
  • 55. NFA ->DFA (EXAMPLE-3 cont….) FD State s/inpu t r1 r2 S BF DF A BF  B   C  DF D   F   BF   DF   Transaction table: DFA BDFstart r1/r2 S r1+r2 r1r1 BF A DF Cr2 start S r2 BF DF start S r1 r2
  • 56. NFA ->DFA (EXAMPLE-1) q0 q1 q2start a b a,b q0 q0q1 q0q2start a b b a a b States / input a b q0 q1q0 q0 q1  q2 q2   q1q0 q1q0 q0q 2 q0q2 q1q2 q0 Transaction table: NFA Equivalent DFA
  • 57. NFA ->DFA (EXAMPLE-2) B A C start 0 0 1 10 B ABCstart 0 0 1 AC 1 A B ABCstart 0 0 1 AC 1 NFA Equivalent DFA States / input 0 1 B BAC  A  AC C   ABC ABC AC AC  AC Transaction table: