9
Most read
11
Most read
14
Most read
Regular Expression
 The language accepted by finite automata is Regular languages.
 It can be easily described by simple expressions called Regular Expressions.
 It defines a string as a sequence of pattern
 It involves with alphabets and operators
Regular operators:
 Union – represented as (+) or
 Concatenation - represented as (.)
 Closure :
• Kleen (star) closure - represented as (*) in power (denotes zero or more no. of symbols)
• Positive closure - represented as (+) in power (denotes one or more no. of symbols)
Precedence of regular operators:
* , . , +
E.g.: a.b*+ a is equivalent to (a.b*)+a should not interpreted as a .(b*+a)
ab*+ ba* is equivalent to (a.b*)+ (b.a*)
REGULAR EXPRESSION
• ε also represents a Regular Expression which means the language contains a string
that is empty.
L (ε) = {ε} where ε is zero length string
• φ denotes an empty language and also represents a regular expression.
L (φ) = {} null symbol (empty symbols)
• If a denotes a Regular Expression, then Language L = {a}
• If A is a Regular Expression represents the language L(A) and
B is a Regular Expression represents the language L(B), then
• A + B is a Regular Expression represents the language L(A) ∪ L(B) where
L(A+B) = L(A) ∪ L(B)
• A.B is a Regular Expression represents the language L(A). L(B) where
L (A.B) = L(A). L(B)
• RE* is a Regular Expression representing the language L(RE*) where
L(RE*) = (L(RE)) *
Examples
• (a + 1.a*) = {a} + {1.{ε,a,aa,aaa,….}}
= {a} +{1,1a,1aa,1aaa,….}
= {a,1,1a,1aa,1aaa,….}
• (a*1a*) = {{ε,a,aa,..}.{1}. {ε,a,aa,..}} =
= {1, a1, 1a, a1a, aa1a, …}
• (a+b)* = { ε, a, b, aa, ab , bb , ba, aaa, …….}
• a*+b* = {ε,a,aa,aaa,aaaa,.,b,bb,bbb,bbbb,..}
• (a+b)*abb = {abb, aabb, babb, aaabb, ……..}
• (aa)* = {ε, aa, aaaa, aaaaaa, ……….}
RE with Closure, Union & concatenation
1 a
• ε + AA* = ε + A*A = A*
Exercises
Write a regular expression for the language containing
• The set of strings over {0,1,2} that end in 3 consecutive 1’s.
R.E = (0 + 1+2)* 111
• The set of strings over {0,1} that have at least one 1.
R.E= (0|1)* 1 (0 | 1)*
• The set of strings over {0,1} that have at most one 1.
R.E= 0* 1 0*
• odd number of 1s, ∑ = {0,1}.
R.E= 0*(10*10*)*10*
(ε,,01,0101,0101,010101,,…)1={011,01011,0101011,,….}
Write a regular expression for the language containing
• String of a's and b's that start and end with a.
R.E = a(a|b)*a
• String of a's and b's that the character third from the last is a.
R.E = (a|b)*a (a|b) (a|b)
• String of a's and b's that only contains three b.
R.E = a*ba*ba*ba* eg: bbb
• L = {abn x | n >= 3, x є (a + b)+}
•
R.E = ab3b*(a + b)+
Exercises
Identities of Regular Expressions:
• ∅* = ε ∅ ≠ ∅*
• ε* = ε
• AA* = A*A=A*
• A*A* = A* A={a} then A* =((ε,a,aa,aaa,…..))*
• (A*) * = A*
• (AB)*A =A(BA)*
• (a+d)* = (a*d*)* = (a*+d*)* but (a+b)* ≠ a*+b*
• C + ∅ = ∅ + C = C but C + ε ≠ C
• C + ε = ε + C A ε = ε A = A (a*)a=a+
• ∅B = B∅ = ∅
• A + A = A similarly A+B=B+A (can’t reduce) AB ≠ BA
• L (A+ B) = LA + LB not as AL + BL
• (A + B) L = AL BL
• ε + AA* = ε + A*A = A*
Conversion problem: PART-B
1. NFA- DFA
2. NFA - ε to NFA
3. NFA-ε to DFA
4. RE to NFA- ε
5. DFA to RE
6. Minimization of DFA
RE TO NFA- ε (By Thomson construction Method)
If R is Regular expression, then its NFA- ε
If R.S is R.E then, its NFA- ε
If R+S is R.E then, its NFA- ε
If R* is R.E then, its NFA- ε
Construct NFA for RE: (a|b)*a
Construct NFA for RE: (a+b)*abb
Guess RE : (a+b) a (a+b) (a+b)
Construct NFA epsilon for RE : (a*|b*)*
Guess RE : (a+b)*abb(a+b)*
Construct an NFA- ε equivalent to given RE
1. ε + a b (a+b)*
2. (0+1)* (00+11)
3. (0+1)* (00+11) (0+1)*.
4. ((0+1)(0+1)(0+1))*
5. 10 + (0+11)0*1

More Related Content

PPT
TM - Techniques
PPT
Coordination and Agreement .ppt
PPTX
Chomsky Normal Form
PPTX
Predatory Publications and Software Tools for Identification
PDF
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
PPT
NFA or Non deterministic finite automata
PPTX
Turing Machine
PDF
Deterministic Finite Automata (DFA)
TM - Techniques
Coordination and Agreement .ppt
Chomsky Normal Form
Predatory Publications and Software Tools for Identification
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
NFA or Non deterministic finite automata
Turing Machine
Deterministic Finite Automata (DFA)

What's hot (20)

PPTX
Bootstrapping in Compiler
PPTX
Regular expressions
PDF
NFA to DFA
PPTX
Finite automata-for-lexical-analysis
PDF
Poset in Relations(Discrete Mathematics)
PPTX
Lexical analysis - Compiler Design
PPTX
NFA & DFA
PPT
Regular expression with DFA
PDF
Automata theory
PDF
Heuristic Search in Artificial Intelligence | Heuristic Function in AI | Admi...
PDF
Master theorem
PPTX
1.10. pumping lemma for regular sets
PPTX
Performance analysis(Time & Space Complexity)
PPTX
Introduction TO Finite Automata
PPTX
Backtracking
PPTX
Lecture 14 run time environment
PPTX
Water jug problem ai part 6
PPTX
Code Optimization
PPTX
Regular Expression (Regex) Fundamentals
PPTX
Greedy algorithms
Bootstrapping in Compiler
Regular expressions
NFA to DFA
Finite automata-for-lexical-analysis
Poset in Relations(Discrete Mathematics)
Lexical analysis - Compiler Design
NFA & DFA
Regular expression with DFA
Automata theory
Heuristic Search in Artificial Intelligence | Heuristic Function in AI | Admi...
Master theorem
1.10. pumping lemma for regular sets
Performance analysis(Time & Space Complexity)
Introduction TO Finite Automata
Backtracking
Lecture 14 run time environment
Water jug problem ai part 6
Code Optimization
Regular Expression (Regex) Fundamentals
Greedy algorithms
Ad

Similar to Automata theory -RE to NFA-ε (20)

PPTX
13000120020_A.pptx
PPTX
Regular Expression Examples.pptx
PDF
Ch03
PPTX
Regular Expressions here we have .pptx
PPT
Lesson 03.ppt theory of automata including basics of it
PPT
2_2Specification of Tokens.ppt
PDF
Lex analysis
PPTX
L_2_apl.pptx
PPTX
regular expression
PPT
Lecture 3,4
PPT
Lecture 3,4
PPTX
[Compilers23] Lexical Analysis – Scanning Part I.pptx
PPTX
Lesson_3.pptx database management of employee
PDF
Regular Expression
PPTX
Theory of automata and formal language
PPTX
Sets class 11
PPTX
theory of computation lecture 02
PPT
Lec 03-Regular Expression.pptLec 01-IntroductionLec 01-IntroductionLec 01-Int...
PPTX
Parsing in Compiler Design
PPT
Lesson 03
13000120020_A.pptx
Regular Expression Examples.pptx
Ch03
Regular Expressions here we have .pptx
Lesson 03.ppt theory of automata including basics of it
2_2Specification of Tokens.ppt
Lex analysis
L_2_apl.pptx
regular expression
Lecture 3,4
Lecture 3,4
[Compilers23] Lexical Analysis – Scanning Part I.pptx
Lesson_3.pptx database management of employee
Regular Expression
Theory of automata and formal language
Sets class 11
theory of computation lecture 02
Lec 03-Regular Expression.pptLec 01-IntroductionLec 01-IntroductionLec 01-Int...
Parsing in Compiler Design
Lesson 03
Ad

More from Akila Krishnamoorthy (13)

PPTX
Automata Theory - Turing machine
PPTX
Automata theory - RE to DFA Conversion
PPTX
Automata theory - Push Down Automata (PDA)
PPTX
Automata theory - NFA ε to DFA Conversion
PPTX
Automata theory - NFA to DFA Conversion
PPTX
Automata theory -- NFA and DFA construction
PPTX
Intro to automata theory
PPTX
Automata theory -Conversion of ε nfa to nfa
PPTX
Automata theory - CFG and normal forms
PPTX
PPTX
CLR AND LALR PARSER
PPTX
Linear data structure concepts
PPTX
Keypoints c strings
Automata Theory - Turing machine
Automata theory - RE to DFA Conversion
Automata theory - Push Down Automata (PDA)
Automata theory - NFA ε to DFA Conversion
Automata theory - NFA to DFA Conversion
Automata theory -- NFA and DFA construction
Intro to automata theory
Automata theory -Conversion of ε nfa to nfa
Automata theory - CFG and normal forms
CLR AND LALR PARSER
Linear data structure concepts
Keypoints c strings

Recently uploaded (20)

PDF
Soil Improvement Techniques Note - Rabbi
PDF
Abrasive, erosive and cavitation wear.pdf
PPTX
Module 8- Technological and Communication Skills.pptx
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
communication and presentation skills 01
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
August -2025_Top10 Read_Articles_ijait.pdf
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PPTX
Amdahl’s law is explained in the above power point presentations
PDF
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
Information Storage and Retrieval Techniques Unit III
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
Soil Improvement Techniques Note - Rabbi
Abrasive, erosive and cavitation wear.pdf
Module 8- Technological and Communication Skills.pptx
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
communication and presentation skills 01
distributed database system" (DDBS) is often used to refer to both the distri...
August -2025_Top10 Read_Articles_ijait.pdf
"Array and Linked List in Data Structures with Types, Operations, Implementat...
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
Amdahl’s law is explained in the above power point presentations
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Information Storage and Retrieval Techniques Unit III
Fundamentals of safety and accident prevention -final (1).pptx

Automata theory -RE to NFA-ε

  • 1. Regular Expression  The language accepted by finite automata is Regular languages.  It can be easily described by simple expressions called Regular Expressions.  It defines a string as a sequence of pattern  It involves with alphabets and operators Regular operators:  Union – represented as (+) or  Concatenation - represented as (.)  Closure : • Kleen (star) closure - represented as (*) in power (denotes zero or more no. of symbols) • Positive closure - represented as (+) in power (denotes one or more no. of symbols) Precedence of regular operators: * , . , + E.g.: a.b*+ a is equivalent to (a.b*)+a should not interpreted as a .(b*+a) ab*+ ba* is equivalent to (a.b*)+ (b.a*)
  • 2. REGULAR EXPRESSION • ε also represents a Regular Expression which means the language contains a string that is empty. L (ε) = {ε} where ε is zero length string • φ denotes an empty language and also represents a regular expression. L (φ) = {} null symbol (empty symbols) • If a denotes a Regular Expression, then Language L = {a} • If A is a Regular Expression represents the language L(A) and B is a Regular Expression represents the language L(B), then • A + B is a Regular Expression represents the language L(A) ∪ L(B) where L(A+B) = L(A) ∪ L(B) • A.B is a Regular Expression represents the language L(A). L(B) where L (A.B) = L(A). L(B) • RE* is a Regular Expression representing the language L(RE*) where L(RE*) = (L(RE)) *
  • 3. Examples • (a + 1.a*) = {a} + {1.{ε,a,aa,aaa,….}} = {a} +{1,1a,1aa,1aaa,….} = {a,1,1a,1aa,1aaa,….} • (a*1a*) = {{ε,a,aa,..}.{1}. {ε,a,aa,..}} = = {1, a1, 1a, a1a, aa1a, …} • (a+b)* = { ε, a, b, aa, ab , bb , ba, aaa, …….} • a*+b* = {ε,a,aa,aaa,aaaa,.,b,bb,bbb,bbbb,..} • (a+b)*abb = {abb, aabb, babb, aaabb, ……..} • (aa)* = {ε, aa, aaaa, aaaaaa, ……….} RE with Closure, Union & concatenation 1 a
  • 4. • ε + AA* = ε + A*A = A*
  • 5. Exercises Write a regular expression for the language containing • The set of strings over {0,1,2} that end in 3 consecutive 1’s. R.E = (0 + 1+2)* 111 • The set of strings over {0,1} that have at least one 1. R.E= (0|1)* 1 (0 | 1)* • The set of strings over {0,1} that have at most one 1. R.E= 0* 1 0* • odd number of 1s, ∑ = {0,1}. R.E= 0*(10*10*)*10* (ε,,01,0101,0101,010101,,…)1={011,01011,0101011,,….}
  • 6. Write a regular expression for the language containing • String of a's and b's that start and end with a. R.E = a(a|b)*a • String of a's and b's that the character third from the last is a. R.E = (a|b)*a (a|b) (a|b) • String of a's and b's that only contains three b. R.E = a*ba*ba*ba* eg: bbb • L = {abn x | n >= 3, x є (a + b)+} • R.E = ab3b*(a + b)+ Exercises
  • 7. Identities of Regular Expressions: • ∅* = ε ∅ ≠ ∅* • ε* = ε • AA* = A*A=A* • A*A* = A* A={a} then A* =((ε,a,aa,aaa,…..))* • (A*) * = A* • (AB)*A =A(BA)* • (a+d)* = (a*d*)* = (a*+d*)* but (a+b)* ≠ a*+b* • C + ∅ = ∅ + C = C but C + ε ≠ C • C + ε = ε + C A ε = ε A = A (a*)a=a+ • ∅B = B∅ = ∅ • A + A = A similarly A+B=B+A (can’t reduce) AB ≠ BA • L (A+ B) = LA + LB not as AL + BL • (A + B) L = AL BL • ε + AA* = ε + A*A = A*
  • 8. Conversion problem: PART-B 1. NFA- DFA 2. NFA - ε to NFA 3. NFA-ε to DFA 4. RE to NFA- ε 5. DFA to RE 6. Minimization of DFA
  • 9. RE TO NFA- ε (By Thomson construction Method) If R is Regular expression, then its NFA- ε If R.S is R.E then, its NFA- ε If R+S is R.E then, its NFA- ε If R* is R.E then, its NFA- ε
  • 10. Construct NFA for RE: (a|b)*a
  • 11. Construct NFA for RE: (a+b)*abb
  • 12. Guess RE : (a+b) a (a+b) (a+b)
  • 13. Construct NFA epsilon for RE : (a*|b*)*
  • 14. Guess RE : (a+b)*abb(a+b)*
  • 15. Construct an NFA- ε equivalent to given RE 1. ε + a b (a+b)* 2. (0+1)* (00+11) 3. (0+1)* (00+11) (0+1)*. 4. ((0+1)(0+1)(0+1))* 5. 10 + (0+11)0*1