SlideShare a Scribd company logo
1
Recap Lecture-2
 Kleene Star Closure, Plus operation, recursive
definition of languages, INTEGER, EVEN,
factorial, PALINDROME, {an
bn
}, languages of
strings (i) ending in a, (ii) beginning and
ending in same letters, (iii) containing aa or
bb (iv)containing exactly aa,
2
Regular Expression
 As discussed earlier that a*
generates
Λ, a, aa, aaa, …
and a+
generates a, aa, aaa, aaaa, …, so the
language L1
= {Λ, a, aa, aaa, …} and L2
=
{a, aa, aaa, aaaa, …} can simply be expressed
by a*
and a+
, respectively.
a*
and a+
are called the regular expressions
(RE) for L1
and L2
respectively.
Note: a+
, aa*
and a*
a generate L2
.
3
Recursive definition of Regular
Expression(RE)
Step 1: Every letter of Σ including Λ is a regular expression.
Step 2: If r1
and r2 are regular expressions then
1.(r1
)
2.r1
r2
3.r1
+ r2
and
4. r1
*
are also regular expressions.
Step 3: Nothing else is a regular expression.
4
Defining Languages (continued)…
 Method 3 (Regular Expressions)
 Consider the language L={Λ, x, xx, xxx,…} of
strings, defined over Σ = {x}.
We can write this language as the Kleene star
closure of alphabet Σ or L=Σ*
={x}*
this language can also be expressed by the
regular expression x*
.
 Similarly the language L={x, xx, xxx,…}, defined
over Σ = {x}, can be expressed by the regular
expression x+
.
5
 Now consider another language L, consisting
of all possible strings, defined over Σ =
{a, b}. This language can also be expressed by
the regular expression
(a + b)*
.
 Now consider another language L, of strings
having exactly double a, defined over Σ
= {a, b}, then it’s regular expression may be
b*
aab*
6
 Now consider another language L, of even
length, defined over Σ = {a, b}, then it’s
regular expression may be
((a+b)(a+b))*
 Now consider another language L, of odd
length, defined over Σ = {a, b}, then it’s
regular expression may be
(a+b)((a+b)(a+b))*
or
((a+b)(a+b))*
(a+b)
7
Remark
 It may be noted that a language may be
expressed by more than one regular
expressions, while given a regular expression
there exist a unique language generated by
that regular expression.
8
 Example:
 Consider the language, defined over
Σ={a , b} of words having at least one a,
may be expressed by a regular expression
(a+b)*
a(a+b)*
.
 Consider the language, defined over
Σ = {a, b} of words having at least one a
and one b, may be expressed by a regular
expression
(a+b)*
a(a+b)*
b(a+b)*
+ (a+b)*
b(a+b)*
a(a+b)*
.
9
 Consider the language, defined over
Σ={a, b}, of words starting with double a
and ending in double b then its regular
expression may be aa(a+b)*
bb
 Consider the language, defined over
Σ={a, b} of words starting with a and
ending in b OR starting with b and
ending in a, then its regular expression
may be a(a+b)*
b+b(a+b)*
a
10
SummingUP Lecture 3
RE, Recursive definition of RE, defining
languages by RE, { x}*
, { x}+
, {a+b}*
, Language of
strings having exactly one aa, Language of
strings of even length, Language of strings of
odd length, RE defines unique language (as
Remark), Language of strings having at least
one a, Language of strings havgin at least one
a and one b, Language of strings starting with
aa and ending in bb, Language of strings
starting with and ending in different letters.
Ad

More Related Content

Similar to Lesson 03.ppt theory of automata including basics of it (20)

Lesson 02
Lesson 02Lesson 02
Lesson 02
maamir farooq
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02
hamzamughal39
 
Theory of Automata Power Point Slides Lecture 05.ppt
Theory of Automata  Power Point Slides Lecture 05.pptTheory of Automata  Power Point Slides Lecture 05.ppt
Theory of Automata Power Point Slides Lecture 05.ppt
saimakhosa3
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
shah zeb
 
