SlideShare une entreprise Scribd logo
1  sur  57
Télécharger pour lire hors ligne
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:

Contenu connexe

Tendances

TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationMohammad Imam Hossain
 
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 1Srimatre K
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal languageRabia Khalid
 
Mealy and moore machine
Mealy and moore machineMealy and moore machine
Mealy and moore machineEhatsham Riaz
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplicationRespa Peter
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite AutomataRatnakar Mikkili
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10chidabdu
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDAAshish Duggal
 
Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.Alamgir Hossain
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryTsegazeab Asgedom
 

Tendances (20)

Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler Design
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of Computation
 
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
 
Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Mealy and moore machine
Mealy and moore machineMealy and moore machine
Mealy and moore machine
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplication
 
Lecture: Automata
Lecture: AutomataLecture: Automata
Lecture: Automata
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
PDA (pushdown automaton)
PDA (pushdown automaton)PDA (pushdown automaton)
PDA (pushdown automaton)
 
Python basics
Python basicsPython basics
Python basics
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
 
Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata Theory
 

Similaire à Automata Theory Introduction

Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfdawod 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 ClassificationPrafullMisra
 
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 5Dr. Maamoun Ahmed
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxRaviAr5
 
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.pdfDrIsikoIsaac
 
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 KanpurVivekananda Samiti
 
compiler Design course material chapter 2
compiler Design course material chapter 2compiler Design course material chapter 2
compiler Design course material chapter 2gadisaAdamu
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghggggggggggggggggggggggggggggggggggadugnanegero
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFAMaulik Togadiya
 
RegularExpressions.pdf
RegularExpressions.pdfRegularExpressions.pdf
RegularExpressions.pdfImranBhatti58
 
Class1
 Class1 Class1
Class1issbp
 

Similaire à Automata Theory Introduction (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
 
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
 
Automata Theory
Automata TheoryAutomata Theory
Automata Theory
 

Plus de 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 BusinessGaditek
 
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 MarketingGaditek
 
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 intermediariesGaditek
 
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 2Gaditek
 
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 1Gaditek
 
Pipelining of Processors
Pipelining of ProcessorsPipelining of Processors
Pipelining of ProcessorsGaditek
 
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#14Gaditek
 
differential equation Lecture#12
differential equation Lecture#12differential equation Lecture#12
differential equation Lecture#12Gaditek
 
differential equation Lecture#11
differential equation Lecture#11differential equation Lecture#11
differential equation Lecture#11Gaditek
 
differential equation Lecture#13
differential equation Lecture#13differential equation Lecture#13
differential equation Lecture#13Gaditek
 
differential equation Lecture#10
differential equation Lecture#10differential equation Lecture#10
differential equation Lecture#10Gaditek
 
differential equation Lecture#9
differential equation  Lecture#9differential equation  Lecture#9
differential equation Lecture#9Gaditek
 
differential equation Lecture#8
differential equation Lecture#8differential equation Lecture#8
differential equation Lecture#8Gaditek
 
differential equation Lecture#7
differential equation Lecture#7differential equation Lecture#7
differential equation Lecture#7Gaditek
 

Plus de 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
 

Dernier

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Dernier (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Automata Theory Introduction

  • 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: