SlideShare a Scribd company logo
4
Most read
5
Most read
18
Most read
Finite Automata:Deterministic And Non-
deterministic Finite Automaton (DFA)
Presented by: Mohammad Ilyas Malik
M.Tech cse-3rd sem
17320363007
Automata
The term "Automata" is derived from the Greek word "αὐτόματα" which means
"self-acting". An automaton (Automata in plural) is an abstract self-propelled
computing device which follows a predetermined sequence of operations
automatically.
Finite Automata
An automaton with a finite number of states is called a Finite Automaton (FA) or Finite
State Machine (FSM).
A finite automata 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 the alphabet of the automaton.
• δ is the transition function.
• 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).
Deterministic Finite Automaton (DFA)
In DFA, for each input symbol, one can determine the state to which the machine
will move. Hence, it is called Deterministic Automaton. As it has a finite number
of states, the machine is called Deterministic Finite Machine or Deterministic
Finite Automaton.
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 the 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).
Graphical Representation of a DFA
A DFA is represented by digraphs called state diagram.
• The vertices/circles represent the states.
• The arcs labeled 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.
Example
Let a deterministic finite automaton be
• Q = {a, b, c},
• Σ = {0, 1},
• q0={a},
• F={c}, and
• Transition function δ as shown by the following table:
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Non-deterministic Finite Automaton
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 Nondeterministic Finite Automaton.
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 the alphabets.
• δ is the transition function where δ: Q × Σ → 2 𝑄
(Here the power set of Q (2 𝑄) 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).
Graphical Representation of an NDFA
Graphical Representation of an NDFA: (same as DFA)
An NDFA is represented by digraphs called state diagram.
• The vertices/Circles represent the states.
• The arcs labeled 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.
Example
Let a non-deterministic finite automaton be
• Q = {a, b, c}
• Σ = {0, 1}
• q0 = {a}
• F={c} and
• Transition function δ as shown by the following table:
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
DFA vs NDFA
DFA NDFA
The transition from a state is to a single
particular 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.
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.
NDFA to DFA Conversion
Problem Statement
Let X = (Qx, Σ, δx, q0, Fx) be an NDFA which accepts the language L(X). We have
to design an equivalent DFA Y = (Qy, Σ, δy, q0, Fy) such that L(Y) = L(X). The
following procedure converts the NDFA to its equivalent DFA:
Algorithm
Input: An NDFA
Output: An equivalent DFA
Step 1 Create state table from the given NDFA.
Step 2 Create a blank state table under possible input alphabets for the equivalent DFA.
Step 3 Mark the start state of the DFA by q0 (Same as the NDFA).
Step 4 Find out the combination of States {Q0, Q1,... , Qn} for each possible input alphabet.
Step 5 Each time we generate a new DFA state under the input alphabet columns, we have to apply step 4 again,
otherwise go to step 6.
Step 6 The states which contain any of the final states of the NDFA are the final states of the equivalent DFA.
Example
Let us consider the NDFA shown in the figure below.
Using the above algorithm, we find its equivalent DFA. The state table of the DFA
is shown in below.
The state diagram of the DFA is as follows:
Language Decidability
A language is called Decidable or Recursive if there is a Turing machine which
accepts and halts on every input string w. Every decidable language is Turing-
Acceptable.
A decision problem P is decidable if the language L of all yes instances to P is
decidable. For a decidable language, for each input string, the TM halts either at
the accept or the reject state as depicted in the following diagram:
Example 1
Find out whether the following problem is decidable or not:
Is a number ‘m’ prime?
Solution
Prime numbers = {2, 3, 5, 7, 11, 13, …………..}
Divide the number ‘m’ by all the numbers between ‘2’ and ‘√m’ starting from ‘2’.
If any of these numbers produce a remainder zero, then it goes to the “Rejected
state”, otherwise it goes to the “Accepted state”. So, here the answer could be
made by ‘Yes’ or ‘No’.
Hence, it is a decidable problem.
Example 2
Given a regular language L and string w, how can we check if w∈ L?
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)

More Related Content

What's hot (20)

PDF
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
PPTX
Regular expressions
Ratnakar Mikkili
 
PPTX
Regular expressions
Shiraz316
 
PDF
I. AO* SEARCH ALGORITHM
vikas dhakane
 
PPT
Turing Machine
Rajendran
 
PPTX
closure properties of regular language.pptx
Thirumoorthy64
 
PPTX
Bfs and Dfs
Masud Parvaze
 
PDF
NFA to DFA
Animesh Chaturvedi
 
PPTX
language , grammar and automata
ElakkiyaS11
 
PDF
Lecture: Automata
Marina Santini
 
PPTX
NFA & DFA
Akhil Kaushik
 
PPTX
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Ashish Duggal
 
PPT
Type Checking(Compiler Design) #ShareThisIfYouLike
United International University
 
PPTX
Context free grammar
Mohammad Ilyas Malik
 
PPTX
push down automata
Christopher Chizoba
 
PPTX
Dfs presentation
Alizay Khan
 
PPTX
CONTEXT FREE GRAMMAR
Zahid Parvez
 