Lesson 01.ppt theory of automata including basics of it
Lesson 01.ppt theory  of automata including basics of itLesson 01.ppt theory  of automata including basics of it
Lesson 01.ppt theory of automata including basics of it
zainalvi552
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
maamir farooq
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
University of Haripur
 
Lesson 02.ppt theory of automata including basics of it
Lesson 02.ppt theory  of automata including basics of itLesson 02.ppt theory  of automata including basics of it
Lesson 02.ppt theory of automata including basics of it
zainalvi552
 
Language
LanguageLanguage
Language
Mobeen Mustafa
 
theory of computation lecture 02
theory of computation lecture 02theory of computation lecture 02
theory of computation lecture 02
8threspecter
 
Theory of Automata - Power Point Slides Lecture 01).ppt
Theory of Automata - Power Point Slides Lecture 01).pptTheory of Automata - Power Point Slides Lecture 01).ppt
Theory of Automata - Power Point Slides Lecture 01).ppt
saimakhosa3
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
Farooq Mian
 
Theory of Automata Lesson 01
 Theory of Automata Lesson 01  Theory of Automata Lesson 01
Theory of Automata Lesson 01
hamzamughal39
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
RaviAr5
 
Lesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptLesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.ppt
ashja1
 
To lec 03
To lec 03To lec 03
To lec 03
Hasam Panezai
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
A. S. M. Shafi
 
Handout Regular expression with examples and lecture
Handout Regular expression with examples  and lecture Handout Regular expression with examples  and lecture
Handout Regular expression with examples and lecture
mariajan8
 
Lesson 01.ppt
Lesson 01.pptLesson 01.ppt
Lesson 01.ppt
ImXaib
 
Lec-02 Languages for finite automata FA
Lec-02 Languages for finite automata  FALec-02 Languages for finite automata  FA
Lec-02 Languages for finite automata FA
NidaAslam30
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02
hamzamughal39
 
Theory of Automata Power Point Slides Lecture 05.ppt
Theory of Automata  Power Point Slides Lecture 05.pptTheory of Automata  Power Point Slides Lecture 05.ppt
Theory of Automata Power Point Slides Lecture 05.ppt
saimakhosa3
 
Lesson 01.ppt theory of automata including basics of it
Lesson 01.ppt theory  of automata including basics of itLesson 01.ppt theory  of automata including basics of it
Lesson 01.ppt theory of automata including basics of it
zainalvi552
 
Lesson 02.ppt theory of automata including basics of it
Lesson 02.ppt theory  of automata including basics of itLesson 02.ppt theory  of automata including basics of it
Lesson 02.ppt theory of automata including basics of it
zainalvi552
 
theory of computation lecture 02
theory of computation lecture 02theory of computation lecture 02
theory of computation lecture 02
8threspecter
 
Theory of Automata - Power Point Slides Lecture 01).ppt
Theory of Automata - Power Point Slides Lecture 01).pptTheory of Automata - Power Point Slides Lecture 01).ppt
Theory of Automata - Power Point Slides Lecture 01).ppt
saimakhosa3
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
Farooq Mian
 
Theory of Automata Lesson 01
 Theory of Automata Lesson 01  Theory of Automata Lesson 01
Theory of Automata Lesson 01
hamzamughal39
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
RaviAr5
 
Lesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptLesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.ppt
ashja1
 
Handout Regular expression with examples and lecture
Handout Regular expression with examples  and lecture Handout Regular expression with examples  and lecture
Handout Regular expression with examples and lecture
mariajan8
 
Lesson 01.ppt
Lesson 01.pptLesson 01.ppt
Lesson 01.ppt
ImXaib
 
Lec-02 Languages for finite automata FA
Lec-02 Languages for finite automata  FALec-02 Languages for finite automata  FA
Lec-02 Languages for finite automata FA
NidaAslam30
 

Recently uploaded (20)

