SlideShare a Scribd company logo
1 of 57
Download to read offline
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

Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal languageRabia Khalid
 
Regular language and Regular expression
Regular language and Regular expressionRegular language and Regular expression
Regular language and Regular expressionAnimesh Chaturvedi
 
Introduction to fa and dfa
Introduction to fa  and dfaIntroduction to fa  and dfa
Introduction to fa and dfadeepinderbedi
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Animesh Chaturvedi
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)Naman Joshi
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture NotesFellowBuddy.com
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languagesparmeet834
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of AutomataFarooq Mian
 
1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfaSampath Kumar S
 
Course file for theory of computation dt 08 08-2016.
Course file for theory of computation dt 08 08-2016.Course file for theory of computation dt 08 08-2016.
Course file for theory of computation dt 08 08-2016.sumit jain
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMRajendran
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra pptGirdharRatne
 

What's hot (20)

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 language and Regular expression
Regular language and Regular expressionRegular language and Regular expression
Regular language and Regular expression
 
Introduction to fa and dfa
Introduction to fa  and dfaIntroduction to fa  and dfa
Introduction to fa and dfa
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture Notes
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languages
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Context free grammar
Context free grammar Context free grammar
Context free grammar
 
1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa
 
Course file for theory of computation dt 08 08-2016.
Course file for theory of computation dt 08 08-2016.Course file for theory of computation dt 08 08-2016.
Course file for theory of computation dt 08 08-2016.
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
 
Abstraction
AbstractionAbstraction
Abstraction
 
pushdown automata
pushdown automatapushdown automata
pushdown automata
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 

Similar to Automata

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
 
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.pdfTONY562
 
Class1
 Class1 Class1
Class1issbp
 

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

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

Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfsmsksolar
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxnuruddin69
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 

Recently uploaded (20)

Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 

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: