SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
Automata Theory and Logic
Regular Language & Regular Expression
A TUTORIAL
BY
ANIMESH CHATURVEDI
AT
INDIAN INSTITUTE OF TECHNOLOGY INDORE (IIT-I)
DFA, NFA, Regular Expression (RegEx)
and Regular Language (RegLang)
A DFA represent a Regular Expression language
Regular Expression Regular Language
(0 + 10∗)
(0∗ 10∗)
(0 + ε)(1 + ε)
(a + b)*
(a + b)* abb
(11)*
(aa)*(bb)*b
(aa + ab + ba +bb)*
Language of given Regular Expression?
https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
Regular Expression Regular Language
(0 + 10∗) L = { 0, 1, 10, 100, 1000, 10000, … }
(0∗ 10∗) L = {1, 01, 10, 010, 0010, …}
(0 + ε)(1 + ε) L = {ε, 0, 1, 01}
(a + b)*
(a + b)* abb
(11)*
(aa)*(bb)*b
(aa + ab + ba +bb)*
Language of given Regular Expression?
https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
Regular Expression Regular Language
(0 + 10∗) L = { 0, 1, 10, 100, 1000, 10000, … }
(0∗ 10∗) L = {1, 01, 10, 010, 0010, …}
(0 + ε)(1 + ε) L = {ε, 0, 1, 01}
(a + b)* Set of strings of a’s and b’s of any length including the null string. So L = { ε, a, b,
aa , ab , bb , ba, aaa…….}
(a + b)* abb Set of strings of a’s and b’s ending with the string abb. So L = {abb, aabb, babb,
aaabb, ababb, …………..}
(11)*
(aa)*(bb)*b
(aa + ab + ba +bb)*
Language of given Regular Expression?
https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
Regular Expression Regular Language
(0 + 10∗) L = { 0, 1, 10, 100, 1000, 10000, … }
(0∗ 10∗) L = {1, 01, 10, 010, 0010, …}
(0 + ε)(1 + ε) L = {ε, 0, 1, 01}
(a + b)* Set of strings of a’s and b’s of any length including the null string. So L = { ε, a, b,
aa , ab , bb , ba, aaa…….}
(a + b)* abb Set of strings of a’s and b’s ending with the string abb. So L = {abb, aabb, babb,
aaabb, ababb, …………..}
(11)* Set consisting of even number of 1’s including empty string, So L= {ε, 11, 1111,
111111, ……….}
(aa)*(bb)*b Set of strings consisting of even number of a’s followed by odd number of b’s , so L = {b, aab, aabbb, aabbbbb, aaaab,
aaaabbb, …………..}
(aa + ab + ba +bb)* String of a’s and b’s of even length can be obtained by concatenating any
combination of the strings aa, ab, ba and bb including null, so L = {aa, ab, ba, bb, aaab, aaba, ………..}
Language of given Regular Expression?
https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
Number of states for a given language
Definition of a language L with alphabet {a} is given as following
L = {ank | k > 0, and n is a positive integer constant}
What is the minimum number of states needed in a DFA to recognize L?
Computer Science GATE 2011
Number of states for a given language
Definition of a language L with alphabet {a} is given as following
L = {ank | k > 0, and n is a positive integer constant}
What is the minimum number of states needed in a DFA to recognize L?
n+1 states are needed in a DFA to recognize L
Let n = 3 and k=1
3+1 = 4 states
Computer Science GATE 2011
Minimal DFA for a given language
Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given
below {0, 1} ∪ {x ∈ {0, 1}∗ | len(x) ≥ 3}
Konrad Slind Notes on Computation Theory, September 21, 2010
Minimal DFA for a given language
Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given
below {0, 1} ∪ {x ∈ {0, 1}∗ | len(x) ≥ 3}
Konrad Slind Notes on Computation Theory, September 21, 2010
Minimal DFA for a given language
Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given
below {0, 1} ∪ {x ∈ {0, 1}∗ | len(x) ≥ 3}
Konrad Slind Notes on Computation Theory, September 21, 2010
Minimal DFA for a given language
Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given
below {0, 1} ∪ {x ∈ {0, 1}∗ | len(x) ≥ 3}
Konrad Slind Notes on Computation Theory, September 21, 2010
Minimal DFA for a given language
Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given
below {0n | ∃k. n = 3k + 1}
Konrad Slind Notes on Computation Theory, September 21, 2010
Minimal DFA for a given language
Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given
below {0n | ∃k. n = 3k + 1}
Konrad Slind Notes on Computation Theory, September 21, 2010
Minimal DFA for a given language
Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given
below {0n | ∃k. n = 3k + 1}
Konrad Slind Notes on Computation Theory, September 21, 2010
Convert NFA to DFA for a given RegEx
Construct DFA to accept 00(0+1)*
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegEx
Construct DFA to accept 00(0+1)*
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegEx
Construct DFA to accept (0+1)*11
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegEx
Construct DFA to accept (0+1)*11
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegEx
Construct DFA to accept 00(0+1)*11
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegEx
Construct DFA to accept 00(0+1)*11
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegLang
Construct DFA to accept L(M)=ε
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegLang
Construct DFA to accept L(M)=ε
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegLang
Construct DFA to accept L(M)=Ǿ
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegLang
Construct DFA to accept L(M)=Ǿ
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegLang
Construct DFA to accept L(M)=(0+1)*
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA for a given RegLang
Construct DFA to accept L(M)=(0+1)*
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Regular Expression
What is the language accepted by the NFA for one literal {a} show below?
Assume ε is the empty string
Computer Science GATE 2012
Regular Expression
What is the language accepted by the NFA for one literal {a} show below?
Assume ε is the empty string
Language accepted by NFA is a+, so complement of this language is {є}
Computer Science GATE 2012
What is the DFA & Regular expression?
30Lexical Analysis by Prof. O. Nierstrasz
Example: the set of strings containing an even number of zeros and an even number of ones
What is the DFA & Regular expression?
31Lexical Analysis by Prof. O. Nierstrasz
Example: the set of strings containing an even number of zeros and an even number of ones
What is the DFA & Regular expression?
32Lexical Analysis by Prof. O. Nierstrasz
Example: the set of strings containing an even number of zeros and an even number of ones
The RE is (0011)*((0110)(0011)*(0110)(0011)*)*
Draw NFA for given regular expressions
33Lexical Analysis by Prof. O. Nierstrasz
For the RE (a|b)*abb ?
Draw NFA for given regular expressions
34Lexical Analysis by Prof. O. Nierstrasz
For the RE (a|b)*abb ?
Draw NFA for given regular expressions
35
For the RE (a|b)*abb ?
State s0 has multiple transitions on a! It is a non-deterministic finite automaton
Lexical Analysis by Prof. O. Nierstrasz
36
A language is regular if it is recognized by
a deterministic finite automaton
Whether L = { w | w contains 001} is regular or not?
Check it by building an automaton accepts all and only those strings that contain 001
Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789
37
q q00
1 0
1
q0 q001
0 0 1
0,1
A language is regular if it is recognized by
a deterministic finite automaton
Whether L = { w | w contains 001} is regular or not?
Check it by building an automaton accepts all and only those strings that contain 001
Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789
A language is regular if it is recognized by
a deterministic finite automaton
Whether L = { w | w has an even number of 1s} is regular or not?
Check it by building an automaton accepts all and only those strings that has an even number
of 1s
Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789
A language is regular if it is recognized by
a deterministic finite automaton
q0
q1
0 0
1
1
Whether L = { w | w has an even number of 1s} is regular or not?
Check it by building an automaton accepts all and only those strings that has an even number
of 1s
Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789
References
https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University
http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
Slide by: Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
Slide by Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html
Konrad Slind Notes on Computation Theory, September 21, 2010
Lexical Analysis by Prof. O. Nierstrasz
GATE (Graduate Aptitude Test of Engineering) jointly conducted by IIT’s
Regular language and Regular expression

Mais conteúdo relacionado

Mais procurados

Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4shah zeb
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of AutomataFarooq Mian
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4shah zeb
 
Theory of computing
Theory of computingTheory of computing
Theory of computingRanjan Kumar
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expressionvaluebound
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler DesignAkhil Kaushik
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2shah zeb
 
Pumping lemma Theory Of Automata
Pumping lemma Theory Of AutomataPumping lemma Theory Of Automata
Pumping lemma Theory Of Automatahafizhamza0322
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02hamzamughal39
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Animesh Chaturvedi
 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)Kuppusamy P
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammarmeresie tesfay
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesMarina Santini
 
Regular expressions and languages pdf
Regular expressions and languages pdfRegular expressions and languages pdf
Regular expressions and languages pdfDilouar Hossain
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory Rajendran
 

Mais procurados (20)

Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2
 
Pumping lemma Theory Of Automata
Pumping lemma Theory Of AutomataPumping lemma Theory Of Automata
Pumping lemma Theory Of Automata
 
Parsing
ParsingParsing
Parsing
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular Languages
 
Regular expressions and languages pdf
Regular expressions and languages pdfRegular expressions and languages pdf
Regular expressions and languages pdf
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory
 
Set in discrete mathematics
Set in discrete mathematicsSet in discrete mathematics
Set in discrete mathematics
 
Chomsky Normal Form
Chomsky Normal FormChomsky Normal Form
Chomsky Normal Form
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 

Destaque

Finite State Automata
Finite State AutomataFinite State Automata
Finite State Automata孟賢 施
 
Regular Expressions 101
Regular Expressions 101Regular Expressions 101
Regular Expressions 101Raj Rajandran
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1Rajendran
 
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...Animesh Chaturvedi
 
Pattern detection in mealy machine
Pattern detection in mealy machinePattern detection in mealy machine
Pattern detection in mealy machineAnimesh Chaturvedi
 
Fundamental question and answer in cloud computing quiz by animesh chaturvedi
Fundamental question and answer in cloud computing quiz by animesh chaturvediFundamental question and answer in cloud computing quiz by animesh chaturvedi
Fundamental question and answer in cloud computing quiz by animesh chaturvediAnimesh Chaturvedi
 
Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Animesh Chaturvedi
 
Introduction to Regular Expressions
Introduction to Regular ExpressionsIntroduction to Regular Expressions
Introduction to Regular ExpressionsMatt Casto
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automatadeepinderbedi
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud ComputingAnimesh Chaturvedi
 
Compiler Engineering Lab#3
Compiler Engineering Lab#3Compiler Engineering Lab#3
Compiler Engineering Lab#3MashaelQ
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server PagesRami Nayan
 
Compiler Engineering Lab#1
Compiler Engineering Lab#1Compiler Engineering Lab#1
Compiler Engineering Lab#1MashaelQ
 
Advanced Regular Expressions in .NET
Advanced Regular Expressions in .NETAdvanced Regular Expressions in .NET
Advanced Regular Expressions in .NETPatrick Delancy
 

Destaque (20)

Finite State Automata
Finite State AutomataFinite State Automata
Finite State Automata
 
Regular Expressions 101
Regular Expressions 101Regular Expressions 101
Regular Expressions 101
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1
 
Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)
 
NFA to DFA
NFA to DFANFA to DFA
NFA to DFA
 
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
 
Pattern detection in mealy machine
Pattern detection in mealy machinePattern detection in mealy machine
Pattern detection in mealy machine
 
Fundamental question and answer in cloud computing quiz by animesh chaturvedi
Fundamental question and answer in cloud computing quiz by animesh chaturvediFundamental question and answer in cloud computing quiz by animesh chaturvedi
Fundamental question and answer in cloud computing quiz by animesh chaturvedi
 
Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?
 
Introduction to Regular Expressions
Introduction to Regular ExpressionsIntroduction to Regular Expressions
Introduction to Regular Expressions
 
Push Down Automata (PDA)
Push Down Automata (PDA)Push Down Automata (PDA)
Push Down Automata (PDA)
 
Minimizing DFA
Minimizing DFAMinimizing DFA
Minimizing DFA
 
Cloud Computing Architecture
Cloud Computing ArchitectureCloud Computing Architecture
Cloud Computing Architecture
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 
Class5
Class5Class5
Class5
 
Compiler Engineering Lab#3
Compiler Engineering Lab#3Compiler Engineering Lab#3
Compiler Engineering Lab#3
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Compiler Engineering Lab#1
Compiler Engineering Lab#1Compiler Engineering Lab#1
Compiler Engineering Lab#1
 
Advanced Regular Expressions in .NET
Advanced Regular Expressions in .NETAdvanced Regular Expressions in .NET
Advanced Regular Expressions in .NET
 

Semelhante a Regular language and Regular expression

Semelhante a Regular language and Regular expression (20)

PART A.doc
PART A.docPART A.doc
PART A.doc
 
RegularExpressions.pdf
RegularExpressions.pdfRegularExpressions.pdf
RegularExpressions.pdf
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
theory of computation lecture 02
theory of computation lecture 02theory of computation lecture 02
theory of computation lecture 02
 
regular expression
regular expressionregular expression
regular expression
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
 
UNIT_-_II.docx
UNIT_-_II.docxUNIT_-_II.docx
UNIT_-_II.docx
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
 
Theory of computation Lec2
Theory of computation Lec2Theory of computation Lec2
Theory of computation Lec2
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Regular expressions h1
Regular expressions h1Regular expressions h1
Regular expressions h1
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5
 
draft
draftdraft
draft
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata Theory
 
Chapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdfChapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdf
 
Lex analysis
Lex analysisLex analysis
Lex analysis
 
ITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and GrammarsITU - MDD - Textural Languages and Grammars
ITU - MDD - Textural Languages and Grammars
 
Hw2 2017-spring
Hw2 2017-springHw2 2017-spring
Hw2 2017-spring
 

Mais de Animesh Chaturvedi

Cloud platforms and frameworks
Cloud platforms and frameworksCloud platforms and frameworks
Cloud platforms and frameworksAnimesh Chaturvedi
 
Cloud service lifecycle management
Cloud service lifecycle managementCloud service lifecycle management
Cloud service lifecycle managementAnimesh Chaturvedi
 
Graph Analytics and Complexity Questions and answers
Graph Analytics and Complexity Questions and answersGraph Analytics and Complexity Questions and answers
Graph Analytics and Complexity Questions and answersAnimesh Chaturvedi
 
Advance Systems Engineering Topics
Advance Systems Engineering TopicsAdvance Systems Engineering Topics
Advance Systems Engineering TopicsAnimesh Chaturvedi
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardAnimesh Chaturvedi
 
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)Animesh Chaturvedi
 
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...Animesh Chaturvedi
 
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...Animesh Chaturvedi
 
C- Programming Assignment practice set 2 solutions
C- Programming Assignment practice set 2 solutionsC- Programming Assignment practice set 2 solutions
C- Programming Assignment practice set 2 solutionsAnimesh Chaturvedi
 
C- Programming Assignment 4 solution
C- Programming Assignment 4 solutionC- Programming Assignment 4 solution
C- Programming Assignment 4 solutionAnimesh Chaturvedi
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2Animesh Chaturvedi
 
System requirements engineering
System requirements engineeringSystem requirements engineering
System requirements engineeringAnimesh Chaturvedi
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems EngineeringAnimesh Chaturvedi
 
Big Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingBig Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingAnimesh Chaturvedi
 
Cloud Platforms and Frameworks
Cloud Platforms and FrameworksCloud Platforms and Frameworks
Cloud Platforms and FrameworksAnimesh Chaturvedi
 
Cloud Service Life-cycle Management
Cloud Service Life-cycle ManagementCloud Service Life-cycle Management
Cloud Service Life-cycle ManagementAnimesh Chaturvedi
 

Mais de Animesh Chaturvedi (19)

Cloud Platforms & Frameworks
Cloud Platforms & FrameworksCloud Platforms & Frameworks
Cloud Platforms & Frameworks
 
Cloud platforms and frameworks
Cloud platforms and frameworksCloud platforms and frameworks
Cloud platforms and frameworks
 
Cloud service lifecycle management
Cloud service lifecycle managementCloud service lifecycle management
Cloud service lifecycle management
 
Graph Analytics and Complexity Questions and answers
Graph Analytics and Complexity Questions and answersGraph Analytics and Complexity Questions and answers
Graph Analytics and Complexity Questions and answers
 
Advance Systems Engineering Topics
Advance Systems Engineering TopicsAdvance Systems Engineering Topics
Advance Systems Engineering Topics
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)
 
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
 
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
 
C- Programming Assignment practice set 2 solutions
C- Programming Assignment practice set 2 solutionsC- Programming Assignment practice set 2 solutions
C- Programming Assignment practice set 2 solutions
 
C- Programming Assignment 4 solution
C- Programming Assignment 4 solutionC- Programming Assignment 4 solution
C- Programming Assignment 4 solution
 
C- Programming Assignment 3
C- Programming Assignment 3C- Programming Assignment 3
C- Programming Assignment 3
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
 
System requirements engineering
System requirements engineeringSystem requirements engineering
System requirements engineering
 
Informatics systems
Informatics systemsInformatics systems
Informatics systems
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems Engineering
 
Big Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingBig Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computing
 
Cloud Platforms and Frameworks
Cloud Platforms and FrameworksCloud Platforms and Frameworks
Cloud Platforms and Frameworks
 
Cloud Service Life-cycle Management
Cloud Service Life-cycle ManagementCloud Service Life-cycle Management
Cloud Service Life-cycle Management
 

Último

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 

Último (20)

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 

Regular language and Regular expression

  • 1. Automata Theory and Logic Regular Language & Regular Expression A TUTORIAL BY ANIMESH CHATURVEDI AT INDIAN INSTITUTE OF TECHNOLOGY INDORE (IIT-I)
  • 2. DFA, NFA, Regular Expression (RegEx) and Regular Language (RegLang) A DFA represent a Regular Expression language
  • 3. Regular Expression Regular Language (0 + 10∗) (0∗ 10∗) (0 + ε)(1 + ε) (a + b)* (a + b)* abb (11)* (aa)*(bb)*b (aa + ab + ba +bb)* Language of given Regular Expression? https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
  • 4. Regular Expression Regular Language (0 + 10∗) L = { 0, 1, 10, 100, 1000, 10000, … } (0∗ 10∗) L = {1, 01, 10, 010, 0010, …} (0 + ε)(1 + ε) L = {ε, 0, 1, 01} (a + b)* (a + b)* abb (11)* (aa)*(bb)*b (aa + ab + ba +bb)* Language of given Regular Expression? https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
  • 5. Regular Expression Regular Language (0 + 10∗) L = { 0, 1, 10, 100, 1000, 10000, … } (0∗ 10∗) L = {1, 01, 10, 010, 0010, …} (0 + ε)(1 + ε) L = {ε, 0, 1, 01} (a + b)* Set of strings of a’s and b’s of any length including the null string. So L = { ε, a, b, aa , ab , bb , ba, aaa…….} (a + b)* abb Set of strings of a’s and b’s ending with the string abb. So L = {abb, aabb, babb, aaabb, ababb, …………..} (11)* (aa)*(bb)*b (aa + ab + ba +bb)* Language of given Regular Expression? https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
  • 6. Regular Expression Regular Language (0 + 10∗) L = { 0, 1, 10, 100, 1000, 10000, … } (0∗ 10∗) L = {1, 01, 10, 010, 0010, …} (0 + ε)(1 + ε) L = {ε, 0, 1, 01} (a + b)* Set of strings of a’s and b’s of any length including the null string. So L = { ε, a, b, aa , ab , bb , ba, aaa…….} (a + b)* abb Set of strings of a’s and b’s ending with the string abb. So L = {abb, aabb, babb, aaabb, ababb, …………..} (11)* Set consisting of even number of 1’s including empty string, So L= {ε, 11, 1111, 111111, ……….} (aa)*(bb)*b Set of strings consisting of even number of a’s followed by odd number of b’s , so L = {b, aab, aabbb, aabbbbb, aaaab, aaaabbb, …………..} (aa + ab + ba +bb)* String of a’s and b’s of even length can be obtained by concatenating any combination of the strings aa, ab, ba and bb including null, so L = {aa, ab, ba, bb, aaab, aaba, ………..} Language of given Regular Expression? https://www.tutorialspoint.com/automata_theory/regular_expressions.htm
  • 7. Number of states for a given language Definition of a language L with alphabet {a} is given as following L = {ank | k > 0, and n is a positive integer constant} What is the minimum number of states needed in a DFA to recognize L? Computer Science GATE 2011
  • 8. Number of states for a given language Definition of a language L with alphabet {a} is given as following L = {ank | k > 0, and n is a positive integer constant} What is the minimum number of states needed in a DFA to recognize L? n+1 states are needed in a DFA to recognize L Let n = 3 and k=1 3+1 = 4 states Computer Science GATE 2011
  • 9. Minimal DFA for a given language Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given below {0, 1} ∪ {x ∈ {0, 1}∗ | len(x) ≥ 3} Konrad Slind Notes on Computation Theory, September 21, 2010
  • 10. Minimal DFA for a given language Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given below {0, 1} ∪ {x ∈ {0, 1}∗ | len(x) ≥ 3} Konrad Slind Notes on Computation Theory, September 21, 2010
  • 11. Minimal DFA for a given language Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given below {0, 1} ∪ {x ∈ {0, 1}∗ | len(x) ≥ 3} Konrad Slind Notes on Computation Theory, September 21, 2010
  • 12. Minimal DFA for a given language Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given below {0, 1} ∪ {x ∈ {0, 1}∗ | len(x) ≥ 3} Konrad Slind Notes on Computation Theory, September 21, 2010
  • 13. Minimal DFA for a given language Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given below {0n | ∃k. n = 3k + 1} Konrad Slind Notes on Computation Theory, September 21, 2010
  • 14. Minimal DFA for a given language Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given below {0n | ∃k. n = 3k + 1} Konrad Slind Notes on Computation Theory, September 21, 2010
  • 15. Minimal DFA for a given language Draw a minimal DFA which accepts the same language as a DFA with alphabet ∑ = {0, 1} is given below {0n | ∃k. n = 3k + 1} Konrad Slind Notes on Computation Theory, September 21, 2010
  • 16. Convert NFA to DFA for a given RegEx Construct DFA to accept 00(0+1)* Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 17. Convert NFA to DFA for a given RegEx Construct DFA to accept 00(0+1)* Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 18. Convert NFA to DFA for a given RegEx Construct DFA to accept (0+1)*11 Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 19. Convert NFA to DFA for a given RegEx Construct DFA to accept (0+1)*11 Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 20. Convert NFA to DFA for a given RegEx Construct DFA to accept 00(0+1)*11 Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 21. Convert NFA to DFA for a given RegEx Construct DFA to accept 00(0+1)*11 Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 22. Convert NFA to DFA for a given RegLang Construct DFA to accept L(M)=ε Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 23. Convert NFA to DFA for a given RegLang Construct DFA to accept L(M)=ε Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 24. Convert NFA to DFA for a given RegLang Construct DFA to accept L(M)=Ǿ Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 25. Convert NFA to DFA for a given RegLang Construct DFA to accept L(M)=Ǿ Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 26. Convert NFA to DFA for a given RegLang Construct DFA to accept L(M)=(0+1)* Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 27. Convert NFA to DFA for a given RegLang Construct DFA to accept L(M)=(0+1)* Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 28. Regular Expression What is the language accepted by the NFA for one literal {a} show below? Assume ε is the empty string Computer Science GATE 2012
  • 29. Regular Expression What is the language accepted by the NFA for one literal {a} show below? Assume ε is the empty string Language accepted by NFA is a+, so complement of this language is {є} Computer Science GATE 2012
  • 30. What is the DFA & Regular expression? 30Lexical Analysis by Prof. O. Nierstrasz Example: the set of strings containing an even number of zeros and an even number of ones
  • 31. What is the DFA & Regular expression? 31Lexical Analysis by Prof. O. Nierstrasz Example: the set of strings containing an even number of zeros and an even number of ones
  • 32. What is the DFA & Regular expression? 32Lexical Analysis by Prof. O. Nierstrasz Example: the set of strings containing an even number of zeros and an even number of ones The RE is (0011)*((0110)(0011)*(0110)(0011)*)*
  • 33. Draw NFA for given regular expressions 33Lexical Analysis by Prof. O. Nierstrasz For the RE (a|b)*abb ?
  • 34. Draw NFA for given regular expressions 34Lexical Analysis by Prof. O. Nierstrasz For the RE (a|b)*abb ?
  • 35. Draw NFA for given regular expressions 35 For the RE (a|b)*abb ? State s0 has multiple transitions on a! It is a non-deterministic finite automaton Lexical Analysis by Prof. O. Nierstrasz
  • 36. 36 A language is regular if it is recognized by a deterministic finite automaton Whether L = { w | w contains 001} is regular or not? Check it by building an automaton accepts all and only those strings that contain 001 Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789
  • 37. 37 q q00 1 0 1 q0 q001 0 0 1 0,1 A language is regular if it is recognized by a deterministic finite automaton Whether L = { w | w contains 001} is regular or not? Check it by building an automaton accepts all and only those strings that contain 001 Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789
  • 38. A language is regular if it is recognized by a deterministic finite automaton Whether L = { w | w has an even number of 1s} is regular or not? Check it by building an automaton accepts all and only those strings that has an even number of 1s Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789
  • 39. A language is regular if it is recognized by a deterministic finite automaton q0 q1 0 0 1 1 Whether L = { w | w has an even number of 1s} is regular or not? Check it by building an automaton accepts all and only those strings that has an even number of 1s Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789
  • 40. References https://www.tutorialspoint.com/automata_theory/regular_expressions.htm Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf Slide by: Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf Slide by Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html Konrad Slind Notes on Computation Theory, September 21, 2010 Lexical Analysis by Prof. O. Nierstrasz GATE (Graduate Aptitude Test of Engineering) jointly conducted by IIT’s