Seismic evidence of liquid water at the base of Mars' upper crust
Seismic evidence of liquid water at the base of Mars' upper crustSeismic evidence of liquid water at the base of Mars' upper crust
Seismic evidence of liquid water at the base of Mars' upper crust
Sérgio Sacani
 
Water Pollution control using microorganisms
Water Pollution control using microorganismsWater Pollution control using microorganisms
Water Pollution control using microorganisms
gerefam247
 
ICAI OpenGov Lab: A Quick Introduction | AI for Open Government
ICAI OpenGov Lab: A Quick Introduction | AI for Open GovernmentICAI OpenGov Lab: A Quick Introduction | AI for Open Government
ICAI OpenGov Lab: A Quick Introduction | AI for Open Government
David Graus
 
Euclid: The Story So far, a Departmental Colloquium at Maynooth University
Euclid: The Story So far, a Departmental Colloquium at Maynooth UniversityEuclid: The Story So far, a Departmental Colloquium at Maynooth University
Euclid: The Story So far, a Departmental Colloquium at Maynooth University
Peter Coles
 
Freshwater Biome Types, Characteristics and Factors
Freshwater Biome Types, Characteristics and FactorsFreshwater Biome Types, Characteristics and Factors
Freshwater Biome Types, Characteristics and Factors
mytriplemonlineshop
 
Issues in using AI in academic publishing.pdf
Issues in using AI in academic publishing.pdfIssues in using AI in academic publishing.pdf
Issues in using AI in academic publishing.pdf
Angelo Salatino
 
Black hole and its division and categories
Black hole and its division and categoriesBlack hole and its division and categories
Black hole and its division and categories
MSafiullahALawi
 
Preclinical Advances in Nuclear Neurology.pptx
Preclinical Advances in Nuclear Neurology.pptxPreclinical Advances in Nuclear Neurology.pptx
Preclinical Advances in Nuclear Neurology.pptx
MahitaLaveti
 
Proprioceptors_ receptors of muscle_tendon
Proprioceptors_ receptors of muscle_tendonProprioceptors_ receptors of muscle_tendon
Proprioceptors_ receptors of muscle_tendon
klynct
 
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.pptSULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
HRUTUJA WAGH
 
Mycology:Characteristics of Ascomycetes Fungi
Mycology:Characteristics of Ascomycetes FungiMycology:Characteristics of Ascomycetes Fungi
Mycology:Characteristics of Ascomycetes Fungi
SAYANTANMALLICK5
 
Controls over genes.ppt. Gene Expression
Controls over genes.ppt. Gene ExpressionControls over genes.ppt. Gene Expression
Controls over genes.ppt. Gene Expression
NABIHANAEEM2
 
Transgenic Mice in Cancer Research - Creative Biolabs
Transgenic Mice in Cancer Research - Creative BiolabsTransgenic Mice in Cancer Research - Creative Biolabs
Transgenic Mice in Cancer Research - Creative Biolabs
Creative-Biolabs
 
What Are Dendritic Cells and Their Role in Immunobiology?
What Are Dendritic Cells and Their Role in Immunobiology?What Are Dendritic Cells and Their Role in Immunobiology?
What Are Dendritic Cells and Their Role in Immunobiology?
Kosheeka : Primary Cells for Research
 
Reticular formation_groups_organization_
Reticular formation_groups_organization_Reticular formation_groups_organization_
Reticular formation_groups_organization_
klynct
 
The Microbial World. Microbiology , Microbes, infections
The Microbial World. Microbiology , Microbes, infectionsThe Microbial World. Microbiology , Microbes, infections
The Microbial World. Microbiology , Microbes, infections
NABIHANAEEM2
 
Batteries and fuel cells for btech first year
Batteries and fuel cells for btech first yearBatteries and fuel cells for btech first year
Batteries and fuel cells for btech first year
MithilPillai1
 
Introduction to Black Hole and how its formed
Introduction to Black Hole and how its formedIntroduction to Black Hole and how its formed
Introduction to Black Hole and how its formed
MSafiullahALawi
 
Study in Pink (forensic case study of Death)
Study in Pink (forensic case study of Death)Study in Pink (forensic case study of Death)
Study in Pink (forensic case study of Death)
memesologiesxd
 
Somato_Sensory _ somatomotor_Nervous_System.pptx
Somato_Sensory _ somatomotor_Nervous_System.pptxSomato_Sensory _ somatomotor_Nervous_System.pptx
Somato_Sensory _ somatomotor_Nervous_System.pptx
klynct
 
Seismic evidence of liquid water at the base of Mars' upper crust
Seismic evidence of liquid water at the base of Mars' upper crustSeismic evidence of liquid water at the base of Mars' upper crust
Seismic evidence of liquid water at the base of Mars' upper crust
Sérgio Sacani
 
Water Pollution control using microorganisms
Water Pollution control using microorganismsWater Pollution control using microorganisms
Water Pollution control using microorganisms
gerefam247
 
ICAI OpenGov Lab: A Quick Introduction | AI for Open Government
ICAI OpenGov Lab: A Quick Introduction | AI for Open GovernmentICAI OpenGov Lab: A Quick Introduction | AI for Open Government
ICAI OpenGov Lab: A Quick Introduction | AI for Open Government
David Graus
 
Euclid: The Story So far, a Departmental Colloquium at Maynooth University
Euclid: The Story So far, a Departmental Colloquium at Maynooth UniversityEuclid: The Story So far, a Departmental Colloquium at Maynooth University
Euclid: The Story So far, a Departmental Colloquium at Maynooth University
Peter Coles
 
Freshwater Biome Types, Characteristics and Factors
Freshwater Biome Types, Characteristics and FactorsFreshwater Biome Types, Characteristics and Factors
Freshwater Biome Types, Characteristics and Factors
mytriplemonlineshop
 
Issues in using AI in academic publishing.pdf
Issues in using AI in academic publishing.pdfIssues in using AI in academic publishing.pdf
Issues in using AI in academic publishing.pdf
Angelo Salatino
 
Black hole and its division and categories
Black hole and its division and categoriesBlack hole and its division and categories
Black hole and its division and categories
MSafiullahALawi
 
Preclinical Advances in Nuclear Neurology.pptx
Preclinical Advances in Nuclear Neurology.pptxPreclinical Advances in Nuclear Neurology.pptx
Preclinical Advances in Nuclear Neurology.pptx
MahitaLaveti
 
Proprioceptors_ receptors of muscle_tendon
Proprioceptors_ receptors of muscle_tendonProprioceptors_ receptors of muscle_tendon
Proprioceptors_ receptors of muscle_tendon
klynct
 
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.pptSULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
HRUTUJA WAGH
 
Mycology:Characteristics of Ascomycetes Fungi
Mycology:Characteristics of Ascomycetes FungiMycology:Characteristics of Ascomycetes Fungi
Mycology:Characteristics of Ascomycetes Fungi
SAYANTANMALLICK5
 
Controls over genes.ppt. Gene Expression
Controls over genes.ppt. Gene ExpressionControls over genes.ppt. Gene Expression
Controls over genes.ppt. Gene Expression
NABIHANAEEM2
 
Transgenic Mice in Cancer Research - Creative Biolabs
Transgenic Mice in Cancer Research - Creative BiolabsTransgenic Mice in Cancer Research - Creative Biolabs
Transgenic Mice in Cancer Research - Creative Biolabs
Creative-Biolabs
 
Reticular formation_groups_organization_
Reticular formation_groups_organization_Reticular formation_groups_organization_
Reticular formation_groups_organization_
klynct
 
The Microbial World. Microbiology , Microbes, infections
The Microbial World. Microbiology , Microbes, infectionsThe Microbial World. Microbiology , Microbes, infections
The Microbial World. Microbiology , Microbes, infections
NABIHANAEEM2
 
Batteries and fuel cells for btech first year
Batteries and fuel cells for btech first yearBatteries and fuel cells for btech first year
Batteries and fuel cells for btech first year
MithilPillai1
 
Introduction to Black Hole and how its formed
Introduction to Black Hole and how its formedIntroduction to Black Hole and how its formed
Introduction to Black Hole and how its formed
MSafiullahALawi
 
Study in Pink (forensic case study of Death)
Study in Pink (forensic case study of Death)Study in Pink (forensic case study of Death)
Study in Pink (forensic case study of Death)
memesologiesxd
 
Somato_Sensory _ somatomotor_Nervous_System.pptx
Somato_Sensory _ somatomotor_Nervous_System.pptxSomato_Sensory _ somatomotor_Nervous_System.pptx
Somato_Sensory _ somatomotor_Nervous_System.pptx
klynct
 
Ad

Lesson 03.ppt theory of automata including basics of it

  • 1. 1 Recap Lecture-2  Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {an bn }, languages of strings (i) ending in a, (ii) beginning and ending in same letters, (iii) containing aa or bb (iv)containing exactly aa,
  • 2. 2 Regular Expression  As discussed earlier that a* generates Λ, a, aa, aaa, … and a+ generates a, aa, aaa, aaaa, …, so the language L1 = {Λ, a, aa, aaa, …} and L2 = {a, aa, aaa, aaaa, …} can simply be expressed by a* and a+ , respectively. a* and a+ are called the regular expressions (RE) for L1 and L2 respectively. Note: a+ , aa* and a* a generate L2 .
  • 3. 3 Recursive definition of Regular Expression(RE) Step 1: Every letter of Σ including Λ is a regular expression. Step 2: If r1 and r2 are regular expressions then 1.(r1 ) 2.r1 r2 3.r1 + r2 and 4. r1 * are also regular expressions. Step 3: Nothing else is a regular expression.
  • 4. 4 Defining Languages (continued)…  Method 3 (Regular Expressions)  Consider the language L={Λ, x, xx, xxx,…} of strings, defined over Σ = {x}. We can write this language as the Kleene star closure of alphabet Σ or L=Σ* ={x}* this language can also be expressed by the regular expression x* .  Similarly the language L={x, xx, xxx,…}, defined over Σ = {x}, can be expressed by the regular expression x+ .
  • 5. 5  Now consider another language L, consisting of all possible strings, defined over Σ = {a, b}. This language can also be expressed by the regular expression (a + b)* .  Now consider another language L, of strings having exactly double a, defined over Σ = {a, b}, then it’s regular expression may be b* aab*
  • 6. 6  Now consider another language L, of even length, defined over Σ = {a, b}, then it’s regular expression may be ((a+b)(a+b))*  Now consider another language L, of odd length, defined over Σ = {a, b}, then it’s regular expression may be (a+b)((a+b)(a+b))* or ((a+b)(a+b))* (a+b)
  • 7. 7 Remark  It may be noted that a language may be expressed by more than one regular expressions, while given a regular expression there exist a unique language generated by that regular expression.
  • 8. 8  Example:  Consider the language, defined over Σ={a , b} of words having at least one a, may be expressed by a regular expression (a+b)* a(a+b)* .  Consider the language, defined over Σ = {a, b} of words having at least one a and one b, may be expressed by a regular expression (a+b)* a(a+b)* b(a+b)* + (a+b)* b(a+b)* a(a+b)* .
  • 9. 9  Consider the language, defined over Σ={a, b}, of words starting with double a and ending in double b then its regular expression may be aa(a+b)* bb  Consider the language, defined over Σ={a, b} of words starting with a and ending in b OR starting with b and ending in a, then its regular expression may be a(a+b)* b+b(a+b)* a
  • 10. 10 SummingUP Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}* , { x}+ , {a+b}* , Language of strings having exactly one aa, Language of strings of even length, Language of strings of odd length, RE defines unique language (as Remark), Language of strings having at least one a, Language of strings havgin at least one a and one b, Language of strings starting with aa and ending in bb, Language of strings starting with and ending in different letters.
  翻译: