SlideShare a Scribd company logo
Lecture # 7
Automata Theory and formal languages
(CSC-307)
Muhamad Shahzeb
Defining Languages (continued)…
 (Transition Graph)
Definition: A Transition graph (TG), is a
collection of the followings
1. Finite number of states, at least one of which is start
state and some (maybe none) final states.
2. Finite set of input letters (Σ) from which input
strings are formed.
3. Finite set of transitions that show how to go from
one state to another based on reading specified
substrings of input letters, possibly even the null
string Λ.
Deterministic vs Non-Determeinistic Models
 In deterministic finite automata, there's exactly one state transition for
every input symbol-state pair. There are also no epsilon transitions,
meaning that you're not allowed to change states without consuming
anything from the input.
 In non-deterministic finite automata, there can be 0 or more state
transitions for every input-state pair. You can also have epsilon
transitions.
Note
It is to be noted that in TG there may exist more
than one paths for certain string, while there may
not exist any path for certain string as well.
If there exists at least one path for a certain
string, starting from initial state and ending in a
final state, the string is supposed to be accepted
by the TG, otherwise the string is supposed to be
rejected. Obviously collection of accepted strings
is the language accepted by the TG.
Example
Consider the Language L , defined over Σ = {a, b}
of all strings including Λ. The language L may
be accepted by the following TG
The language L may also be accepted by the
following TG
Example Continued …
TG1
TG2
Example
Consider the language L of strings, defined over
Σ={a, b}, starting with b. The language L may be
expressed by RE b(a + b)* , may be accepted by the
following TG
Example
Consider the language L of strings, defined over
Σ={a, b}, not ending in b. The language L may
be expressed by RE Λ + (a + b)*a , may be
accepted by the following TG
Example
Consider the Language L of strings, defined over
Σ = {a, b}, containing double a.
The language L may be expressed by the
following regular expression
(a+b)* (aa) (a+b)*
This language may be accepted by the following
TG
Example Continued …
Multiple paths (options) are visible for Double a.
Example
Consider the language L of strings, defined over
Σ={a, b}, having double a or double b.
The language L can be expressed by RE
(a+b)* (aa + bb) (a+b)*
The above language may also be expressed by the
following TGs.
Example continued …
OR
OR
Note
In the above TG if the states are not labeled then it
may not be considered to be a single TG
Example
Consider the language L of strings, defined over
Σ={a, b}, having (containing) triple a or
triple b.
The language L may be expressed by RE
(a+b)* (aaa + bbb) (a+b)*
This language may be accepted by the following
TG
Example Continued …
OR
OR
Example
Consider the language L of strings, defined over Σ
= {a, b}, beginning and ending in different
letters.
The language L may be expressed by RE
a(a + b)*b + b(a + b)*a
The language L may be accepted by the following
TG
Example continued …
Example
Consider the Language L of strings of length
two or more, defined over Σ = {a, b},
beginning with and ending in same letters.
The language L may be expressed by the following
regular expression
a(a + b)*a + b(a + b)*b
This language may be accepted by the following
TG
Example Continued …
Example
Consider the EVEN-EVEN language, defined over
Σ={a, b}.
As discussed earlier that EVEN-EVEN language
can be expressed by a regular expression
( aa + bb + (ab+ba)(aa+bb)*(ab+ba) )*
The language EVEN-EVEN may be accepted by
the following TG
Example continued …
Example
Consider the language L, defined over Σ={a, b}, in
which a’s occur only in even clumps (bundles)
and that ends in three or more b’s.
The language L can be expressed by its regular
expression
(aa)*b ( b+(aa(aa)*b) )* bb
OR
(aa)*b ( b+(aa)+
b )* bb OR Think another RE
The language L may be accepted by the following
TG
Example Continued …
Generalized Transition Graphs
 A generalized transition graph (GTG) is a
collection of three things:
1. Finite number of states, at least one of which is start
state and some (maybe none) final states.
2. Finite set of input letters (Σ) from which input strings
are formed.
3. Directed edges connecting some pair of states labeled
with regular expression
It may be noted that in GTG, the labels of transition edges
are corresponding regular expressions
Example
Consider the language L of strings, defined over
Σ={a,b}, containing double a or double b.
The language L can be expressed by the following
regular expression
(a+b)* (aa + bb) (a+b)*
The language L may be accepted by the following
GTG.
Example continued …
Or
Example
Consider the language L of strings, defined over
Σ={a,b},that start and ends with different letters.
The language L can be expressed by the following
regular expression
a(a+b)*b + b(a+b)*a
The language L may be accepted by the following
GTG.
Example continued …
Or
Thank You…

