SlideShare a Scribd company logo
Presentation Topic
NFA
Non Deterministic Finite Automata
Definition:
NFA (Non Deterministic Finite Automaton)
In NFA the exact state to which the machine
moves cannot be determined it is called
NFA.
As it has finite number of states the
machine is called Non Deterministic Finite
Machine or Non Deterministic Finite
Automaton.
NFA is represented by 5 tuples:
(Q , ∑ , ∂ , qo , F)
Q = finite set of states
∑ = finite set of input symbols
∂ = Transition Function
qo = initial state
F = final state
NFA example:
if ∑ = {0,1}
input string 011
NFA:
P q
1
0,1
+
Transition Table:
P q
1
0,1
Input 0 1
p {p} {p,q}
q {^} {^}
+
Transition Function:
input string 011
∂ (p,0)=p
∂ (p,1)=(p,q)
∂(q,1)=
^
P q
1
0,1
+
Before Jumping to NFA lets have an Eye on
following Things.
Alphabets
Rules
Descriptive
Method
Regular
Expression
Language
F.A
String
In Automata we deal with Language:
Language is the Combination of:
Alphabets
∑
Rules
Example:
if ∑ = {a , b} => (Alphabets)
All Strings which end with a.(RULE)
String: is a finite sequence of symbols
taken from Alphabets.
Difference between String and words.
Length of a String:
length of a string is always positive.
Example:
String = abba (length = 4)
String = abaaaba (length = 7)
Concatenation of String:
when two or more strings combine to form a new
string.
If x=ab
y=c
Reverse of String:
if w= abc
then find reverse of string
if q= stwm
find reverse of string?
If ∑ = {aa, bab} find the length and reverse
of the following string.
W = babaabab
Tocanisation :
(bab)(aa)(bab)
Reverse of the String:
Palindrome
Ways to Represent Language in Automata:
Descriptive
Method
R.E
Regular Expression
F.A
N.F.A D.F.A
1:Descriptive Method
if ∑ = {a,b}
all strings ending with a
{a, ba, aa, aaa, aba, …} => infinite
{a, aba, ba, aaa, aa …} => Wrong
order of string must be ascending.
Descriptive Method Examples:
1: if ∑ = {0,1}
write all string which contain 00.
2: if ∑ = {a,b}
write all string which starts with a.
3:if ∑ = {0,1}
write all possible strings of even length.
4:if ∑ = {a,b}
write all possible strings that contain ab.
{ab, aab, abb, bab…}
Ways to Represent Language in Automata:
Descriptive
Method
R.E
Regular Expression
F.A
N.F.A D.F.A
Regular Expression:
why we use Regular Expression
Because descriptive method se language ke
saray words nai likhay ja sakte.
Example:
if ∑ = {a,b}
all strings which starts with a.
D.M={a, aa, ab, aaa, aab, aba, abb…}
R.E=?
Regular Expression Language:
Single letter
Language
Finite Language Infinite Language
Kleene Closure Positive Closure
1: Single letter Language:
The language in which there is only one
Alphabet.
Example
if ∑ = {a} R.E = a
if ∑ = {b} R.E = b
2: Finite Language: The language whose string
is countable.
Example: if ∑ = {a,b}
all string of length two
{aa, bb, ab, ba}
R.E= ?
Infinite Language: The Language whose
string is uncountable.
Two types of properties
1: Kleene Closure: *, ^, e.g: if ∑={a} Make
All strings. R.E=?
2: Positive Closure: +, do not contain ^
value e.g: if ∑ = {a} Make all Strings.
R.E=?
Examples Of Regular Expression:
1: if ∑ ={a} write R.E function for all strings
{^,a,aa,aaa,aaaa…}
R.E=?
2:if ∑ = {a} write R.E for all strings without null
^.
{a,aa,aaa,aaaa…}
R.E=?
3:if ∑ ={a,b} write R.E for all possible strings.
{^,a,b,ab,ba,aab,abb,aaa…}
R.E=?
+ Symbol in R.E:
If R.E = (a+b) then what does it mean?
It means at a time we can select one value either
from right side or from the left side.
Possible strings for (a+b) will be:
strings = a,b
lets have an example:
if ∑ ={a,b} write possible strings whose length is 3.
R.E= (a+b)(a+b)(a+b)
if ∑ ={a,b} write all possible strings whose 3rd letter is
a.
R.E=?
If ∑ ={a,b} write R.E for the string {ab,ba,aab}
hint: it’s a finite language
R.E=?
If ∑ ={a,b} write all possible strings that starts and end with b.
{bb,bab,baab,babb…}
R.E=?
Hint: We always complete our condition first
if ∑ ={a,b} write all possible strings that starts and end with
same letter.
If ∑ ={a,b} write all possible strings that contain exactly two
times a in a string.
Strings:{aa,aab,abab,baba,babab…}
R.E=?
Ways to Represent Language in Automata:
Descriptive
Method
R.E
Regular Expression
F.A
N.F.A D.F.A
F.A:
why we use Finite Automata if we already have two
methods to represent the language.
We use finite automata because it is the
diagrammatically representation of the language.
Diagrams are easy to understand.
Different names of F.A:
Machine/F.A/F.S.M/D.F.M/D.F.A
F.S.M: finite state machine
D.F.M: deterministic finite machine
D.F.A: deterministic finite automata
Types of Finite Automata:
N.F.A
Non
Deterministic
Finite Automata
D.F.A
Deterministic
Finite Automata
Basics of N.F.A
States
1:Initial State
The F.A can only have single initial state.
The F.A always starts from initial state.
2:Final State: It is the place where diagram can stop.
F.A has minimum 1 and maximum more than 1 no of final states , but
not infinite.
3:Normal State: From this state, diagram can not stop neither start.
-
+
N.F.A with Examples:
1: R.E=a draw N.F.A
2:R.E= a+b draw N.F.A
Routes are known as transition.
3:R.E = ab
N.F.A with Examples:
Lets move to some difficult ones.
4: if ∑ ={a,b} All string that end with a. R.E=?
N.F.A Techniques.
5:if ∑={a} for all strings R.E=?
6:if ∑={a,b} for all strings R.E=?
7:if ∑={a,b} for all strings that starts with a and end with bb.
R.E technique + N.F.A technique. R.E=?
8:if ∑={a,b} for all possible strings that starts and end with
same letter. R.E=?
R.E= two cases
compare its N.F.A with D.F.A
9:if ∑={a,b} for all strings that starts and end with
different letter. R.E=?
10:if ∑={a,b} for all strings that contain
double a toghether.
11: if ∑={a} for all string of even length.
{^,aa,aaaa,aaaaaa,…}
12: if ∑={a,b} strings of length two.
R.E= (a+b)(a+b)
Ways to Represent Language in Automata:
Descriptive
Method
R.E
Regular Expression
F.A
N.F.A D.F.A
Thanks
A presentation by
Mudasir Khushik
Batch:2k16
University of Sindh Campus At
Thatta

More Related Content

PDF
Regular language and Regular expression
Animesh Chaturvedi
 
PPT
Finite automata
Bipul Roy Bpl
 
PPT
Regular Languages
parmeet834
 
PPTX
NFA & DFA
Akhil Kaushik
 
PPTX
Automata theory - NFA ε to DFA Conversion
Akila Krishnamoorthy
 
PDF
NFA to DFA
Animesh Chaturvedi
 
PPTX
Regular expressions
Shiraz316
 
PDF
TOC 5 | Regular Expressions
Mohammad Imam Hossain
 
Regular language and Regular expression
Animesh Chaturvedi
 
Finite automata
Bipul Roy Bpl
 
Regular Languages
parmeet834
 
NFA & DFA
Akhil Kaushik
 
Automata theory - NFA ε to DFA Conversion
Akila Krishnamoorthy
 
NFA to DFA
Animesh Chaturvedi
 
Regular expressions
Shiraz316
 
TOC 5 | Regular Expressions
Mohammad Imam Hossain
 

What's hot (20)

PPTX
Context free grammar
Mohammad Ilyas Malik
 
PDF
Flat unit 3
VenkataRaoS1
 
PPTX
Regular expressions
Ratnakar Mikkili
 
PPTX
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Mohammad Ilyas Malik
 
PPT
Nondeterministic Finite Automata
Adel Al-Ofairi
 
PPTX
Introduction TO Finite Automata
Ratnakar Mikkili
 
PPT
NFA or Non deterministic finite automata
deepinderbedi
 
PPTX
Automata Theory - Turing machine
Akila Krishnamoorthy
 
PPTX
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
PDF
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
PDF
Closure properties of context free grammar
AfshanKhan51
 
PPT
pushdown automata
Sujata Pardeshi
 
PPTX
Turing machine-TOC
Maulik Togadiya
 
PPT
Randomized algorithms ver 1.0
Dr. C.V. Suresh Babu
 
PPTX
Finite automata-for-lexical-analysis
Dattatray Gandhmal
 
PPTX
3.4 deterministic pda
Sampath Kumar S
 
PPTX
Chomsky classification of Language
Dipankar Boruah
 
PPT
Minimization of DFA
kunj desai
 
PPTX
Concurrency Control in Database Management System
Janki Shah
 
PPTX
Job sequencing with Deadlines
YashiUpadhyay3
 
Context free grammar
Mohammad Ilyas Malik
 
Flat unit 3
VenkataRaoS1
 
Regular expressions
Ratnakar Mikkili
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Mohammad Ilyas Malik
 
Nondeterministic Finite Automata
Adel Al-Ofairi
 
Introduction TO Finite Automata
Ratnakar Mikkili
 
NFA or Non deterministic finite automata
deepinderbedi
 
Automata Theory - Turing machine
Akila Krishnamoorthy
 
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
Closure properties of context free grammar
AfshanKhan51
 
pushdown automata
Sujata Pardeshi
 
Turing machine-TOC
Maulik Togadiya
 
Randomized algorithms ver 1.0
Dr. C.V. Suresh Babu
 
Finite automata-for-lexical-analysis
Dattatray Gandhmal
 
3.4 deterministic pda
Sampath Kumar S
 
Chomsky classification of Language
Dipankar Boruah
 
Minimization of DFA
kunj desai
 
Concurrency Control in Database Management System
Janki Shah
 
Job sequencing with Deadlines
YashiUpadhyay3
 
Ad

Similar to NFA Non Deterministic Finite Automata by Mudasir khushik (20)

PPTX
Chapter-twoChapter-three automata and complexity theory .pptx
anwarkade1
 
PPTX
TCS MUBAI UNIVERSITY ATHARVA COLLEGE OF ENGINEERING.pptx
userqwerty2612
 
PPTX
TOC Introduction
Thapar Institute
 
PDF
TCS GOLDEN NOTES THEORY OF COMPUTATION .pdf
userqwerty2612
 
PDF
Automata_Theory_and_compiler_design_UNIT-1.pptx.pdf
TONY562
 
PPTX
Chapter One - Introduction to automata and complexity theory
biniyamtiktok
 
PDF
5. NFA & DFA.pdf
TANZINTANZINA
 
PPTX
1. Introduction to machine learning and AI
sameerkumar56473
 
PPTX
1. Introduction automata throry and intoduction
sameerkumar56473
 
PPTX
INTRODUTION Formal Language and Automatic Theory.pptx
SUNEEL37
 
PDF
Theory of computation and automata
Prof. Dr. K. Adisesha
 
PDF
Theory of computation and automata
Prof. Dr. K. Adisesha
 
PPT
Finite Automata Theory, Computational Theory Basics
Chithra720576
 
PPT
Basics of Theory of Computation, Finite Automata with Deterministic and Non D...
Chithra720576
 
PPT
67a999b1e2665.pptcffttftr5ftffgvvgsfrrrggv
honeyredde0606
 
PPT
Lecture12_16717_Lecture1.ppt
Venneladonthireddy1
 
PPT
Finite automata(For college Seminars)
Naman Joshi
 
PDF
Finite Automata
A. S. M. Shafi
 
PDF
Formal Languages and Automata Theory Unit 1
Srimatre K
 
PPTX
03-FiniteAutomata.pptx
ssuser47f7f2
 
Chapter-twoChapter-three automata and complexity theory .pptx
anwarkade1
 
TCS MUBAI UNIVERSITY ATHARVA COLLEGE OF ENGINEERING.pptx
userqwerty2612
 
