SlideShare a Scribd company logo
DMI-ST. JOHN THE BAPTIST UNIVERSITY
LILONGWE, MALAWI
Module Code: 055CS62
Subject Name: Theory of computation
Unit II Detail Notes
School of Computer Science
Module Teacher: Fanny Chatola
Syllabus
Operators of RE, Building RE, Precedence of operators, Algebraic laws for RE, Conversions: NFA to DFA, RE to DFA
Conversions: RE to DFA, DFA to RE Conversions: State/loop elimination, Arden‘s theorem Properties of Regular
Languages: Pumping Lemma for Regular languages, Closure and Decision properties. Case Study: RE in text search
and replace
Regular Expressions: Formal Definition
We construct REs from primitive constituents (basic elements) by repeatedly applying
certain recursive rules as given below. (In the definition)
Definition : Let S be an alphabet. The regular expressions are defined recursively as
follows.
iii) , a is RE.
These are called primitive regular expression i.e. Primitive Constituents
Recursive Step :
I
are REs over, then so are
i)
ii)
iii)
iv)
and
Closure : r is RE over only if it can be obtained from the basis elements (Primitive
REs) by a finite no of applications of the recursive step (given in 2).
Language described by REs : Each describes a language (or a language is associated
with every RE). We will see later that REs are used to attribute regular languages.
Notation : If r is a RE over some alphabet then L(r) is the language associate with r . We
can define the language L(r) associated with (or described by) a REs as follows.
1. is the RE describing the empty language i.e. L(
2. is a RE describing the language { } i.e. L( ) = { } .
3. , a is a RE denoting the language {a} i.e . L(a) = {a} .
4. If and are REs denoting language L( ) and L( ) respectively, then
i) is a regular expression denoting the language L( ) ∪ L( )
ii) is a regular expression denoting the language L( )
iii) is a regular expression denoting the language iv) ( ) is a
regular expression denoting the language L(()) = L( )
Example : Consider the RE (0*(0+1)). Thus the language denoted by the RE is
L(0*(0+1)) = L(0*) L(0+1) .......................by 4(ii)
= L(0)*L(0) ∪ L(1)
= { , 0,00,000,. } {0} {1}
= { , 0,00,000,........} {0,1}
= {0, 00, 000, 0000,..........,1, 01, 001, 0001,...............}
Precedence Rule
Consider the RE ab + c. The language described by the RE can be thought of either
L(a)L(b+c) or L(ab) L(c) as provided by the rules (of languages described by REs)
given already. But these two represents two different languages lending to
ambiguity. To remove this ambiguity we can either
1) Use fully parenthesized expression- (cumbersome) or
) = .
) = L(
)=L( ) L(
2) Use a set of precedence rules to evaluate the options of REs in some order.
Like other algebras mod in mathematics.
For REs, the order of precedence for the operators is as follows:
i) The star operator precedes concatenation and concatenation precedes
union (+) operator.
ii) It is also important to note that concatenation & union (+) operators are
associative and union operation is commutative.
Using these precedence rule, we find that the RE ab+c represents the language
L(ab) L(c) i.e. it should be grouped as ((ab)+c).
We can, of course change the order of precedence by using L(0*(0+1)) = L(0*) L(0+1) .......................by
4(ii)
= L(0)*L(0) L(1)
= { , 0,00,000,........} {0} {1}
= { , 0,00,000,........} {0,1}
= {0, 00, 000, 0000,..........,1, 01, 001, 0001,...............}
Precedence Rule
Consider the RE ab + c. The language described by the RE can be thought of either L(a)L(b+c) or
L(ab) L(c) as provided by the rules (of languages described by REs) given already. But these two
represents two different languages lending to ambiguity. To remove this ambiguity we can either
1) Use fully parenthesized expression- (cumbersome) or
2) Use a set of precedence rules to evaluate the options of REs in some order. Like other algebras mod in
mathematics.
For REs, the order of precedence for the operators is as follows:
i) The star operator precedes concatenation and concatenation precedes union (+) operator.
ii) It is also important to note that concatenation & union (+) operators are associative and union operation is
commutative.
Using these precedence rule, we find that the RE ab+c represents the language L(ab) L(c) i.e. it should be
grouped as ((ab)+c).
We can, of course change the order of precedence by using parentheses. For example, the language
represented by the RE a(b+c) is L(a)L(b+c).
theory of computation notes for school of engineering
1. is
theory of computation notes for school of engineering
theory of computation notes for school of engineering
PUMPING LEMMA FOR REGULAR LANGUAGES
 This is a basic and important theorem used for checking whether given string is accepted by regular
expression or not.
CLOSURE AND DECISION PROPERTIES
theory of computation notes for school of engineering
theory of computation notes for school of engineering
theory of computation notes for school of engineering
theory of computation notes for school of engineering
CASE STUDY: RE in text search and replace
When u want to search a specific pattern of text, use regular expressions. They can help you in pattern
matching, parsing, filtering of results, and so on. Once you learn the regex syntax, you can use it for almost
any language.
Ad

More Related Content

Similar to theory of computation notes for school of engineering (20)

Regular expressions h1
Regular expressions h1Regular expressions h1
Regular expressions h1
Rajendran
 
Formal Languages and Automata Theory unit 2
Formal Languages and Automata Theory unit 2Formal Languages and Automata Theory unit 2
Formal Languages and Automata Theory unit 2
Srimatre K
 
AUTOMATA AUTOMATA Automata4Chapter3.pptx
AUTOMATA AUTOMATA Automata4Chapter3.pptxAUTOMATA AUTOMATA Automata4Chapter3.pptx
AUTOMATA AUTOMATA Automata4Chapter3.pptx
ArjayBalberan1
 
QB104541.pdf
QB104541.pdfQB104541.pdf
QB104541.pdf
MrRRajasekarCSE
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
shah zeb
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
shah zeb
 
regular expression
regular expressionregular expression
regular expression
RohitKumar596173
 
Unit2 Toc.pptx
Unit2 Toc.pptxUnit2 Toc.pptx
Unit2 Toc.pptx
viswanath kani
 
FLAT.pdf
FLAT.pdfFLAT.pdf
FLAT.pdf
AtharvaJoshi930911
 
1LECTURE 8 Regular_Expressions.ppt
1LECTURE 8 Regular_Expressions.ppt1LECTURE 8 Regular_Expressions.ppt
1LECTURE 8 Regular_Expressions.ppt
Marvin886766
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
RaviAr5
 
leanCoR: lean Connection-based DL Reasoner
leanCoR: lean Connection-based DL ReasonerleanCoR: lean Connection-based DL Reasoner
leanCoR: lean Connection-based DL Reasoner
Adriano Melo
 
Unit ii
Unit iiUnit ii
Unit ii
TPLatchoumi
 
Lexical analyzer
Lexical analyzerLexical analyzer
Lexical analyzer
kiran acharya
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
meresie tesfay
 
Towards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression DerivativesTowards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression Derivatives
Jose Emilio Labra Gayo
 
PART A.doc
PART A.docPART A.doc
PART A.doc
karthikeyan Muthusamy
 
Lesson 03.ppt theory of automata including basics of it
Lesson 03.ppt theory  of automata including basics of itLesson 03.ppt theory  of automata including basics of it
Lesson 03.ppt theory of automata including basics of it
zainalvi552
 
Lisp and scheme i
Lisp and scheme iLisp and scheme i
Lisp and scheme i
Luis Goldster
 
Chapter Two(1)
Chapter Two(1)Chapter Two(1)
Chapter Two(1)
bolovv
 
Regular expressions h1
Regular expressions h1Regular expressions h1
Regular expressions h1
Rajendran
 
Formal Languages and Automata Theory unit 2
Formal Languages and Automata Theory unit 2Formal Languages and Automata Theory unit 2
Formal Languages and Automata Theory unit 2
Srimatre K
 
AUTOMATA AUTOMATA Automata4Chapter3.pptx
AUTOMATA AUTOMATA Automata4Chapter3.pptxAUTOMATA AUTOMATA Automata4Chapter3.pptx
AUTOMATA AUTOMATA Automata4Chapter3.pptx
ArjayBalberan1
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
shah zeb
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
shah zeb
 
1LECTURE 8 Regular_Expressions.ppt
1LECTURE 8 Regular_Expressions.ppt1LECTURE 8 Regular_Expressions.ppt
1LECTURE 8 Regular_Expressions.ppt
Marvin886766
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
RaviAr5
 
leanCoR: lean Connection-based DL Reasoner
leanCoR: lean Connection-based DL ReasonerleanCoR: lean Connection-based DL Reasoner
leanCoR: lean Connection-based DL Reasoner
Adriano Melo
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
meresie tesfay
 
Towards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression DerivativesTowards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression Derivatives
Jose Emilio Labra Gayo
 
Lesson 03.ppt theory of automata including basics of it
Lesson 03.ppt theory  of automata including basics of itLesson 03.ppt theory  of automata including basics of it
Lesson 03.ppt theory of automata including basics of it
zainalvi552
 
Chapter Two(1)
Chapter Two(1)Chapter Two(1)
Chapter Two(1)
bolovv
 

More from FIONACHATOLA (18)

ARTIFICIAL INTELLIGENCE CONSTRAINT SATISFACTION PROBLEMS (CSPS) AND MINI-MAX....
ARTIFICIAL INTELLIGENCE CONSTRAINT SATISFACTION PROBLEMS (CSPS) AND MINI-MAX....ARTIFICIAL INTELLIGENCE CONSTRAINT SATISFACTION PROBLEMS (CSPS) AND MINI-MAX....
ARTIFICIAL INTELLIGENCE CONSTRAINT SATISFACTION PROBLEMS (CSPS) AND MINI-MAX....
FIONACHATOLA
 
ARTIFICAIL INTELLIGENCE AO ALGORITHMS NOTES
ARTIFICAIL INTELLIGENCE AO ALGORITHMS NOTESARTIFICAIL INTELLIGENCE AO ALGORITHMS NOTES
ARTIFICAIL INTELLIGENCE AO ALGORITHMS NOTES
FIONACHATOLA
 
business intelligence and analytics notes
business intelligence and analytics notesbusiness intelligence and analytics notes
business intelligence and analytics notes
FIONACHATOLA
 
VOICE OVER INTERNET PROTOCOL(VOIP) notes
VOICE OVER INTERNET PROTOCOL(VOIP) notesVOICE OVER INTERNET PROTOCOL(VOIP) notes
VOICE OVER INTERNET PROTOCOL(VOIP) notes
FIONACHATOLA
 
PC HARWARE AND TROUBLE SHOOTING INTRODUCTION
PC HARWARE AND TROUBLE SHOOTING INTRODUCTIONPC HARWARE AND TROUBLE SHOOTING INTRODUCTION
PC HARWARE AND TROUBLE SHOOTING INTRODUCTION
FIONACHATOLA
 
Unit I Data structure and algorithms notes
Unit I Data structure and algorithms notesUnit I Data structure and algorithms notes
Unit I Data structure and algorithms notes
FIONACHATOLA
 
UG_B.Sc._Information Technology_129 14_Office Automation Lab.pdf
UG_B.Sc._Information Technology_129 14_Office Automation Lab.pdfUG_B.Sc._Information Technology_129 14_Office Automation Lab.pdf
UG_B.Sc._Information Technology_129 14_Office Automation Lab.pdf
FIONACHATOLA
 
computer Hardware and trouble shooting Basics
computer Hardware and trouble shooting Basicscomputer Hardware and trouble shooting Basics
computer Hardware and trouble shooting Basics
FIONACHATOLA
 
Introduction to Email, internet protocols
Introduction to Email, internet protocolsIntroduction to Email, internet protocols
Introduction to Email, internet protocols
FIONACHATOLA
 
Introduction to Internet Protocol ADDRESS.pptx
Introduction to Internet Protocol  ADDRESS.pptxIntroduction to Internet Protocol  ADDRESS.pptx
Introduction to Internet Protocol ADDRESS.pptx
FIONACHATOLA
 
