SlideShare a Scribd company logo
Introduction toAutomata Theory
Unit – I
By Dr.T.P.Latchoumi
BY DR.T.P.LATCHOUMI
UNIT 1
• Introduction to Automaton
• Mathematical concepts
• Formal Languages: Strings, Languages, Properties
• Finite Representation : Regular Expressions
• Problems related to regular expressions
• Finite Automata :Deterministic Finite Automata
• Nondeterministic Finite Automata
• Finite Automaton with €- moves
• Problems related to Deterministic and Nondeterministic Finite
Automata
• Problems related to Finite Automaton with €- moves
• Minimization of DFA
• Problems related to Minimization of DFA
• Regular Languages : Equivalence of Finite Automata and
Regular Languages
• Equivalence of Finite Automata and Regular Grammars
• Problems related to Equivalence of Finite Automata and
Regular Languages and Regular Grammars
• Variants of Finite Automata :Two-way Finite Automaton Mealy
Machines
• Properties of Regular Languages: Closure Properties
• Set Theoretic Properties & Other Properties
• Pumping Lemma
BY DR.T.P.LATCHOUMI
What is Automata Theory?
Study of abstract computing devices, or ―machines‖
Automaton = an abstract computing device
Note: A ―device‖ need not even be a physical hardware!
A fundamental question in computer science:
Find out what different models of machines can do and cannot do
The theory of computation
Computability vs. Complexity
BY DR.T.P.LATCHOUMI
(A pioneer of automata theory)
Alan Turing (1912-1954)
Father of Modern Computer Science
English mathematician
Studied abstract machines called Turing machines even before computers existed
Heard of the Turing test?
BY DR.T.P.LATCHOUMI
Theory of Computation: A Historical
Perspective
BY DR.T.P.LATCHOUMI
Why Automata Theory?
Automata theory is important because it allows scientists to understand how
machines solve problems.
An automaton is any machine that uses a specific, repeatable process to convert
information into different forms. Modern computers are a common example of
an automaton.
BY DR.T.P.LATCHOUMI
Introduction to formal proof
The Statement ―If A then B‖ means that B is deduced from A.
In this statement A is called hypothesis and B is called conclusion
statement.
BY DR.T.P.LATCHOUMI
Types of formal proof
Deductive proof
◦ It consists of a sequence of statements given with logical reasoning to prove
the first (or initial) statement.
◦ The first statement is called hypothesis.
Inductive proof
◦ It is a recursive kind of proof which consists of sequence of parameterized
statements that cure statement itself with lower values of its parameters
BY DR.T.P.LATCHOUMI
Inductive Proof (Example)
BY DR.T.P.LATCHOUMI
Cont.….
1. Show that the base case is true
2. Assume it is true for some n=k
3. Show that this implies that it is also true for n=k+1
BY DR.T.P.LATCHOUMI
Cont.…..
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Example 2
Prove that1 2 + 2 2 + 3 2 + ... + n 2 = n (n + 1) (2n + 1)/ 6
For all positive integers n.
Solution: Statement P (n) is defined by
1 2 + 2 2 + 3 2 + ... + n 2 = n (n + 1) (2n + 1)/ 2
We first show that p (1) is true.
LHS = 1 2 = 1
RHS = 1 (1 + 1) (2*1 + 1)/ 6 = 1
Both sides of the statement are equal hence p (1) is true.
BY DR.T.P.LATCHOUMI
Cont.…
2. We now assume that p (k) is true
1 2 + 2 2 + 3 2 + ... + k 2 = k (k + 1) (2k + 1)/ 6 and show
that p (k + 1) is true by adding (k + 1) 2 to both sides of the
above statement
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Additional forms of Proofs
I. Proofs about sets
II. Proofs by contradiction
III. Proofs by counter example
BY DR.T.P.LATCHOUMI
Proofs about sets
Set is a collection of elements or items. Let us consider two sets A and B.
Define the expression R as union of A and B (i.e. AUB) and S as union of B and
A (i.e. BUA), where U is the Union operation U on two sets A and B such that if
x ϵ AUB iff x is in A or x is in B.
Prove that R=S(i.e, x is in R if and only if it is in S)
BY DR.T.P.LATCHOUMI
Proof
To prove R=S, we must prove
AUB=BUA
S.No. Statement Justification
1 x is in AUB Given
2 x is in A or x is in B By definition of union & (1)
3 x is in B or x is in A By definition of union & (2)
4 x is in BUA By definition of union & (3)
i) x is in AUB then it is in BUA
ii) x is in BUA then it is in AUB
S.No. Statement Justification
1 x is in BUA Given
2 x is in B or x is in A By definition of union & (1)
3 x is in A or x is in B By definition of union & (2)
4 x is in AUB By definition of union & (3)
BY DR.T.P.LATCHOUMI
Proofs by
contradiction
Example: Prove PUQ = QUP
Proof: Initially assume, PUQ = QUP is not true
i.e. PUQ ≠ QUP
Now consider, x is in PUQ
x is in P or x is in Q (By Definition of Union)
x is in Q or x is in P (By Definition of Union)
x is in QUP (By Definition of Union)
This contradicts our assumption PUQ ≠ QUP
Hence the assumption which we made initially is false.
Therefore PUQ = QUP is proved.
• In proof by contradiction, to
prove the statement of the form
―if A true then B true‖, We start
with statement A is not true by
assumption and try to get the
conclusion statement B.
• When it impossible to reach B
then we contradict our self and
accept that A is true.
BY DR.T.P.LATCHOUMI
Proofs by counter
Example 1: There is no pair of integers a and b such that a mod b
= b mod a
Proof: There are two possibilities. They are either a>b or a<b.
If a=2 and b=3 then 2 mod 3 ≠ 3 mod 2
If a=3 and b=2 then 3 mod 2 ≠ 2 mod 3
If a=b=2 then 2 mod 2 = 2 mod 2, so the given statement is true
only if a=b, so we have to change the statement slightly, Thus, a mod b
= b mod a true only when a=b.
We proved by counter example; this type of proof is called proof
by counter example. Such proof is true only at specific conditions.
• To prove certain statements, we
need to check all the possible
conditions in which that
statement remains true.
• There are some situations in
which the statement cannot be
true.
BY DR.T.P.LATCHOUMI
Example :2
Let n = 1, P(1) = 42(1) + 1 + 3(1) + 2= 43 + 33 = 64 + 27 = 91 = 13.t where t= 7
Let n = k, P(k) = 42(k) + 1 + 3(k) + 2= 42k + 1 + 3k + 2 = 13.t, true for some integer t
Let n = k + 1, P(k + 1) = 42(k + 1) + 1 + 3(k + 1) + 2
= 42(k + 1) + 1 + 3(k + 1) + 2
= 42k + 2 + 1 + 3k + 1 + 2
= 42k + 1 + 2 + 3k + 2 + 1
= 42k + 1.42 + 3k + 2.31
= 42.42k + 1 + 3.3k + 2
= 42.42k + 1 + 423k+2 - 423k+2 + 3.3k + 2 {Add & Sub 423k+2}
= 42(42k + 1 + 3k+2) + 3k+2 (-42+ 3)
= 42(13.t)- 3k+2 (-42+ 3) {42k + 1 + 3k + 2 = 13.t} = 16(13.t)- 3k+2 (-13)
= 13[16. t + 3k+2] = Multiple of 13
P(k + 1) is multiple of 13, Hence proved.
Prove that every integer n ≥ 0, the
number 42n + 1 + 3n + 2 is multiple of
13 by induction.
BY DR.T.P.LATCHOUMI
Formal Language
 Language is a set of valid strings from some alphabet. The set may be empty, finite, or infinite.
 L (M) is the language defined by machine M and L(G) is the language defined by context free grammar.
The two notations for specifying formal languages are:
 Grammar or regular expression (Generative approach).
 Automaton (Recognition approach).
BY DR.T.P.LATCHOUMI
Alphabet
An alphabet is a finite nonempty set of symbols. The symbol Σ is used to denote the alphabet.
1) Σ = {0, 1}
2) Σ = {a, b, c, …, z}
3) Σ = Set of ASII character
BY DR.T.P.LATCHOUMI
String
A string is a finite sequence of symbols chosen from some alphabet.
1) Σ = {0,1} 11001 [ Empty string is denoted by ε]
2) Σ = {a, b, c}  aabbcbbbaa
The total number of symbols in the string is called length of the string
Example: 1) |0001|=4
2) |100|=3
BY DR.T.P.LATCHOUMI
Empty string (ε)
Empty string is the string with zero occurrence of symbol. This empty string is denoted by ε.
Power of an alphabet
BY DR.T.P.LATCHOUMI
Power of an alphabet
If Σ is an alphabet, then the set of all string of certain length forms an alphabet. 𝑘 to be
the set of string of length k for each symbol in Σ.
Example
∑ = {0, 1}
0 ={ε}
1 = {0, 1}
2 = {00, 01, 10, 11}
3 = {000, 001, 010, 011, 100, 101, 110, 111}
+ = 1 𝑈 2 𝑈 3 …
∑+ = 𝑖
∗ = 0 𝑈 1 𝑈 2 …
∑∗ = 𝑖
Set of all strings over an alphabet is denoted by ∑∗
Set of all strings over an alphabet except null string is denoted by ∑+
BY DR.T.P.LATCHOUMI
Concatenation of strings
Let X and Y be the two strings over Σ = {a, b, c}. Then XY denotes the concatenation of X and Y.
X = aabb
Y = cccc
XY = aabbcccc
YX = ccccaabb
BY DR.T.P.LATCHOUMI
Language
It is a collection of all strings.
A set of strings of all which are chosen from ∑∗ is called a language, where ∑ is a particular alphabet set.
BY DR.T.P.LATCHOUMI
Substring, suffix and prefix
Substring: For a string w, the string x is a substring of w if the string x appears contiguously in w.
As such, for w =abcdef
we have that bcd is a substring of w,
but ace is not a substring of w.
Suffix and prefix: A string x is a suffix of w if its a substring of w appearing in the end of w.
Similarly, y is a prefix of w if y is a substring of w appearing in the beginning of w.
As such, for w =abcdef
we have that abc is a prefix of w,
and def is a suffix of w.
BY DR.T.P.LATCHOUMI
Binary relations on strings
1. Prefix - u is a prefix of v if there is a w such that v = uw.
◦ Examples:
◦  is a prefix of 0 since 0 = 0
◦ apple is a prefix of appleton since appleton = apple.ton
2. Suffix - u is a suffix of v if there is a w such that v = wu.
◦ Examples:
◦  is a suffix of 0 since 0 =0 
◦ ton is a suffix of appleton since= apple.ton
BY DR.T.P.LATCHOUMI
3. Substring - u is a substring of v if there are x and y such that v = xuy.
◦ Examples:
◦ let is a substring of appleton since appleton = app.let.on
◦ 0 is a substring of 0 since 0 = epsilon.0.epsilon
Observe that prefix and suffix are special cases
of substring.
BY DR.T.P.LATCHOUMI
Finite Automata
BY DR.T.P.LATCHOUMI
Types of finite automata (FA)
 Deterministic Finite Automata (DFA)
 Nondeterministic Finite Automata (NFA)
BY DR.T.P.LATCHOUMI
Transition
diagram
BY DR.T.P.LATCHOUMI
Transition
table
• A transition table is a conventional table
represent of a function like in FA.
• That takes two argument and return a
value.
• The rows of the table correspond to the
state and column corresponds to the input
symbols.
• Row corresponds to states of automata
and columns correspond to input symbols.
• The entry for row correspond to state q
and column corresponding to the input
symbol ‗a‘ is the state δ(q,a).
BY DR.T.P.LATCHOUMI
Deterministic Finite Automata
(DFA)
◦ Definition
◦ Finite automata are called Deterministic automata if there is only one path for its specified input from current
state to next state.
◦ A DFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where −
◦ Q is a finite set of states.
◦ ∑ is a finite set of symbols called alphabet.
◦ δ is the transition function where δ: Q × ∑ → Q
◦ q0 is the initial state from where any input is processed (q0 ∈ Q).
◦ F is a set of final state/states of Q (F ⊆ Q).
BY DR.T.P.LATCHOUMI
Graphical Representation of a
DFA
A DFA is represented by digraphs called state diagram.
 The vertices represent the states.
 The arcs labelled with an input alphabet show the transitions.
 The initial state is denoted by an empty single incoming arc.
 The final state is indicated by double circles.
BY DR.T.P.LATCHOUMI
Example 1
BY DR.T.P.LATCHOUMI
Example 2
Design FA which accepts only those
strings which start with 0 and end
with 1 over the input set Σ = {0, 1}
BY DR.T.P.LATCHOUMI
Example 3
Design FA & State Table which
accepts odd number of 1‘s and any
number of 0‘s.
BY DR.T.P.LATCHOUMI
Nondeterministic Finite Automata
(NFA)
 FA is also called as NFA when many paths are specified in code from the current state to next state.
 In NDFA, for a particular input symbol, the machine can move to any combination of the states in the machine.
 In other words, the exact state to which the machine moves cannot be determined.
 Hence, it is called Non-deterministic Automaton.
 As it has finite number of states, the machine is called Non-deterministic Finite Machine or Non-deterministic Finite
Automaton.
BY DR.T.P.LATCHOUMI
Formal Definition of an NDFA
An NDFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where −
Q is a finite set of states.
∑ is a finite set of symbols called alphabets.
δ is the transition function where δ: Q × ∑ → 2Q (Here the power set of Q (2Q) has been taken because in case of
NDFA, from a state, transition can occur to any combination of Q states)
q0 is the initial state from where any input is processed (q0 ∈ Q).
F is a set of final state/states of Q (F ⊆ Q).
BY DR.T.P.LATCHOUMI
Graphical Representation of an
NDFA: (same as DFA)
An NDFA is represented by digraphs called state diagram.
 The vertices represent the states.
 The arcs labelled with an input alphabet show the transitions.
 The initial state is denoted by an empty single incoming arc.
 The final state is indicated by double circles.
BY DR.T.P.LATCHOUMI
Example 1
Let a non-deterministic finite automaton be
Q = {a, b, c}
∑ = {0, 1}
q0 = {a}
F = {c}
BY DR.T.P.LATCHOUMI
Example 2
Construct NFA
where L= {0101* + 0100 n ≥ 0}
over the string ∑= {0,1}
BY DR.T.P.LATCHOUMI
Differences between DFA and NFA
DFA NFA
The transition from a state is to a single next state for each input symbol.
Hence it is called deterministic.
The transition from a state can be to multiple next states for each input
symbol. Hence it is called non-deterministic.
The transition mapping for DFA is Q x ∑ —> Q. The transition mapping for NFA is Q x (∑ U {ε}) —> 2Q
Empty string transitions are not seen in DFA. NDFA permits empty string transitions.
Backtracking is allowed in DFA In NDFA, backtracking is not always possible.
Requires more space. Requires less space.
A string is accepted by a DFA if it transits to a final state. A string is accepted by a NDFA, if at least one of all possible transitions
ends in a final state.
BY DR.T.P.LATCHOUMI
FA with Epsilon transition
The ε transition in NFA is given to move from one state to another without having any
symbol from input.
The language accepted by NFA with epsilon transition is represented 5 tuples (Q, ∑, δ,
q0, F) Where, M is the NFA with ε moves.
Q is the finite set of non-empty states.
∑ is the finite set of non-empty symbols.
δ is the finite set of transitions.
q0 is the initial state.
F is the final state.
BY DR.T.P.LATCHOUMI
Epsilon closure (p)
It is set of all state which are reachable from state p or epsilon transition such that
1) ε closure (p) ={p}, Where p € Q
2) If there exist ε -closure (p) ={q} and δ (q, ε) = r, then ε closure (p) = {q, r}.
BY DR.T.P.LATCHOUMI
Example 1
Find the ε closure for the following
NFA with ε
BY DR.T.P.LATCHOUMI
Example 2
Construct NFA with ɛ which accepts a
language consisting g the strings of any
number of a‘s followed by any number of
b‘s followed by any number of c‘s.
Solution
Here any number of a‘s or b‘s or c‘s means
zero or more in number.
That means there can be zero or more a‘s
followed by zero or more b‘s followed by
more c‘s.
Hence the NFA with ɛ moves can be
Transition Table: a B c ɛ
q0 q0 Φ ϕ q1
q1 ϕ q1 ϕ q2
q2 ϕ Φ q2 ϕ
We can parse the string aabbcc as follows.
 (q0,aabbcc) -  (q0,abbcc)
 (q0,bbcc)
 (q1, bbcc)
 (q1, bcc)
 (q2, cc)
 (q2, c)
 (q2, ɛ )
Hence, we reached the accept state after scanning the complete input string.
BY DR.T.P.LATCHOUMI
Conversion from NFA with ε to
NFA without ε
1) Find all the ε transition for each state from Q that will be called as ε closure {qi} Where {qi} is the
element of Q
2) δ‘ transition can be obtained from δ transition. i.e., an ε closure of δ.
3) Step 2 is repeated for each input symbol and for each state of given NFA.
4) Using the resultant state, the transition table for equivalent NFA without ε can be built.
BY DR.T.P.LATCHOUMI
Example
Convert the given NFA with ε
transition to NFA without ε
transition
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Cont.….
BY DR.T.P.LATCHOUMI
Theorem
Equivalence of
NFA with ε
without ε
moves
BY DR.T.P.LATCHOUMI
Conversion of
NFA to DFA
BY DR.T.P.LATCHOUMI
Example 1
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Example 2
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Theorem
Equivalence of NFA and DFA
BY DR.T.P.LATCHOUMI
Method for conversion NFA with ε to
DFA
BY DR.T.P.LATCHOUMI
Example
BY DR.T.P.LATCHOUMI
Cont.…
BY DR.T.P.LATCHOUMI
Cont.….
BY DR.T.P.LATCHOUMI
BY DR.T.P.LATCHOUMI

More Related Content

PDF
Unit ii
TPLatchoumi
 
PPTX
Unit v
TPLatchoumi
 
PDF
Theory of Computation Lecture Notes
FellowBuddy.com
 
PDF
Ch3 4 regular expression and grammar
meresie tesfay
 
PDF
Formal language & automata theory
NYversity
 
PDF
Cs6503 theory of computation book notes
appasami
 
PPT
3.1 intro toautomatatheory h1
Rajendran
 
PDF
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
Unit ii
TPLatchoumi
 
Unit v
TPLatchoumi
 
Theory of Computation Lecture Notes
FellowBuddy.com
 
Ch3 4 regular expression and grammar
meresie tesfay
 
Formal language & automata theory
NYversity
 
Cs6503 theory of computation book notes
appasami
 
3.1 intro toautomatatheory h1
Rajendran
 
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 

What's hot (20)

PDF
Lecture: Regular Expressions and Regular Languages
Marina Santini
 
PPT
Regular expressions and languages pdf
Dilouar Hossain
 
PDF
Regular language and Regular expression
Animesh Chaturvedi
 
PDF
Introduction to the theory of computation
prasadmvreddy
 
PPTX
Formal language
Rajendran
 
PPTX
Types of Language in Theory of Computation
Ankur Singh
 
PPT
Theory of computing
Ranjan Kumar
 
PDF
Formal Languages and Automata Theory unit 5
Srimatre K
 
PPT
Regular Languages
parmeet834
 
PPT
Regular expression with DFA
Maulik Togadiya
 
PDF
Lecture: Context-Free Grammars
Marina Santini
 
PDF
Theory of Computer Science - Post Correspondence Problem
Karan Thakkar
 
PDF
Formal Languages and Automata Theory unit 4
Srimatre K
 
PPTX
Regular expressions
Shiraz316
 
PPT
Lecture 7: Definite Clause Grammars
CS, NcState
 
PDF
Chomsky hierarchy
SANUC2
 
PPTX
Regular expression (compiler)
ReachLocal Services India
 
PPTX
Deterministic context free grammars &non-deterministic
Leyo Stephen
 
PPTX
First order predicate logic(fopl)
surbhi jha
 
PPTX
Context Free Grammar
Akhil Kaushik
 
Lecture: Regular Expressions and Regular Languages
Marina Santini
 
Regular expressions and languages pdf
Dilouar Hossain
 
Regular language and Regular expression
Animesh Chaturvedi
 
Introduction to the theory of computation
prasadmvreddy
 
Formal language
Rajendran
 
Types of Language in Theory of Computation
Ankur Singh
 
Theory of computing
Ranjan Kumar
 
Formal Languages and Automata Theory unit 5
Srimatre K
 
Regular Languages
parmeet834
 
Regular expression with DFA
Maulik Togadiya
 
Lecture: Context-Free Grammars
Marina Santini
 
Theory of Computer Science - Post Correspondence Problem
Karan Thakkar
 
Formal Languages and Automata Theory unit 4
Srimatre K
 
Regular expressions
Shiraz316
 
Lecture 7: Definite Clause Grammars
CS, NcState
 
Chomsky hierarchy
SANUC2
 
Regular expression (compiler)
ReachLocal Services India
 
Deterministic context free grammars &non-deterministic
Leyo Stephen
 
First order predicate logic(fopl)
surbhi jha
 
Context Free Grammar
Akhil Kaushik
 
Ad

Similar to Unit i (20)

PPTX
DM(1).pptx
PradeeshSAI
 
PPTX
Mathematical Logic
Septi Ratnasari
 
PDF
Mathematical Logic
endahnurfebriyanti
 
PPT
Class1
issbp
 
PPTX
Logic in Computer Science Unit 2 (1).pptx
PriyalMayurManvar
 
PPTX
LESSON 9 & 10 - LOGIC STATEMENTS, CONNCETIVES, QUANTIFIERS, AND TRUTH TABLE.....
tmccfrancisquarre
 
PPTX
LESSON 9 & 10 - LOGIC STATEMENTS, CONNCETIVES, QUANTIFIERS, AND TRUTH TABLE.....
tmccfrancisquarre
 
PDF
Lemh1a1
Nagesh Veeranki
 
PDF
Lemh1a1
veerankinagesh
 
PDF
week01, the language of propositional logic.pdf
BoweiWang6
 
PDF
Automata
Gaditek
 
PDF
Automata
Gaditek
 
PPTX
Discrete mathematics presentation
MdZiad
 
PDF
logicproof-141212042039-conversion-gate01.pdf
PradeeshSAI
 
PDF
Lecture-3-and-4.pdf
ssuserc478ac
 
PPT
Per3 logika&amp;pembuktian
Evert Sandye Taasiringan
 
PDF
17-recursive-definitions-and-structural-induction.pdf
Endelion
 
PDF
G03201034038
inventionjournals
 
PDF
Chapter 3 REGULAR EXPRESSION.pdf
dawod yimer
 
PPT
L16
FALLEE31188
 
DM(1).pptx
PradeeshSAI
 
Mathematical Logic
Septi Ratnasari
 
Mathematical Logic
endahnurfebriyanti
 
Class1
issbp
 
Logic in Computer Science Unit 2 (1).pptx
PriyalMayurManvar
 
LESSON 9 & 10 - LOGIC STATEMENTS, CONNCETIVES, QUANTIFIERS, AND TRUTH TABLE.....
tmccfrancisquarre
 
LESSON 9 & 10 - LOGIC STATEMENTS, CONNCETIVES, QUANTIFIERS, AND TRUTH TABLE.....
tmccfrancisquarre
 
week01, the language of propositional logic.pdf
BoweiWang6
 
Automata
Gaditek
 
Automata
Gaditek
 
Discrete mathematics presentation
MdZiad
 
logicproof-141212042039-conversion-gate01.pdf
PradeeshSAI
 
Lecture-3-and-4.pdf
ssuserc478ac
 
Per3 logika&amp;pembuktian
Evert Sandye Taasiringan
 
17-recursive-definitions-and-structural-induction.pdf
Endelion
 
G03201034038
inventionjournals
 
Chapter 3 REGULAR EXPRESSION.pdf
dawod yimer
 
Ad

More from TPLatchoumi (7)

PDF
Unit 3
TPLatchoumi
 
PDF
Unit 2
TPLatchoumi
 
PDF
Unit iii
TPLatchoumi
 
PDF
Unit 1
TPLatchoumi
 
PPTX
Unit iv
TPLatchoumi
 
DOCX
Coa
TPLatchoumi
 
PDF
17 cs002
TPLatchoumi
 
Unit 3
TPLatchoumi
 
Unit 2
TPLatchoumi
 
Unit iii
TPLatchoumi
 
Unit 1
TPLatchoumi
 
Unit iv
TPLatchoumi
 
17 cs002
TPLatchoumi
 

Recently uploaded (20)

PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PDF
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PDF
Zero Carbon Building Performance standard
BassemOsman1
 
PDF
Construction of a Thermal Vacuum Chamber for Environment Test of Triple CubeS...
2208441
 
PPTX
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PPTX
quantum computing transition from classical mechanics.pptx
gvlbcy
 
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PPTX
Inventory management chapter in automation and robotics.
atisht0104
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Information Retrieval and Extraction - Module 7
premSankar19
 
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
Zero Carbon Building Performance standard
BassemOsman1
 
Construction of a Thermal Vacuum Chamber for Environment Test of Triple CubeS...
2208441
 
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
quantum computing transition from classical mechanics.pptx
gvlbcy
 
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
Inventory management chapter in automation and robotics.
atisht0104
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 

Unit i

  • 1. Introduction toAutomata Theory Unit – I By Dr.T.P.Latchoumi BY DR.T.P.LATCHOUMI
  • 2. UNIT 1 • Introduction to Automaton • Mathematical concepts • Formal Languages: Strings, Languages, Properties • Finite Representation : Regular Expressions • Problems related to regular expressions • Finite Automata :Deterministic Finite Automata • Nondeterministic Finite Automata • Finite Automaton with €- moves • Problems related to Deterministic and Nondeterministic Finite Automata • Problems related to Finite Automaton with €- moves • Minimization of DFA • Problems related to Minimization of DFA • Regular Languages : Equivalence of Finite Automata and Regular Languages • Equivalence of Finite Automata and Regular Grammars • Problems related to Equivalence of Finite Automata and Regular Languages and Regular Grammars • Variants of Finite Automata :Two-way Finite Automaton Mealy Machines • Properties of Regular Languages: Closure Properties • Set Theoretic Properties & Other Properties • Pumping Lemma BY DR.T.P.LATCHOUMI
  • 3. What is Automata Theory? Study of abstract computing devices, or ―machines‖ Automaton = an abstract computing device Note: A ―device‖ need not even be a physical hardware! A fundamental question in computer science: Find out what different models of machines can do and cannot do The theory of computation Computability vs. Complexity BY DR.T.P.LATCHOUMI
  • 4. (A pioneer of automata theory) Alan Turing (1912-1954) Father of Modern Computer Science English mathematician Studied abstract machines called Turing machines even before computers existed Heard of the Turing test? BY DR.T.P.LATCHOUMI
  • 5. Theory of Computation: A Historical Perspective BY DR.T.P.LATCHOUMI
  • 6. Why Automata Theory? Automata theory is important because it allows scientists to understand how machines solve problems. An automaton is any machine that uses a specific, repeatable process to convert information into different forms. Modern computers are a common example of an automaton. BY DR.T.P.LATCHOUMI
  • 7. Introduction to formal proof The Statement ―If A then B‖ means that B is deduced from A. In this statement A is called hypothesis and B is called conclusion statement. BY DR.T.P.LATCHOUMI
  • 8. Types of formal proof Deductive proof ◦ It consists of a sequence of statements given with logical reasoning to prove the first (or initial) statement. ◦ The first statement is called hypothesis. Inductive proof ◦ It is a recursive kind of proof which consists of sequence of parameterized statements that cure statement itself with lower values of its parameters BY DR.T.P.LATCHOUMI
  • 9. Inductive Proof (Example) BY DR.T.P.LATCHOUMI
  • 10. Cont.…. 1. Show that the base case is true 2. Assume it is true for some n=k 3. Show that this implies that it is also true for n=k+1 BY DR.T.P.LATCHOUMI
  • 13. Example 2 Prove that1 2 + 2 2 + 3 2 + ... + n 2 = n (n + 1) (2n + 1)/ 6 For all positive integers n. Solution: Statement P (n) is defined by 1 2 + 2 2 + 3 2 + ... + n 2 = n (n + 1) (2n + 1)/ 2 We first show that p (1) is true. LHS = 1 2 = 1 RHS = 1 (1 + 1) (2*1 + 1)/ 6 = 1 Both sides of the statement are equal hence p (1) is true. BY DR.T.P.LATCHOUMI
  • 14. Cont.… 2. We now assume that p (k) is true 1 2 + 2 2 + 3 2 + ... + k 2 = k (k + 1) (2k + 1)/ 6 and show that p (k + 1) is true by adding (k + 1) 2 to both sides of the above statement BY DR.T.P.LATCHOUMI
  • 16. Additional forms of Proofs I. Proofs about sets II. Proofs by contradiction III. Proofs by counter example BY DR.T.P.LATCHOUMI
  • 17. Proofs about sets Set is a collection of elements or items. Let us consider two sets A and B. Define the expression R as union of A and B (i.e. AUB) and S as union of B and A (i.e. BUA), where U is the Union operation U on two sets A and B such that if x ϵ AUB iff x is in A or x is in B. Prove that R=S(i.e, x is in R if and only if it is in S) BY DR.T.P.LATCHOUMI
  • 18. Proof To prove R=S, we must prove AUB=BUA S.No. Statement Justification 1 x is in AUB Given 2 x is in A or x is in B By definition of union & (1) 3 x is in B or x is in A By definition of union & (2) 4 x is in BUA By definition of union & (3) i) x is in AUB then it is in BUA ii) x is in BUA then it is in AUB S.No. Statement Justification 1 x is in BUA Given 2 x is in B or x is in A By definition of union & (1) 3 x is in A or x is in B By definition of union & (2) 4 x is in AUB By definition of union & (3) BY DR.T.P.LATCHOUMI
  • 19. Proofs by contradiction Example: Prove PUQ = QUP Proof: Initially assume, PUQ = QUP is not true i.e. PUQ ≠ QUP Now consider, x is in PUQ x is in P or x is in Q (By Definition of Union) x is in Q or x is in P (By Definition of Union) x is in QUP (By Definition of Union) This contradicts our assumption PUQ ≠ QUP Hence the assumption which we made initially is false. Therefore PUQ = QUP is proved. • In proof by contradiction, to prove the statement of the form ―if A true then B true‖, We start with statement A is not true by assumption and try to get the conclusion statement B. • When it impossible to reach B then we contradict our self and accept that A is true. BY DR.T.P.LATCHOUMI
  • 20. Proofs by counter Example 1: There is no pair of integers a and b such that a mod b = b mod a Proof: There are two possibilities. They are either a>b or a<b. If a=2 and b=3 then 2 mod 3 ≠ 3 mod 2 If a=3 and b=2 then 3 mod 2 ≠ 2 mod 3 If a=b=2 then 2 mod 2 = 2 mod 2, so the given statement is true only if a=b, so we have to change the statement slightly, Thus, a mod b = b mod a true only when a=b. We proved by counter example; this type of proof is called proof by counter example. Such proof is true only at specific conditions. • To prove certain statements, we need to check all the possible conditions in which that statement remains true. • There are some situations in which the statement cannot be true. BY DR.T.P.LATCHOUMI
  • 21. Example :2 Let n = 1, P(1) = 42(1) + 1 + 3(1) + 2= 43 + 33 = 64 + 27 = 91 = 13.t where t= 7 Let n = k, P(k) = 42(k) + 1 + 3(k) + 2= 42k + 1 + 3k + 2 = 13.t, true for some integer t Let n = k + 1, P(k + 1) = 42(k + 1) + 1 + 3(k + 1) + 2 = 42(k + 1) + 1 + 3(k + 1) + 2 = 42k + 2 + 1 + 3k + 1 + 2 = 42k + 1 + 2 + 3k + 2 + 1 = 42k + 1.42 + 3k + 2.31 = 42.42k + 1 + 3.3k + 2 = 42.42k + 1 + 423k+2 - 423k+2 + 3.3k + 2 {Add & Sub 423k+2} = 42(42k + 1 + 3k+2) + 3k+2 (-42+ 3) = 42(13.t)- 3k+2 (-42+ 3) {42k + 1 + 3k + 2 = 13.t} = 16(13.t)- 3k+2 (-13) = 13[16. t + 3k+2] = Multiple of 13 P(k + 1) is multiple of 13, Hence proved. Prove that every integer n ≥ 0, the number 42n + 1 + 3n + 2 is multiple of 13 by induction. BY DR.T.P.LATCHOUMI
  • 22. Formal Language  Language is a set of valid strings from some alphabet. The set may be empty, finite, or infinite.  L (M) is the language defined by machine M and L(G) is the language defined by context free grammar. The two notations for specifying formal languages are:  Grammar or regular expression (Generative approach).  Automaton (Recognition approach). BY DR.T.P.LATCHOUMI
  • 23. Alphabet An alphabet is a finite nonempty set of symbols. The symbol Σ is used to denote the alphabet. 1) Σ = {0, 1} 2) Σ = {a, b, c, …, z} 3) Σ = Set of ASII character BY DR.T.P.LATCHOUMI
  • 24. String A string is a finite sequence of symbols chosen from some alphabet. 1) Σ = {0,1} 11001 [ Empty string is denoted by ε] 2) Σ = {a, b, c}  aabbcbbbaa The total number of symbols in the string is called length of the string Example: 1) |0001|=4 2) |100|=3 BY DR.T.P.LATCHOUMI
  • 25. Empty string (ε) Empty string is the string with zero occurrence of symbol. This empty string is denoted by ε. Power of an alphabet BY DR.T.P.LATCHOUMI
  • 26. Power of an alphabet If Σ is an alphabet, then the set of all string of certain length forms an alphabet. 𝑘 to be the set of string of length k for each symbol in Σ. Example ∑ = {0, 1} 0 ={ε} 1 = {0, 1} 2 = {00, 01, 10, 11} 3 = {000, 001, 010, 011, 100, 101, 110, 111} + = 1 𝑈 2 𝑈 3 … ∑+ = 𝑖 ∗ = 0 𝑈 1 𝑈 2 … ∑∗ = 𝑖 Set of all strings over an alphabet is denoted by ∑∗ Set of all strings over an alphabet except null string is denoted by ∑+ BY DR.T.P.LATCHOUMI
  • 27. Concatenation of strings Let X and Y be the two strings over Σ = {a, b, c}. Then XY denotes the concatenation of X and Y. X = aabb Y = cccc XY = aabbcccc YX = ccccaabb BY DR.T.P.LATCHOUMI
  • 28. Language It is a collection of all strings. A set of strings of all which are chosen from ∑∗ is called a language, where ∑ is a particular alphabet set. BY DR.T.P.LATCHOUMI
  • 29. Substring, suffix and prefix Substring: For a string w, the string x is a substring of w if the string x appears contiguously in w. As such, for w =abcdef we have that bcd is a substring of w, but ace is not a substring of w. Suffix and prefix: A string x is a suffix of w if its a substring of w appearing in the end of w. Similarly, y is a prefix of w if y is a substring of w appearing in the beginning of w. As such, for w =abcdef we have that abc is a prefix of w, and def is a suffix of w. BY DR.T.P.LATCHOUMI
  • 30. Binary relations on strings 1. Prefix - u is a prefix of v if there is a w such that v = uw. ◦ Examples: ◦  is a prefix of 0 since 0 = 0 ◦ apple is a prefix of appleton since appleton = apple.ton 2. Suffix - u is a suffix of v if there is a w such that v = wu. ◦ Examples: ◦  is a suffix of 0 since 0 =0  ◦ ton is a suffix of appleton since= apple.ton BY DR.T.P.LATCHOUMI
  • 31. 3. Substring - u is a substring of v if there are x and y such that v = xuy. ◦ Examples: ◦ let is a substring of appleton since appleton = app.let.on ◦ 0 is a substring of 0 since 0 = epsilon.0.epsilon Observe that prefix and suffix are special cases of substring. BY DR.T.P.LATCHOUMI
  • 33. Types of finite automata (FA)  Deterministic Finite Automata (DFA)  Nondeterministic Finite Automata (NFA) BY DR.T.P.LATCHOUMI
  • 35. Transition table • A transition table is a conventional table represent of a function like in FA. • That takes two argument and return a value. • The rows of the table correspond to the state and column corresponds to the input symbols. • Row corresponds to states of automata and columns correspond to input symbols. • The entry for row correspond to state q and column corresponding to the input symbol ‗a‘ is the state δ(q,a). BY DR.T.P.LATCHOUMI
  • 36. Deterministic Finite Automata (DFA) ◦ Definition ◦ Finite automata are called Deterministic automata if there is only one path for its specified input from current state to next state. ◦ A DFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where − ◦ Q is a finite set of states. ◦ ∑ is a finite set of symbols called alphabet. ◦ δ is the transition function where δ: Q × ∑ → Q ◦ q0 is the initial state from where any input is processed (q0 ∈ Q). ◦ F is a set of final state/states of Q (F ⊆ Q). BY DR.T.P.LATCHOUMI
  • 37. Graphical Representation of a DFA A DFA is represented by digraphs called state diagram.  The vertices represent the states.  The arcs labelled with an input alphabet show the transitions.  The initial state is denoted by an empty single incoming arc.  The final state is indicated by double circles. BY DR.T.P.LATCHOUMI
  • 39. Example 2 Design FA which accepts only those strings which start with 0 and end with 1 over the input set Σ = {0, 1} BY DR.T.P.LATCHOUMI
  • 40. Example 3 Design FA & State Table which accepts odd number of 1‘s and any number of 0‘s. BY DR.T.P.LATCHOUMI
  • 41. Nondeterministic Finite Automata (NFA)  FA is also called as NFA when many paths are specified in code from the current state to next state.  In NDFA, for a particular input symbol, the machine can move to any combination of the states in the machine.  In other words, the exact state to which the machine moves cannot be determined.  Hence, it is called Non-deterministic Automaton.  As it has finite number of states, the machine is called Non-deterministic Finite Machine or Non-deterministic Finite Automaton. BY DR.T.P.LATCHOUMI
  • 42. Formal Definition of an NDFA An NDFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where − Q is a finite set of states. ∑ is a finite set of symbols called alphabets. δ is the transition function where δ: Q × ∑ → 2Q (Here the power set of Q (2Q) has been taken because in case of NDFA, from a state, transition can occur to any combination of Q states) q0 is the initial state from where any input is processed (q0 ∈ Q). F is a set of final state/states of Q (F ⊆ Q). BY DR.T.P.LATCHOUMI
  • 43. Graphical Representation of an NDFA: (same as DFA) An NDFA is represented by digraphs called state diagram.  The vertices represent the states.  The arcs labelled with an input alphabet show the transitions.  The initial state is denoted by an empty single incoming arc.  The final state is indicated by double circles. BY DR.T.P.LATCHOUMI
  • 44. Example 1 Let a non-deterministic finite automaton be Q = {a, b, c} ∑ = {0, 1} q0 = {a} F = {c} BY DR.T.P.LATCHOUMI
  • 45. Example 2 Construct NFA where L= {0101* + 0100 n ≥ 0} over the string ∑= {0,1} BY DR.T.P.LATCHOUMI
  • 46. Differences between DFA and NFA DFA NFA The transition from a state is to a single next state for each input symbol. Hence it is called deterministic. The transition from a state can be to multiple next states for each input symbol. Hence it is called non-deterministic. The transition mapping for DFA is Q x ∑ —> Q. The transition mapping for NFA is Q x (∑ U {ε}) —> 2Q Empty string transitions are not seen in DFA. NDFA permits empty string transitions. Backtracking is allowed in DFA In NDFA, backtracking is not always possible. Requires more space. Requires less space. A string is accepted by a DFA if it transits to a final state. A string is accepted by a NDFA, if at least one of all possible transitions ends in a final state. BY DR.T.P.LATCHOUMI
  • 47. FA with Epsilon transition The ε transition in NFA is given to move from one state to another without having any symbol from input. The language accepted by NFA with epsilon transition is represented 5 tuples (Q, ∑, δ, q0, F) Where, M is the NFA with ε moves. Q is the finite set of non-empty states. ∑ is the finite set of non-empty symbols. δ is the finite set of transitions. q0 is the initial state. F is the final state. BY DR.T.P.LATCHOUMI
  • 48. Epsilon closure (p) It is set of all state which are reachable from state p or epsilon transition such that 1) ε closure (p) ={p}, Where p € Q 2) If there exist ε -closure (p) ={q} and δ (q, ε) = r, then ε closure (p) = {q, r}. BY DR.T.P.LATCHOUMI
  • 49. Example 1 Find the ε closure for the following NFA with ε BY DR.T.P.LATCHOUMI
  • 50. Example 2 Construct NFA with ɛ which accepts a language consisting g the strings of any number of a‘s followed by any number of b‘s followed by any number of c‘s. Solution Here any number of a‘s or b‘s or c‘s means zero or more in number. That means there can be zero or more a‘s followed by zero or more b‘s followed by more c‘s. Hence the NFA with ɛ moves can be Transition Table: a B c ɛ q0 q0 Φ ϕ q1 q1 ϕ q1 ϕ q2 q2 ϕ Φ q2 ϕ We can parse the string aabbcc as follows.  (q0,aabbcc) -  (q0,abbcc)  (q0,bbcc)  (q1, bbcc)  (q1, bcc)  (q2, cc)  (q2, c)  (q2, ɛ ) Hence, we reached the accept state after scanning the complete input string. BY DR.T.P.LATCHOUMI
  • 51. Conversion from NFA with ε to NFA without ε 1) Find all the ε transition for each state from Q that will be called as ε closure {qi} Where {qi} is the element of Q 2) δ‘ transition can be obtained from δ transition. i.e., an ε closure of δ. 3) Step 2 is repeated for each input symbol and for each state of given NFA. 4) Using the resultant state, the transition table for equivalent NFA without ε can be built. BY DR.T.P.LATCHOUMI
  • 52. Example Convert the given NFA with ε transition to NFA without ε transition BY DR.T.P.LATCHOUMI
  • 55. Theorem Equivalence of NFA with ε without ε moves BY DR.T.P.LATCHOUMI
  • 56. Conversion of NFA to DFA BY DR.T.P.LATCHOUMI
  • 64. Theorem Equivalence of NFA and DFA BY DR.T.P.LATCHOUMI
  • 65. Method for conversion NFA with ε to DFA BY DR.T.P.LATCHOUMI