TOC Introduction
Thapar Institute
 
TCS GOLDEN NOTES THEORY OF COMPUTATION .pdf
userqwerty2612
 
Automata_Theory_and_compiler_design_UNIT-1.pptx.pdf
TONY562
 
Chapter One - Introduction to automata and complexity theory
biniyamtiktok
 
5. NFA & DFA.pdf
TANZINTANZINA
 
1. Introduction to machine learning and AI
sameerkumar56473
 
1. Introduction automata throry and intoduction
sameerkumar56473
 
INTRODUTION Formal Language and Automatic Theory.pptx
SUNEEL37
 
Theory of computation and automata
Prof. Dr. K. Adisesha
 
Theory of computation and automata
Prof. Dr. K. Adisesha
 
Finite Automata Theory, Computational Theory Basics
Chithra720576
 
Basics of Theory of Computation, Finite Automata with Deterministic and Non D...
Chithra720576
 
67a999b1e2665.pptcffttftr5ftffgvvgsfrrrggv
honeyredde0606
 
Lecture12_16717_Lecture1.ppt
Venneladonthireddy1
 
Finite automata(For college Seminars)
Naman Joshi
 
Finite Automata
A. S. M. Shafi
 
Formal Languages and Automata Theory Unit 1
Srimatre K
 
03-FiniteAutomata.pptx
ssuser47f7f2
 
Ad

Recently uploaded (20)

PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
The Future of Artificial Intelligence (AI)
Mukul
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 

NFA Non Deterministic Finite Automata by Mudasir khushik

  • 2. Definition: NFA (Non Deterministic Finite Automaton) In NFA the exact state to which the machine moves cannot be determined it is called NFA. As it has finite number of states the machine is called Non Deterministic Finite Machine or Non Deterministic Finite Automaton.
  • 3. NFA is represented by 5 tuples: (Q , ∑ , ∂ , qo , F) Q = finite set of states ∑ = finite set of input symbols ∂ = Transition Function qo = initial state F = final state
  • 4. NFA example: if ∑ = {0,1} input string 011 NFA: P q 1 0,1 +
  • 5. Transition Table: P q 1 0,1 Input 0 1 p {p} {p,q} q {^} {^} +
  • 6. Transition Function: input string 011 ∂ (p,0)=p ∂ (p,1)=(p,q) ∂(q,1)= ^ P q 1 0,1 +
  • 7. Before Jumping to NFA lets have an Eye on following Things. Alphabets Rules Descriptive Method Regular Expression Language F.A String
  • 8. In Automata we deal with Language: Language is the Combination of: Alphabets ∑ Rules
  • 9. Example: if ∑ = {a , b} => (Alphabets) All Strings which end with a.(RULE) String: is a finite sequence of symbols taken from Alphabets. Difference between String and words. Length of a String: length of a string is always positive.
  • 10. Example: String = abba (length = 4) String = abaaaba (length = 7) Concatenation of String: when two or more strings combine to form a new string. If x=ab y=c Reverse of String: if w= abc then find reverse of string if q= stwm find reverse of string?
  • 11. If ∑ = {aa, bab} find the length and reverse of the following string. W = babaabab Tocanisation : (bab)(aa)(bab) Reverse of the String: Palindrome
  • 12. Ways to Represent Language in Automata: Descriptive Method R.E Regular Expression F.A N.F.A D.F.A
  • 13. 1:Descriptive Method if ∑ = {a,b} all strings ending with a {a, ba, aa, aaa, aba, …} => infinite {a, aba, ba, aaa, aa …} => Wrong order of string must be ascending.
  • 14. Descriptive Method Examples: 1: if ∑ = {0,1} write all string which contain 00. 2: if ∑ = {a,b} write all string which starts with a. 3:if ∑ = {0,1} write all possible strings of even length. 4:if ∑ = {a,b} write all possible strings that contain ab. {ab, aab, abb, bab…}
  • 15. Ways to Represent Language in Automata: Descriptive Method R.E Regular Expression F.A N.F.A D.F.A
  • 16. Regular Expression: why we use Regular Expression Because descriptive method se language ke saray words nai likhay ja sakte. Example: if ∑ = {a,b} all strings which starts with a. D.M={a, aa, ab, aaa, aab, aba, abb…} R.E=?
  • 17. Regular Expression Language: Single letter Language Finite Language Infinite Language Kleene Closure Positive Closure
  • 18. 1: Single letter Language: The language in which there is only one Alphabet. Example if ∑ = {a} R.E = a if ∑ = {b} R.E = b 2: Finite Language: The language whose string is countable. Example: if ∑ = {a,b} all string of length two {aa, bb, ab, ba} R.E= ?
  • 19. Infinite Language: The Language whose string is uncountable. Two types of properties 1: Kleene Closure: *, ^, e.g: if ∑={a} Make All strings. R.E=? 2: Positive Closure: +, do not contain ^ value e.g: if ∑ = {a} Make all Strings. R.E=?
  • 20. Examples Of Regular Expression: 1: if ∑ ={a} write R.E function for all strings {^,a,aa,aaa,aaaa…} R.E=? 2:if ∑ = {a} write R.E for all strings without null ^. {a,aa,aaa,aaaa…} R.E=? 3:if ∑ ={a,b} write R.E for all possible strings. {^,a,b,ab,ba,aab,abb,aaa…} R.E=?
  • 21. + Symbol in R.E: If R.E = (a+b) then what does it mean? It means at a time we can select one value either from right side or from the left side. Possible strings for (a+b) will be: strings = a,b lets have an example: if ∑ ={a,b} write possible strings whose length is 3. R.E= (a+b)(a+b)(a+b) if ∑ ={a,b} write all possible strings whose 3rd letter is a. R.E=?
  • 22. If ∑ ={a,b} write R.E for the string {ab,ba,aab} hint: it’s a finite language R.E=? If ∑ ={a,b} write all possible strings that starts and end with b. {bb,bab,baab,babb…} R.E=? Hint: We always complete our condition first if ∑ ={a,b} write all possible strings that starts and end with same letter. If ∑ ={a,b} write all possible strings that contain exactly two times a in a string. Strings:{aa,aab,abab,baba,babab…} R.E=?
  • 23. Ways to Represent Language in Automata: Descriptive Method R.E Regular Expression F.A N.F.A D.F.A
  • 24. F.A: why we use Finite Automata if we already have two methods to represent the language. We use finite automata because it is the diagrammatically representation of the language. Diagrams are easy to understand. Different names of F.A: Machine/F.A/F.S.M/D.F.M/D.F.A F.S.M: finite state machine D.F.M: deterministic finite machine D.F.A: deterministic finite automata
  • 25. Types of Finite Automata: N.F.A Non Deterministic Finite Automata D.F.A Deterministic Finite Automata
  • 26. Basics of N.F.A States 1:Initial State The F.A can only have single initial state. The F.A always starts from initial state. 2:Final State: It is the place where diagram can stop. F.A has minimum 1 and maximum more than 1 no of final states , but not infinite. 3:Normal State: From this state, diagram can not stop neither start. - +
  • 27. N.F.A with Examples: 1: R.E=a draw N.F.A 2:R.E= a+b draw N.F.A Routes are known as transition. 3:R.E = ab
  • 28. N.F.A with Examples: Lets move to some difficult ones. 4: if ∑ ={a,b} All string that end with a. R.E=? N.F.A Techniques. 5:if ∑={a} for all strings R.E=? 6:if ∑={a,b} for all strings R.E=? 7:if ∑={a,b} for all strings that starts with a and end with bb. R.E technique + N.F.A technique. R.E=? 8:if ∑={a,b} for all possible strings that starts and end with same letter. R.E=? R.E= two cases compare its N.F.A with D.F.A 9:if ∑={a,b} for all strings that starts and end with different letter. R.E=?
  • 29. 10:if ∑={a,b} for all strings that contain double a toghether. 11: if ∑={a} for all string of even length. {^,aa,aaaa,aaaaaa,…} 12: if ∑={a,b} strings of length two. R.E= (a+b)(a+b)
  • 30. Ways to Represent Language in Automata: Descriptive Method R.E Regular Expression F.A N.F.A D.F.A
  • 31. Thanks A presentation by Mudasir Khushik Batch:2k16 University of Sindh Campus At Thatta