introduction to OSI MODEL-WPS Office.pptx
introduction to OSI MODEL-WPS Office.pptxintroduction to OSI MODEL-WPS Office.pptx
introduction to OSI MODEL-WPS Office.pptx
FIONACHATOLA
 
computer system organization and architecture
computer system organization and architecturecomputer system organization and architecture
computer system organization and architecture
FIONACHATOLA
 
computer fundamentals -e- notes for IT & CS
computer fundamentals -e- notes for IT & CScomputer fundamentals -e- notes for IT & CS
computer fundamentals -e- notes for IT & CS
FIONACHATOLA
 
theory of computation notes for school of engineering
theory of computation notes for school of engineeringtheory of computation notes for school of engineering
theory of computation notes for school of engineering
FIONACHATOLA
 
theory of computation notes for school of engineering
theory of computation notes for school of engineeringtheory of computation notes for school of engineering
theory of computation notes for school of engineering
FIONACHATOLA
 
theory of computation notes for school of engineering
theory of computation notes for school of engineeringtheory of computation notes for school of engineering
theory of computation notes for school of engineering
FIONACHATOLA
 
theory of computation notes for school of engineering
theory of computation notes for school of engineeringtheory of computation notes for school of engineering
theory of computation notes for school of engineering
FIONACHATOLA
 
in computer data structures and algorithms
in computer data structures and algorithmsin computer data structures and algorithms
in computer data structures and algorithms
FIONACHATOLA
 
ARTIFICIAL INTELLIGENCE CONSTRAINT SATISFACTION PROBLEMS (CSPS) AND MINI-MAX....
ARTIFICIAL INTELLIGENCE CONSTRAINT SATISFACTION PROBLEMS (CSPS) AND MINI-MAX....ARTIFICIAL INTELLIGENCE CONSTRAINT SATISFACTION PROBLEMS (CSPS) AND MINI-MAX....
ARTIFICIAL INTELLIGENCE CONSTRAINT SATISFACTION PROBLEMS (CSPS) AND MINI-MAX....
FIONACHATOLA
 
ARTIFICAIL INTELLIGENCE AO ALGORITHMS NOTES
ARTIFICAIL INTELLIGENCE AO ALGORITHMS NOTESARTIFICAIL INTELLIGENCE AO ALGORITHMS NOTES
ARTIFICAIL INTELLIGENCE AO ALGORITHMS NOTES
FIONACHATOLA
 
business intelligence and analytics notes
business intelligence and analytics notesbusiness intelligence and analytics notes
business intelligence and analytics notes
FIONACHATOLA
 
VOICE OVER INTERNET PROTOCOL(VOIP) notes
VOICE OVER INTERNET PROTOCOL(VOIP) notesVOICE OVER INTERNET PROTOCOL(VOIP) notes
VOICE OVER INTERNET PROTOCOL(VOIP) notes
FIONACHATOLA
 
PC HARWARE AND TROUBLE SHOOTING INTRODUCTION
PC HARWARE AND TROUBLE SHOOTING INTRODUCTIONPC HARWARE AND TROUBLE SHOOTING INTRODUCTION
PC HARWARE AND TROUBLE SHOOTING INTRODUCTION
FIONACHATOLA
 
Unit I Data structure and algorithms notes
Unit I Data structure and algorithms notesUnit I Data structure and algorithms notes
Unit I Data structure and algorithms notes
FIONACHATOLA
 
UG_B.Sc._Information Technology_129 14_Office Automation Lab.pdf
UG_B.Sc._Information Technology_129 14_Office Automation Lab.pdfUG_B.Sc._Information Technology_129 14_Office Automation Lab.pdf
UG_B.Sc._Information Technology_129 14_Office Automation Lab.pdf
FIONACHATOLA
 
computer Hardware and trouble shooting Basics
computer Hardware and trouble shooting Basicscomputer Hardware and trouble shooting Basics
computer Hardware and trouble shooting Basics
FIONACHATOLA
 
Introduction to Email, internet protocols
Introduction to Email, internet protocolsIntroduction to Email, internet protocols
Introduction to Email, internet protocols
FIONACHATOLA
 