More Related Content

What's hot

Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
Farooq Mian
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
shah zeb
 
Lesson 03
Lesson 03Lesson 03
Lesson 05
Lesson 05Lesson 05
Automata theory
Automata theoryAutomata theory
Automata theory
colleges
 
Automata theory -RE to NFA-ε
Automata theory -RE to  NFA-εAutomata theory -RE to  NFA-ε
Automata theory -RE to NFA-ε
Akila Krishnamoorthy
 
Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...
Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...
Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...
Farwa Ansari
 
Lesson 10
Lesson 10Lesson 10
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Shiraz316
 
Lesson 04
Lesson 04Lesson 04
Kleene's theorem
Kleene's theoremKleene's theorem
Kleene's theorem
Mobeen Mustafa
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
Bipul Roy Bpl
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2
Abhimanyu Mishra
 
Deterministic Finite Automata
Deterministic Finite AutomataDeterministic Finite Automata
Deterministic Finite Automata
Shiraz316
 
Lesson 12
Lesson 12Lesson 12
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
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
deepinderbedi
 
Regular Expression Examples.pptx
Regular Expression Examples.pptxRegular Expression Examples.pptx
Regular Expression Examples.pptx
GhulamRabani9
 
NLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingNLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological Parsing
Hemantha Kulathilake
 

What's hot (20)

Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
Lesson 05
Lesson 05Lesson 05
Lesson 05
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
Automata theory -RE to NFA-ε
Automata theory -RE to  NFA-εAutomata theory -RE to  NFA-ε
Automata theory -RE to NFA-ε
 
Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...
Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...
Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Lesson 04
Lesson 04Lesson 04
Lesson 04
 
Kleene's theorem
Kleene's theoremKleene's theorem
Kleene's theorem
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2
 
Deterministic Finite Automata
Deterministic Finite AutomataDeterministic Finite Automata
Deterministic Finite Automata
 
Lesson 12
Lesson 12Lesson 12
Lesson 12
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
Regular Expression Examples.pptx
Regular Expression Examples.pptxRegular Expression Examples.pptx
Regular Expression Examples.pptx
 
Finite automata
Finite automataFinite automata
Finite automata
 
NLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingNLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological Parsing
 

Similar to Lecture 7

Lesson 09.ppt
Lesson 09.pptLesson 09.ppt
Lesson 09.ppt
AbuBakkarShayan
 
Chapter Three(2)
Chapter Three(2)Chapter Three(2)
Chapter Three(2)bolovv
 
theory of computation lecture 02
theory of computation lecture 02theory of computation lecture 02
theory of computation lecture 02
8threspecter
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
RaviAr5
 
Lesson 02
Lesson 02Lesson 02
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
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
ReehaamMalikArain
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
A. S. M. Shafi
 
Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........
NaumanAli215439
 
Lex analysis
Lex analysisLex analysis
Lex analysis
Suhit Kulkarni
 
5.ppt
5.ppt5.ppt
Regular Expression in Compiler design
Regular Expression in Compiler designRegular Expression in Compiler design
Regular Expression in Compiler design
Riazul Islam
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
Rabia Khalid
 
Language
LanguageLanguage
Language
Mobeen Mustafa
 
02. chapter 3 lexical analysis
02. chapter 3   lexical analysis02. chapter 3   lexical analysis
02. chapter 3 lexical analysisraosir123
 
Chapter Two(1)
Chapter Two(1)Chapter Two(1)
Chapter Two(1)bolovv
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
adugnanegero
 
theory of computation notes. introduction and mcq points
theory of computation notes. introduction and mcq pointstheory of computation notes. introduction and mcq points
theory of computation notes. introduction and mcq points
bushraphd2022
 

Similar to Lecture 7 (20)

Lesson 09.ppt
Lesson 09.pptLesson 09.ppt
Lesson 09.ppt
 
Chapter Three(2)
Chapter Three(2)Chapter Three(2)
Chapter Three(2)
 
To lec 03
To lec 03To lec 03
To lec 03
 
theory of computation lecture 02
theory of computation lecture 02theory of computation lecture 02
theory of computation lecture 02
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........
 
Lex analysis
Lex analysisLex analysis
Lex analysis
 
5.ppt
5.ppt5.ppt
5.ppt
 
Regular Expression in Compiler design
Regular Expression in Compiler designRegular Expression in Compiler design
Regular Expression in Compiler design
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Language
LanguageLanguage
Language
 
02. chapter 3 lexical analysis
02. chapter 3   lexical analysis02. chapter 3   lexical analysis
02. chapter 3 lexical analysis
 
Chapter Two(1)
Chapter Two(1)Chapter Two(1)
Chapter Two(1)
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
 
theory of computation notes. introduction and mcq points
theory of computation notes. introduction and mcq pointstheory of computation notes. introduction and mcq points
theory of computation notes. introduction and mcq points
 

Recently uploaded

Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 

Lecture 7

  • 1. Lecture # 7 Automata Theory and formal languages (CSC-307) Muhamad Shahzeb
  • 2. Defining Languages (continued)…  (Transition Graph) Definition: A Transition graph (TG), is a collection of the followings 1. Finite number of states, at least one of which is start state and some (maybe none) final states. 2. Finite set of input letters (Σ) from which input strings are formed. 3. Finite set of transitions that show how to go from one state to another based on reading specified substrings of input letters, possibly even the null string Λ.
  • 3. Deterministic vs Non-Determeinistic Models  In deterministic finite automata, there's exactly one state transition for every input symbol-state pair. There are also no epsilon transitions, meaning that you're not allowed to change states without consuming anything from the input.  In non-deterministic finite automata, there can be 0 or more state transitions for every input-state pair. You can also have epsilon transitions.
  • 4. Note It is to be noted that in TG there may exist more than one paths for certain string, while there may not exist any path for certain string as well. If there exists at least one path for a certain string, starting from initial state and ending in a final state, the string is supposed to be accepted by the TG, otherwise the string is supposed to be rejected. Obviously collection of accepted strings is the language accepted by the TG.
  • 5. Example Consider the Language L , defined over Σ = {a, b} of all strings including Λ. The language L may be accepted by the following TG The language L may also be accepted by the following TG
  • 7. Example Consider the language L of strings, defined over Σ={a, b}, starting with b. The language L may be expressed by RE b(a + b)* , may be accepted by the following TG
  • 8. Example Consider the language L of strings, defined over Σ={a, b}, not ending in b. The language L may be expressed by RE Λ + (a + b)*a , may be accepted by the following TG
  • 9. Example Consider the Language L of strings, defined over Σ = {a, b}, containing double a. The language L may be expressed by the following regular expression (a+b)* (aa) (a+b)* This language may be accepted by the following TG
  • 10. Example Continued … Multiple paths (options) are visible for Double a.
  • 11. Example Consider the language L of strings, defined over Σ={a, b}, having double a or double b. The language L can be expressed by RE (a+b)* (aa + bb) (a+b)* The above language may also be expressed by the following TGs.
  • 13. OR
  • 14. OR
  • 15. Note In the above TG if the states are not labeled then it may not be considered to be a single TG
  • 16. Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. The language L may be expressed by RE (a+b)* (aaa + bbb) (a+b)* This language may be accepted by the following TG
  • 18. OR
  • 19. OR
  • 20. Example Consider the language L of strings, defined over Σ = {a, b}, beginning and ending in different letters. The language L may be expressed by RE a(a + b)*b + b(a + b)*a The language L may be accepted by the following TG
  • 22. Example Consider the Language L of strings of length two or more, defined over Σ = {a, b}, beginning with and ending in same letters. The language L may be expressed by the following regular expression a(a + b)*a + b(a + b)*b This language may be accepted by the following TG
  • 24. Example Consider the EVEN-EVEN language, defined over Σ={a, b}. As discussed earlier that EVEN-EVEN language can be expressed by a regular expression ( aa + bb + (ab+ba)(aa+bb)*(ab+ba) )* The language EVEN-EVEN may be accepted by the following TG
  • 26. Example Consider the language L, defined over Σ={a, b}, in which a’s occur only in even clumps (bundles) and that ends in three or more b’s. The language L can be expressed by its regular expression (aa)*b ( b+(aa(aa)*b) )* bb OR (aa)*b ( b+(aa)+ b )* bb OR Think another RE The language L may be accepted by the following TG
  • 28. Generalized Transition Graphs  A generalized transition graph (GTG) is a collection of three things: 1. Finite number of states, at least one of which is start state and some (maybe none) final states. 2. Finite set of input letters (Σ) from which input strings are formed. 3. Directed edges connecting some pair of states labeled with regular expression It may be noted that in GTG, the labels of transition edges are corresponding regular expressions
  • 29. Example Consider the language L of strings, defined over Σ={a,b}, containing double a or double b. The language L can be expressed by the following regular expression (a+b)* (aa + bb) (a+b)* The language L may be accepted by the following GTG.
  • 31. Example Consider the language L of strings, defined over Σ={a,b},that start and ends with different letters. The language L can be expressed by the following regular expression a(a+b)*b + b(a+b)*a The language L may be accepted by the following GTG.

Editor's Notes

  1. bbaabbb ??