Slide 1
Finite Automata
Slide 2
Finite Automata
• A Finite automaton (FA) is a simple idealized machine used to
recognize patterns within input taken from some character (or
alphabet).
• The job of an FA is to accept or reject an input depending on
whether the pattern defined by the FA occurs in the input.
• FA consists of a finite set of transitions from state to state that
occur on input symbols chosen from alphabet ∑
Slide 3
Finite Automata (FA)
CONTROL
UNIT
INPUT TAPE
TAPE
HEAD
Finite set of states
Move to the right one cell
at a time
Store input of the DFA
Can be of any length
Start state
Final state(s)
is in exactly one
state at a time
Slide 4
Finite Automata Model
•Finite automata can be represented by input tape, read
only head and finite control.
•Input tape: It is a linear tape having some number of
cells. Each input symbol is placed in each cell.
•Finite control: The finite control decides the next state on
receiving particular input from input tape.
•The tape reader reads the cells one by one from left to
right, and at a time only one input symbol is read.
Finite Automata
• Finite automata are used to
recognize patterns.
• It takes the string of symbol as input
and changes its state accordingly.
• When the desired symbol is found,
then the transition occurs.
• At the time of transition, the
automata can either move to the
next state or stay in the same state.
• Finite automata have two states,
Accept state or Reject state.
• When the input string is processed
successfully, and the automata
reached its final state, then it will
accept.
a b a
b b
a
0
1
2
n
Input tape
Control unit
Tape head
Slide 6
What does FA do?
•Read an input string from tape
•Determine if the input string is in a language
•Determine if the answer for the problem is
“YES” or “NO” for the given input on the tape
Slide 7
How does an FA work?
•At the beginning,
– FA is in the start state (initial state)
– its tape head points at the first cell
• For each move, FA
– reads the symbol under its tape head
– changes its state (according to the transition function) to
the next state determined by the symbol read from the tape
and its current state
– move its tape head to the right one cell
Slide 8
When does an FA stop working?
•When it reads all symbols on the tape
•Then, it gives an answer if the input is in the
specific language:
–Answer “YES” if its last state is a final state
–Answer “NO” if its last state is not a final state
Slide 9
Formal Definition
• A finite automate is a collection of 5 tuple (Q, ∑, δ , q0 , F),
Where:
Q: finite set of states
∑: finite set of the input symbol
q0ϵ Q: initial state
F ⊆ Q : Set of final states
δ : Transition function which maps Q X ∑ into Q
δ : Q X ∑  Q
Finite automata
• Finite automata can be represented by transition diagram
(directed graph).
• The steps to construct the transition diagrams
– The vertices in the transition diagram are the states of the finite automata
– The edges represents the transitions.
• If there is a transition from state q0 to q1 on an input
symbol “1” then draw an edge from q0 to q1 labelled “1”.
• The initial state will be q0
• The final states will be denoted by double circles
q0 q1
0 1 0
1
Slide 11
Types of Finite Automata
•There are two types of finite automata:
–Deterministic Finite Automata (DFA)
–Non deterministic Finite Automata (NFA)
Slide 12
DFA (Deterministic Finite Automata)
• The finite automata is called DFA if there is only one path for a
specific input from current state to next state.
• A finite automate can be defined as a 5 tuple (Q, ∑, δ , q0 , F),
Where:
Q: non empty finite set of states
∑: non empty finite set of symbols
q0ϵ Q: initial state
F ⊆ Q : finite set of final states
δ : Transition function, which maps Q X ∑ into Q
δ : Q X ∑  Q
Slide 13
q2
q0 q1
a a
a/b
b
Start
M= (Q, ∑, δ, q0, F)
Tuple notation for the above figure
M= {{ q0, q1, q2}, { a, b}, δ ,q0 , q2}
δ : transition function, which maps Q x ∑  Q
Slide 14
• Let M = (Q, ∑ , δ , q0, F)
• Where Q = {q0, q1, q2} ∑ = {0,1} F= {q0}
• The transition function δ is defined as
State
Input
0 1
q0 q0 q1
q1 q0 q1
q2 q0 q2
q0
q2
q1
0
0
1
1
Start
0
1
Slide 16
How an FA works
s f
0 1 0
1
Input: 001101
Input: 01001
0 0 1 1 0 1
0 1
0
0
1
ACCEPT
REJECT
Slide 17
• Deterministic refers to the uniqueness of the computation.
• In DFA, there is only one path for specific input from the
current state to the next state.
• DFA does not accept the null move i.e., DFA cannot change
state without any input character.
• DFA can contain multiple final states.
Slide 18
Acceptance of Language
• A language acceptance is defined by if a string w is accepted by
the machine M i.e if it is reaching the final state F by taking the
string w.
• Not accepted if it is not reached the final state
• Eg., L = {φ} => (no string)
• L = { ɛ } =>
• DFA to accept “a” =>
• No. of state =|min string| +1 (states depends on length of
string)
q0
q0
q0
q0
q0
q1
a
Slide 19
• DFA to accept zero or more ‘a’
L= {ϵ,a,aa,aaa, ….}
q0
q0
a
Slide 20
Slide 21
Thompson's construction
RE-NFA
Slide 22
Basis: OP(r) = 0
Then r is either Ø, ε, or a, for some symbol a in Σ
For Ø:
For ε:
For a:
qf
q0
qf
qf
q0
a
Slide 23
Conversion of RE into NFA
Slide 24
Slide 25
Slide 26
Slide 27
• Example:
r = 0(0+1)*
r = r1r2
r1 = 0
r2 = (0+1)*
r2 = r3*
r3 = 0+1
r3 = r4 + r5
r4 = 0 r5 = 1
q0
1
q1
Slide 28
• Example:
r = 0(0+1)*
r = r1r2
r1 = 0
r2 = (0+1)*
r2 = r3*
r3 = 0+1
r3 = r4 + r5
r4 = 0
r5 = 1
q0
1
q2
0
q1
q3
Slide 29
• Example:
r = 0(0+1)*
r = r1r2
r1 = 0
r2 = (0+1)*
r2 = r3*
r3 = 0+1
r3 = r4 + r5
r4 = 0
r5 = 1
q4
q0 q1
1
q2 q3
0
ε
ε ε
ε
q5
Slide 30
• Example:
r = 0(0+1)*
r = r1r2
r1 = 0
r2 = (0+1)*
r2 = r3*
r3 = 0+1
r3 = r4 + r5
r4 = 0
r5 = 1
q6 q5
q4
q0 q1
1
q2 q3
0
ε
ε ε
ε
ε
qf
ε
ε ε
Slide 31
• Example:
r = 0(0+1)*
r = r1r2
r1 = 0
r2 = (0+1)*
r2 = r3*
r3 = 0+1
r3 = r4 + r5
r4 = 0
r5 = 1
q8 q9
q6 q5
q4
q0 q1
1
q2 q3
0
ε
ε ε
ε
ε
qf
ε
ε ε
0
Slide 32
• Example:
r = 0(0+1)*
r = r1r2
r1 = 0
r2 = (0+1)*
r2 = r3*
r3 = 0+1
r3 = r4 + r5
r4 = 0
r5 = 1
q8 q9
q6 q5
q4
q0 q1
1
q2 q3
0
ε
ε ε
ε
ε
qf
ε
ε ε
0
ε
Slide 33
Slide 34
(ε|a*b)
Slide 35
Slide 36
Slide 37
Slide 38
Draw NFA for the Regular Expression
• a(a+b)*ab
Slide 39
a(a+b)*ab
Slide 40
Draw NFA for the Regular Expression
• a + b + ab
Slide 41
Draw NFA for the Regular Expression
• letter (letter+digit)*
Slide 42
letter (letter+digit)*
Slide 43
(0+1)*1(0+1)
Slide 44
a + b + ab

More Related Content

PPTX
TOC Introduction
PPTX
Formal language and automata theoryLAT Class notes.pptx
PPTX
FiniteAutomata_anim.pptx
PPTX
FiniteAutomata_anim.pptx
PPTX
symbolic_automata or Advanced Programming Practice.pptx
PPTX
chapter 1 automata and complexity theory lecture note.pptx
PPTX
AUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptx
TOC Introduction
Formal language and automata theoryLAT Class notes.pptx
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
symbolic_automata or Advanced Programming Practice.pptx
chapter 1 automata and complexity theory lecture note.pptx
AUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptx

Similar to 1. finite_automata_new.ppt (20)

PPTX
Chapter-twoChapter-three automata and complexity theory .pptx
PDF
Ch2 finite automaton
PDF
deterministicfiniteautomatondfa-181008145215 (1).pdf
PPTX
Week 3 - to FiniteAutomata DrJunaid.pptx
PPTX
Theory of computation Unit 1 Lecute 2.pptx
PPTX
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
PDF
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
PDF
Theory of computation and automata
PDF
Theory of computation and automata
PPTX
FiniteAutomata_anim.pptx
PPTX
INTRODUTION Formal Language and Automatic Theory.pptx
PPTX
Unit 2 Pumping lemma Unit 2 Pumping lemma
PPTX
closure properties of regular language.pptx
PPTX
NFA Converted to DFA , Minimization of DFA , Transition Diagram
PDF
Formal Languages and Automata Theory Unit 1
PPT
Lecture 1 CSE 322 LPU By 5th SEM .ppt Good
PPT
CSE-322 lecture1 notes
PDF
Nondeterministic Finite Automata
PDF
Finite Automata
PPTX
TCS MUBAI UNIVERSITY ATHARVA COLLEGE OF ENGINEERING.pptx
Chapter-twoChapter-three automata and complexity theory .pptx
Ch2 finite automaton
deterministicfiniteautomatondfa-181008145215 (1).pdf
Week 3 - to FiniteAutomata DrJunaid.pptx
Theory of computation Unit 1 Lecute 2.pptx
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
Theory of computation and automata
Theory of computation and automata
FiniteAutomata_anim.pptx
INTRODUTION Formal Language and Automatic Theory.pptx
Unit 2 Pumping lemma Unit 2 Pumping lemma
closure properties of regular language.pptx
NFA Converted to DFA , Minimization of DFA , Transition Diagram
Formal Languages and Automata Theory Unit 1
Lecture 1 CSE 322 LPU By 5th SEM .ppt Good
CSE-322 lecture1 notes
Nondeterministic Finite Automata
Finite Automata
TCS MUBAI UNIVERSITY ATHARVA COLLEGE OF ENGINEERING.pptx
Ad

Recently uploaded (20)

PPTX
Phase1_final PPTuwhefoegfohwfoiehfoegg.pptx
PPTX
Lesson-01intheselfoflifeofthekennyrogersoftheunderstandoftheunderstanded
PPTX
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
PDF
Data Engineering Interview Questions & Answers Data Modeling (3NF, Star, Vaul...
PDF
Microsoft 365 products and services descrption
PPT
Predictive modeling basics in data cleaning process
PPT
statistic analysis for study - data collection
PDF
Navigating the Thai Supplements Landscape.pdf
DOCX
Factor Analysis Word Document Presentation
PPTX
IMPACT OF LANDSLIDE.....................
PPTX
SAP 2 completion done . PRESENTATION.pptx
PPTX
Topic 5 Presentation 5 Lesson 5 Corporate Fin
PPTX
Business_Capability_Map_Collection__pptx
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
PDF
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
PDF
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
PDF
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
PPTX
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
PPT
DU, AIS, Big Data and Data Analytics.ppt
PDF
Introduction to Data Science and Data Analysis
Phase1_final PPTuwhefoegfohwfoiehfoegg.pptx
Lesson-01intheselfoflifeofthekennyrogersoftheunderstandoftheunderstanded
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
Data Engineering Interview Questions & Answers Data Modeling (3NF, Star, Vaul...
Microsoft 365 products and services descrption
Predictive modeling basics in data cleaning process
statistic analysis for study - data collection
Navigating the Thai Supplements Landscape.pdf
Factor Analysis Word Document Presentation
IMPACT OF LANDSLIDE.....................
SAP 2 completion done . PRESENTATION.pptx
Topic 5 Presentation 5 Lesson 5 Corporate Fin
Business_Capability_Map_Collection__pptx
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
DU, AIS, Big Data and Data Analytics.ppt
Introduction to Data Science and Data Analysis
Ad

1. finite_automata_new.ppt

  • 2. Slide 2 Finite Automata • A Finite automaton (FA) is a simple idealized machine used to recognize patterns within input taken from some character (or alphabet). • The job of an FA is to accept or reject an input depending on whether the pattern defined by the FA occurs in the input. • FA consists of a finite set of transitions from state to state that occur on input symbols chosen from alphabet ∑
  • 3. Slide 3 Finite Automata (FA) CONTROL UNIT INPUT TAPE TAPE HEAD Finite set of states Move to the right one cell at a time Store input of the DFA Can be of any length Start state Final state(s) is in exactly one state at a time
  • 4. Slide 4 Finite Automata Model •Finite automata can be represented by input tape, read only head and finite control. •Input tape: It is a linear tape having some number of cells. Each input symbol is placed in each cell. •Finite control: The finite control decides the next state on receiving particular input from input tape. •The tape reader reads the cells one by one from left to right, and at a time only one input symbol is read.
  • 5. Finite Automata • Finite automata are used to recognize patterns. • It takes the string of symbol as input and changes its state accordingly. • When the desired symbol is found, then the transition occurs. • At the time of transition, the automata can either move to the next state or stay in the same state. • Finite automata have two states, Accept state or Reject state. • When the input string is processed successfully, and the automata reached its final state, then it will accept. a b a b b a 0 1 2 n Input tape Control unit Tape head
  • 6. Slide 6 What does FA do? •Read an input string from tape •Determine if the input string is in a language •Determine if the answer for the problem is “YES” or “NO” for the given input on the tape
  • 7. Slide 7 How does an FA work? •At the beginning, – FA is in the start state (initial state) – its tape head points at the first cell • For each move, FA – reads the symbol under its tape head – changes its state (according to the transition function) to the next state determined by the symbol read from the tape and its current state – move its tape head to the right one cell
  • 8. Slide 8 When does an FA stop working? •When it reads all symbols on the tape •Then, it gives an answer if the input is in the specific language: –Answer “YES” if its last state is a final state –Answer “NO” if its last state is not a final state
  • 9. Slide 9 Formal Definition • A finite automate is a collection of 5 tuple (Q, ∑, δ , q0 , F), Where: Q: finite set of states ∑: finite set of the input symbol q0ϵ Q: initial state F ⊆ Q : Set of final states δ : Transition function which maps Q X ∑ into Q δ : Q X ∑  Q
  • 10. Finite automata • Finite automata can be represented by transition diagram (directed graph). • The steps to construct the transition diagrams – The vertices in the transition diagram are the states of the finite automata – The edges represents the transitions. • If there is a transition from state q0 to q1 on an input symbol “1” then draw an edge from q0 to q1 labelled “1”. • The initial state will be q0 • The final states will be denoted by double circles q0 q1 0 1 0 1
  • 11. Slide 11 Types of Finite Automata •There are two types of finite automata: –Deterministic Finite Automata (DFA) –Non deterministic Finite Automata (NFA)
  • 12. Slide 12 DFA (Deterministic Finite Automata) • The finite automata is called DFA if there is only one path for a specific input from current state to next state. • A finite automate can be defined as a 5 tuple (Q, ∑, δ , q0 , F), Where: Q: non empty finite set of states ∑: non empty finite set of symbols q0ϵ Q: initial state F ⊆ Q : finite set of final states δ : Transition function, which maps Q X ∑ into Q δ : Q X ∑  Q
  • 13. Slide 13 q2 q0 q1 a a a/b b Start M= (Q, ∑, δ, q0, F) Tuple notation for the above figure M= {{ q0, q1, q2}, { a, b}, δ ,q0 , q2} δ : transition function, which maps Q x ∑  Q
  • 14. Slide 14 • Let M = (Q, ∑ , δ , q0, F) • Where Q = {q0, q1, q2} ∑ = {0,1} F= {q0} • The transition function δ is defined as State Input 0 1 q0 q0 q1 q1 q0 q1 q2 q0 q2 q0 q2 q1 0 0 1 1 Start 0 1
  • 15. Slide 16 How an FA works s f 0 1 0 1 Input: 001101 Input: 01001 0 0 1 1 0 1 0 1 0 0 1 ACCEPT REJECT
  • 16. Slide 17 • Deterministic refers to the uniqueness of the computation. • In DFA, there is only one path for specific input from the current state to the next state. • DFA does not accept the null move i.e., DFA cannot change state without any input character. • DFA can contain multiple final states.
  • 17. Slide 18 Acceptance of Language • A language acceptance is defined by if a string w is accepted by the machine M i.e if it is reaching the final state F by taking the string w. • Not accepted if it is not reached the final state • Eg., L = {φ} => (no string) • L = { ɛ } => • DFA to accept “a” => • No. of state =|min string| +1 (states depends on length of string) q0 q0 q0 q0 q0 q1 a
  • 18. Slide 19 • DFA to accept zero or more ‘a’ L= {ϵ,a,aa,aaa, ….} q0 q0 a
  • 21. Slide 22 Basis: OP(r) = 0 Then r is either Ø, ε, or a, for some symbol a in Σ For Ø: For ε: For a: qf q0 qf qf q0 a
  • 22. Slide 23 Conversion of RE into NFA
  • 26. Slide 27 • Example: r = 0(0+1)* r = r1r2 r1 = 0 r2 = (0+1)* r2 = r3* r3 = 0+1 r3 = r4 + r5 r4 = 0 r5 = 1 q0 1 q1
  • 27. Slide 28 • Example: r = 0(0+1)* r = r1r2 r1 = 0 r2 = (0+1)* r2 = r3* r3 = 0+1 r3 = r4 + r5 r4 = 0 r5 = 1 q0 1 q2 0 q1 q3
  • 28. Slide 29 • Example: r = 0(0+1)* r = r1r2 r1 = 0 r2 = (0+1)* r2 = r3* r3 = 0+1 r3 = r4 + r5 r4 = 0 r5 = 1 q4 q0 q1 1 q2 q3 0 ε ε ε ε q5
  • 29. Slide 30 • Example: r = 0(0+1)* r = r1r2 r1 = 0 r2 = (0+1)* r2 = r3* r3 = 0+1 r3 = r4 + r5 r4 = 0 r5 = 1 q6 q5 q4 q0 q1 1 q2 q3 0 ε ε ε ε ε qf ε ε ε
  • 30. Slide 31 • Example: r = 0(0+1)* r = r1r2 r1 = 0 r2 = (0+1)* r2 = r3* r3 = 0+1 r3 = r4 + r5 r4 = 0 r5 = 1 q8 q9 q6 q5 q4 q0 q1 1 q2 q3 0 ε ε ε ε ε qf ε ε ε 0
  • 31. Slide 32 • Example: r = 0(0+1)* r = r1r2 r1 = 0 r2 = (0+1)* r2 = r3* r3 = 0+1 r3 = r4 + r5 r4 = 0 r5 = 1 q8 q9 q6 q5 q4 q0 q1 1 q2 q3 0 ε ε ε ε ε qf ε ε ε 0 ε
  • 37. Slide 38 Draw NFA for the Regular Expression • a(a+b)*ab
  • 39. Slide 40 Draw NFA for the Regular Expression • a + b + ab
  • 40. Slide 41 Draw NFA for the Regular Expression • letter (letter+digit)*
  • 43. Slide 44 a + b + ab