PPTX
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
PPTX
Theory of automata and formal language
Rabia Khalid
 
PPTX
Turing machine-TOC
Maulik Togadiya
 
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
Regular expressions
Ratnakar Mikkili
 
Regular expressions
Shiraz316
 
I. AO* SEARCH ALGORITHM
vikas dhakane
 
Turing Machine
Rajendran
 
closure properties of regular language.pptx
Thirumoorthy64
 
Bfs and Dfs
Masud Parvaze
 
NFA to DFA
Animesh Chaturvedi
 
language , grammar and automata
ElakkiyaS11
 
Lecture: Automata
Marina Santini
 
NFA & DFA
Akhil Kaushik
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Ashish Duggal
 
Type Checking(Compiler Design) #ShareThisIfYouLike
United International University
 
Context free grammar
Mohammad Ilyas Malik
 
push down automata
Christopher Chizoba
 
Dfs presentation
Alizay Khan
 
CONTEXT FREE GRAMMAR
Zahid Parvez
 
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
Theory of automata and formal language
Rabia Khalid
 
Turing machine-TOC
Maulik Togadiya
 

Similar to Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA) (20)

PDF
deterministicfiniteautomatondfa-181008145215 (1).pdf
AmayJaiswal4
 
PDF
Automata theory
Pardeep Vats
 
PPTX
Finite Automata fgyft rtrt rr uuy y.pptx
AsadBaig49
 
PPTX
NFA and DFA
Rup Chowdhury
 
PDF
5. NFA & DFA.pdf
TANZINTANZINA
 
PPTX
1.3.1 deterministic finite automaton
Sampath Kumar S
 
PPTX
Finite Automata in compiler design
Riazul Islam
 
PDF
Finite Automata
A. S. M. Shafi
 
PPTX
Formal language and automata theoryLAT Class notes.pptx
SrinivasRedyySarviga
 
PPTX
INTRODUTION Formal Language and Automatic Theory.pptx
SUNEEL37
 
PPTX
TCS MUBAI UNIVERSITY ATHARVA COLLEGE OF ENGINEERING.pptx
userqwerty2612
 
PDF
TCS GOLDEN NOTES THEORY OF COMPUTATION .pdf
userqwerty2612
 
PPTX
1.3.2 non deterministic finite automaton
Sampath Kumar S
 
PDF
Theory of computation and automata
Prof. Dr. K. Adisesha
 
PPTX
symbolic_automata or Advanced Programming Practice.pptx
sudharsr
 
PPTX
03-FiniteAutomata.pptx
ssuser47f7f2
 
PPTX
CS 5th.pptx
MadniFareed1
 
PPTX
Finite automata
ManishTadhiyal
 
PDF
Deterministic Finite Automata (DFA) Lecture
HaroldCostales1
 
PDF
Finite automata
Dr. Abhineet Anand
 
deterministicfiniteautomatondfa-181008145215 (1).pdf
AmayJaiswal4
 
Automata theory
Pardeep Vats
 
Finite Automata fgyft rtrt rr uuy y.pptx
AsadBaig49
 
NFA and DFA
Rup Chowdhury
 
5. NFA & DFA.pdf
TANZINTANZINA
 
1.3.1 deterministic finite automaton
Sampath Kumar S
 
Finite Automata in compiler design
Riazul Islam
 
Finite Automata
A. S. M. Shafi
 
Formal language and automata theoryLAT Class notes.pptx
SrinivasRedyySarviga
 
INTRODUTION Formal Language and Automatic Theory.pptx
SUNEEL37
 
TCS MUBAI UNIVERSITY ATHARVA COLLEGE OF ENGINEERING.pptx
userqwerty2612
 
TCS GOLDEN NOTES THEORY OF COMPUTATION .pdf
userqwerty2612
 
1.3.2 non deterministic finite automaton
Sampath Kumar S
 
Theory of computation and automata
Prof. Dr. K. Adisesha
 
symbolic_automata or Advanced Programming Practice.pptx
sudharsr
 
03-FiniteAutomata.pptx
ssuser47f7f2
 
CS 5th.pptx
MadniFareed1
 
Finite automata
ManishTadhiyal
 
Deterministic Finite Automata (DFA) Lecture
HaroldCostales1
 
Finite automata
Dr. Abhineet Anand
 
Ad

More from Mohammad Ilyas Malik (8)

PDF
M.Sc_.-IV_ComputerGraphics_PolygonClipping_Bhupendra_K_Pandya.pdf
Mohammad Ilyas Malik
 
PPTX
NLP, Expert system and pattern recognition
Mohammad Ilyas Malik
 
PPTX
basic concept of Cloud computing and its architecture
Mohammad Ilyas Malik
 
PPTX
Multimedia communication networks
Mohammad Ilyas Malik
 
PPTX
Virtualization in cloud computing
Mohammad Ilyas Malik
 
DOCX
Seminar report on microsoft azure
Mohammad Ilyas Malik
 
PPTX
Intoduction of cloud computing
Mohammad Ilyas Malik
 
PPTX
Microsoft azure
Mohammad Ilyas Malik
 
M.Sc_.-IV_ComputerGraphics_PolygonClipping_Bhupendra_K_Pandya.pdf
Mohammad Ilyas Malik
 
NLP, Expert system and pattern recognition
Mohammad Ilyas Malik
 
basic concept of Cloud computing and its architecture
Mohammad Ilyas Malik
 
Multimedia communication networks
Mohammad Ilyas Malik
 
Virtualization in cloud computing
Mohammad Ilyas Malik
 
Seminar report on microsoft azure
Mohammad Ilyas Malik
 
Intoduction of cloud computing
Mohammad Ilyas Malik
 
Microsoft azure
Mohammad Ilyas Malik
 
Ad

Recently uploaded (20)

PPTX
Presentation 2.pptx AI-powered home security systems Secure-by-design IoT fr...
SoundaryaBC2
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PDF
smart lot access control system with eye
rasabzahra
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PPTX
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
Amity University, Patna
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Presentation 2.pptx AI-powered home security systems Secure-by-design IoT fr...
SoundaryaBC2
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
MRRS Strength and Durability of Concrete
CivilMythili
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
smart lot access control system with eye
rasabzahra
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
Amity University, Patna
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 

Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)

  • 1. Finite Automata:Deterministic And Non- deterministic Finite Automaton (DFA) Presented by: Mohammad Ilyas Malik M.Tech cse-3rd sem 17320363007
  • 2. Automata The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled computing device which follows a predetermined sequence of operations automatically.
  • 3. Finite Automata An automaton with a finite number of states is called a Finite Automaton (FA) or Finite State Machine (FSM). A finite automata 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 the alphabet of the automaton. • δ is the transition function. • 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).
  • 4. Deterministic Finite Automaton (DFA) In DFA, for each input symbol, one can determine the state to which the machine will move. Hence, it is called Deterministic Automaton. As it has a finite number of states, the machine is called Deterministic Finite Machine or Deterministic Finite Automaton.
  • 5. 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 the 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).
  • 6. Graphical Representation of a DFA A DFA is represented by digraphs called state diagram. • The vertices/circles represent the states. • The arcs labeled 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.
  • 7. Example Let a deterministic finite automaton be • Q = {a, b, c}, • Σ = {0, 1}, • q0={a}, • F={c}, and • Transition function δ as shown by the following table:
  • 9. Non-deterministic Finite Automaton 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 Nondeterministic Finite Automaton.
  • 10. 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 the alphabets. • δ is the transition function where δ: Q × Σ → 2 𝑄 (Here the power set of Q (2 𝑄) 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).
  • 11. Graphical Representation of an NDFA Graphical Representation of an NDFA: (same as DFA) An NDFA is represented by digraphs called state diagram. • The vertices/Circles represent the states. • The arcs labeled 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.
  • 12. Example Let a non-deterministic finite automaton be • Q = {a, b, c} • Σ = {0, 1} • q0 = {a} • F={c} and • Transition function δ as shown by the following table:
  • 14. DFA vs NDFA DFA NDFA The transition from a state is to a single particular 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. 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.
  • 15. NDFA to DFA Conversion Problem Statement Let X = (Qx, Σ, δx, q0, Fx) be an NDFA which accepts the language L(X). We have to design an equivalent DFA Y = (Qy, Σ, δy, q0, Fy) such that L(Y) = L(X). The following procedure converts the NDFA to its equivalent DFA:
  • 16. Algorithm Input: An NDFA Output: An equivalent DFA Step 1 Create state table from the given NDFA. Step 2 Create a blank state table under possible input alphabets for the equivalent DFA. Step 3 Mark the start state of the DFA by q0 (Same as the NDFA). Step 4 Find out the combination of States {Q0, Q1,... , Qn} for each possible input alphabet. Step 5 Each time we generate a new DFA state under the input alphabet columns, we have to apply step 4 again, otherwise go to step 6. Step 6 The states which contain any of the final states of the NDFA are the final states of the equivalent DFA.
  • 17. Example Let us consider the NDFA shown in the figure below.
  • 18. Using the above algorithm, we find its equivalent DFA. The state table of the DFA is shown in below.
  • 19. The state diagram of the DFA is as follows:
  • 20. Language Decidability A language is called Decidable or Recursive if there is a Turing machine which accepts and halts on every input string w. Every decidable language is Turing- Acceptable.
  • 21. A decision problem P is decidable if the language L of all yes instances to P is decidable. For a decidable language, for each input string, the TM halts either at the accept or the reject state as depicted in the following diagram:
  • 22. Example 1 Find out whether the following problem is decidable or not: Is a number ‘m’ prime? Solution Prime numbers = {2, 3, 5, 7, 11, 13, …………..} Divide the number ‘m’ by all the numbers between ‘2’ and ‘√m’ starting from ‘2’. If any of these numbers produce a remainder zero, then it goes to the “Rejected state”, otherwise it goes to the “Accepted state”. So, here the answer could be made by ‘Yes’ or ‘No’. Hence, it is a decidable problem.
  • 23. Example 2 Given a regular language L and string w, how can we check if w∈ L?