Introduction to Internet Protocol ADDRESS.pptx
Introduction to Internet Protocol  ADDRESS.pptxIntroduction to Internet Protocol  ADDRESS.pptx
Introduction to Internet Protocol ADDRESS.pptx
FIONACHATOLA
 
introduction to OSI MODEL-WPS Office.pptx
introduction to OSI MODEL-WPS Office.pptxintroduction to OSI MODEL-WPS Office.pptx
introduction to OSI MODEL-WPS Office.pptx
FIONACHATOLA
 
computer system organization and architecture
computer system organization and architecturecomputer system organization and architecture
computer system organization and architecture
FIONACHATOLA
 
computer fundamentals -e- notes for IT & CS
computer fundamentals -e- notes for IT & CScomputer fundamentals -e- notes for IT & CS
computer fundamentals -e- notes for IT & CS
FIONACHATOLA
 
theory of computation notes for school of engineering
theory of computation notes for school of engineeringtheory of computation notes for school of engineering
theory of computation notes for school of engineering
FIONACHATOLA
 
theory of computation notes for school of engineering
theory of computation notes for school of engineeringtheory of computation notes for school of engineering
theory of computation notes for school of engineering
FIONACHATOLA
 
theory of computation notes for school of engineering
theory of computation notes for school of engineeringtheory of computation notes for school of engineering
theory of computation notes for school of engineering
FIONACHATOLA
 
theory of computation notes for school of engineering
theory of computation notes for school of engineeringtheory of computation notes for school of engineering
theory of computation notes for school of engineering
FIONACHATOLA
 
in computer data structures and algorithms
in computer data structures and algorithmsin computer data structures and algorithms
in computer data structures and algorithms
FIONACHATOLA
 
Ad

Recently uploaded (20)

Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
Reflections on Morality, Philosophy, and History
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Novel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth ControlNovel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth Control
Chris Harding
 
Dynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptxDynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptx
University of Glasgow
 
A Survey of Personalized Large Language Models.pptx
A Survey of Personalized Large Language Models.pptxA Survey of Personalized Large Language Models.pptx
A Survey of Personalized Large Language Models.pptx
rutujabhaskarraopati
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
Interfacing PMW3901 Optical Flow Sensor with ESP32
Interfacing PMW3901 Optical Flow Sensor with ESP32Interfacing PMW3901 Optical Flow Sensor with ESP32
Interfacing PMW3901 Optical Flow Sensor with ESP32
CircuitDigest
 
Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1
remoteaimms
 
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Journal of Soft Computing in Civil Engineering
 
Analog electronic circuits with some imp
Analog electronic circuits with some impAnalog electronic circuits with some imp
Analog electronic circuits with some imp
KarthikTG7
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Novel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth ControlNovel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth Control
Chris Harding
 
Dynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptxDynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptx
University of Glasgow
 
A Survey of Personalized Large Language Models.pptx
A Survey of Personalized Large Language Models.pptxA Survey of Personalized Large Language Models.pptx
A Survey of Personalized Large Language Models.pptx
rutujabhaskarraopati
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Interfacing PMW3901 Optical Flow Sensor with ESP32
Interfacing PMW3901 Optical Flow Sensor with ESP32Interfacing PMW3901 Optical Flow Sensor with ESP32
Interfacing PMW3901 Optical Flow Sensor with ESP32
CircuitDigest
 
Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1
remoteaimms
 
Analog electronic circuits with some imp
Analog electronic circuits with some impAnalog electronic circuits with some imp
Analog electronic circuits with some imp
KarthikTG7
 
Ad

theory of computation notes for school of engineering

  • 1. DMI-ST. JOHN THE BAPTIST UNIVERSITY LILONGWE, MALAWI Module Code: 055CS62 Subject Name: Theory of computation Unit II Detail Notes School of Computer Science Module Teacher: Fanny Chatola
  • 2. Syllabus Operators of RE, Building RE, Precedence of operators, Algebraic laws for RE, Conversions: NFA to DFA, RE to DFA Conversions: RE to DFA, DFA to RE Conversions: State/loop elimination, Arden‘s theorem Properties of Regular Languages: Pumping Lemma for Regular languages, Closure and Decision properties. Case Study: RE in text search and replace
  • 3. Regular Expressions: Formal Definition We construct REs from primitive constituents (basic elements) by repeatedly applying certain recursive rules as given below. (In the definition) Definition : Let S be an alphabet. The regular expressions are defined recursively as follows. iii) , a is RE. These are called primitive regular expression i.e. Primitive Constituents Recursive Step : I are REs over, then so are i) ii) iii) iv) and
  • 4. Closure : r is RE over only if it can be obtained from the basis elements (Primitive REs) by a finite no of applications of the recursive step (given in 2). Language described by REs : Each describes a language (or a language is associated with every RE). We will see later that REs are used to attribute regular languages. Notation : If r is a RE over some alphabet then L(r) is the language associate with r . We can define the language L(r) associated with (or described by) a REs as follows. 1. is the RE describing the empty language i.e. L( 2. is a RE describing the language { } i.e. L( ) = { } . 3. , a is a RE denoting the language {a} i.e . L(a) = {a} . 4. If and are REs denoting language L( ) and L( ) respectively, then i) is a regular expression denoting the language L( ) ∪ L( ) ii) is a regular expression denoting the language L( ) iii) is a regular expression denoting the language iv) ( ) is a regular expression denoting the language L(()) = L( ) Example : Consider the RE (0*(0+1)). Thus the language denoted by the RE is L(0*(0+1)) = L(0*) L(0+1) .......................by 4(ii) = L(0)*L(0) ∪ L(1) = { , 0,00,000,. } {0} {1} = { , 0,00,000,........} {0,1} = {0, 00, 000, 0000,..........,1, 01, 001, 0001,...............} Precedence Rule Consider the RE ab + c. The language described by the RE can be thought of either L(a)L(b+c) or L(ab) L(c) as provided by the rules (of languages described by REs) given already. But these two represents two different languages lending to ambiguity. To remove this ambiguity we can either 1) Use fully parenthesized expression- (cumbersome) or ) = . ) = L( )=L( ) L(
  • 5. 2) Use a set of precedence rules to evaluate the options of REs in some order. Like other algebras mod in mathematics. For REs, the order of precedence for the operators is as follows: i) The star operator precedes concatenation and concatenation precedes union (+) operator. ii) It is also important to note that concatenation & union (+) operators are associative and union operation is commutative. Using these precedence rule, we find that the RE ab+c represents the language L(ab) L(c) i.e. it should be grouped as ((ab)+c). We can, of course change the order of precedence by using L(0*(0+1)) = L(0*) L(0+1) .......................by 4(ii) = L(0)*L(0) L(1) = { , 0,00,000,........} {0} {1} = { , 0,00,000,........} {0,1} = {0, 00, 000, 0000,..........,1, 01, 001, 0001,...............} Precedence Rule Consider the RE ab + c. The language described by the RE can be thought of either L(a)L(b+c) or L(ab) L(c) as provided by the rules (of languages described by REs) given already. But these two represents two different languages lending to ambiguity. To remove this ambiguity we can either 1) Use fully parenthesized expression- (cumbersome) or 2) Use a set of precedence rules to evaluate the options of REs in some order. Like other algebras mod in mathematics. For REs, the order of precedence for the operators is as follows: i) The star operator precedes concatenation and concatenation precedes union (+) operator. ii) It is also important to note that concatenation & union (+) operators are associative and union operation is commutative. Using these precedence rule, we find that the RE ab+c represents the language L(ab) L(c) i.e. it should be grouped as ((ab)+c). We can, of course change the order of precedence by using parentheses. For example, the language represented by the RE a(b+c) is L(a)L(b+c).
  • 10. PUMPING LEMMA FOR REGULAR LANGUAGES  This is a basic and important theorem used for checking whether given string is accepted by regular expression or not.
  • 11. CLOSURE AND DECISION PROPERTIES
  • 16. CASE STUDY: RE in text search and replace When u want to search a specific pattern of text, use regular expressions. They can help you in pattern matching, parsing, filtering of results, and so on. Once you learn the regex syntax, you can use it for almost any language.
  翻译: