SlideShare a Scribd company logo
1 of 23
Lecture # 8
Automata Theory and formal languages
(CSC-307)
Muhammad Shahzeb
Example
Consider the language L of strings of, 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
GTG
Example Continued …
Another option of GTG for above language L
Example Continued …
Example
Consider the language L of strings, defined over
Σ={a, b}, having 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
GTG
Example Continued …
OR
NonDeterminism
TGs and GTGs provide certain relaxations i.e.
there may exist more than one path for a certain
string or there may not be any path for a certain
string, this property creates nondeterminism
and it can also help in differentiating TGs or
GTGs from FAs.
Hence an FA is also called a Deterministic Finite
Automaton (DFA).
Kleene’s Theorem
If a language can be expressed by
1. FA or
2. TG or
3. RE
then it can also be expressed by other two as well.
 It may be noted that the theorem is proved,
proving the following three parts
Kleene’s Theorem continued …
Kleene’s Theorem Part I
If a language can be accepted by an FA then it
can be accepted by a TG as well.
Kleene’s Theorem Part II
If a language can be accepted by a TG then it can
be expressed by an RE as well.
Kleene’s Theorem Part III
If a language can be expressed by a RE then it
can be accepted by an FA as well
Kleene’s Theorem continued …
Proof(Kleene’s Theorem Part I)
Since every FA can be considered to be a TG as
well, therefore there is nothing to prove.
Kleene’s Theorem continued …
Proof(Kleene’s Theorem Part II)
To prove part II of the theorem, an algorithm
consisting of different steps, is explained showing
how a RE can be obtained corresponding to the
given TG. For this purpose the notion of TG is
changed to that of GTG i.e. the labels of
transitions are corresponding REs.
Kleene’s Theorem part II cont …
Objective of Algorithm:
Basically this algorithm converts the given TG to
GTG with one initial state along with a single loop,
or one initial state connected with one final state
by a single transition edge. The label of the loop or
the transition edge will be the required RE.
Kleene’s Theorem part II cont …
Step 1
If a TG has more than one start states, then
introduce a new start state connecting the new
state to the old start states by the transitions
labeled by Λ and make the old start states the non-
start states. This step can be shown by the
following example
Example
Example Continued ...
Kleene’s Theorem part II
Step 2:
If a TG has more than one final states, then
introduce a new final state, connecting the old
final states to the new final state by the
transitions labeled by Λ.
This step can be shown by the previous example
of TG, where the step 1 has already been
processed
Example continued …
Kleene’s Theorem part II
Step 3:
If a state has two (more than one) incoming
transition edges labeled by the corresponding
REs, from the same state (including the
possibility of loops at a state), then replace all
these transition edges with a single transition
edge labeled by the sum of corresponding REs.
This step can be shown by a part of TG in the
following example
Example
The above TG can be reduced to
Note
The step 3 can be generalized to any finite
number of transitions as shown below
The above TG can be reduced to
Kleene’s Theorem part II
Step 4 (bypass and state elimination)
If three states in a TG, are connected in sequence
then eliminate the middle state and connect the
first state with the third by a single transition
(include the possibility of circuit as well) labeled by
the RE which is the concatenation of
corresponding two REs in the existing sequence.
This step can be shown by a part of TG in the
following example
Example
To eliminate state 5 the above can be reduced to
Consider the following example containing a
circuit
Example
Consider the part of a TG, containing a circuit at
a state, as shown below
To eliminate state 3 the above TG can be reduced
to

More Related Content

What's hot (20)

Lesson 09
Lesson 09Lesson 09
Lesson 09
 
Lesson 11
Lesson 11Lesson 11
Lesson 11
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
Lesson 05
Lesson 05Lesson 05
Lesson 05
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Generalized transition graphs
Generalized transition graphsGeneralized transition graphs
Generalized transition graphs
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
FInite Automata
FInite AutomataFInite Automata
FInite Automata
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languages
 
Language
LanguageLanguage
Language
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
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. ...
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
 
pushdown automata
pushdown automatapushdown automata
pushdown automata
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 

Similar to Lecture 8

Advanced Engineering Mathematics Chapter 6 Laplace Transforms
Advanced Engineering Mathematics Chapter 6 Laplace TransformsAdvanced Engineering Mathematics Chapter 6 Laplace Transforms
Advanced Engineering Mathematics Chapter 6 Laplace TransformsSarah Brown
 
Chapter Three(2)
Chapter Three(2)Chapter Three(2)
Chapter Three(2)bolovv
 

Similar to Lecture 8 (7)

Kleene's theorem
Kleene's theoremKleene's theorem
Kleene's theorem
 
Advanced Engineering Mathematics Chapter 6 Laplace Transforms
Advanced Engineering Mathematics Chapter 6 Laplace TransformsAdvanced Engineering Mathematics Chapter 6 Laplace Transforms
Advanced Engineering Mathematics Chapter 6 Laplace Transforms
 
Chapter Three(2)
Chapter Three(2)Chapter Three(2)
Chapter Three(2)
 
PRINCEPPTFINAL.pptx
PRINCEPPTFINAL.pptxPRINCEPPTFINAL.pptx
PRINCEPPTFINAL.pptx
 
jfigs.pdf
jfigs.pdfjfigs.pdf
jfigs.pdf
 
03 time and motion
03 time and motion03 time and motion
03 time and motion
 
MSc_thesis
MSc_thesisMSc_thesis
MSc_thesis
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

Lecture 8

  • 1. Lecture # 8 Automata Theory and formal languages (CSC-307) Muhammad Shahzeb
  • 2. Example Consider the language L of strings of, 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 GTG
  • 3. Example Continued … Another option of GTG for above language L
  • 5. Example Consider the language L of strings, defined over Σ={a, b}, having 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 GTG
  • 7. NonDeterminism TGs and GTGs provide certain relaxations i.e. there may exist more than one path for a certain string or there may not be any path for a certain string, this property creates nondeterminism and it can also help in differentiating TGs or GTGs from FAs. Hence an FA is also called a Deterministic Finite Automaton (DFA).
  • 8. Kleene’s Theorem If a language can be expressed by 1. FA or 2. TG or 3. RE then it can also be expressed by other two as well.  It may be noted that the theorem is proved, proving the following three parts
  • 9. Kleene’s Theorem continued … Kleene’s Theorem Part I If a language can be accepted by an FA then it can be accepted by a TG as well. Kleene’s Theorem Part II If a language can be accepted by a TG then it can be expressed by an RE as well. Kleene’s Theorem Part III If a language can be expressed by a RE then it can be accepted by an FA as well
  • 10. Kleene’s Theorem continued … Proof(Kleene’s Theorem Part I) Since every FA can be considered to be a TG as well, therefore there is nothing to prove.
  • 11. Kleene’s Theorem continued … Proof(Kleene’s Theorem Part II) To prove part II of the theorem, an algorithm consisting of different steps, is explained showing how a RE can be obtained corresponding to the given TG. For this purpose the notion of TG is changed to that of GTG i.e. the labels of transitions are corresponding REs.
  • 12. Kleene’s Theorem part II cont … Objective of Algorithm: Basically this algorithm converts the given TG to GTG with one initial state along with a single loop, or one initial state connected with one final state by a single transition edge. The label of the loop or the transition edge will be the required RE.
  • 13. Kleene’s Theorem part II cont … Step 1 If a TG has more than one start states, then introduce a new start state connecting the new state to the old start states by the transitions labeled by Λ and make the old start states the non- start states. This step can be shown by the following example
  • 16. Kleene’s Theorem part II Step 2: If a TG has more than one final states, then introduce a new final state, connecting the old final states to the new final state by the transitions labeled by Λ. This step can be shown by the previous example of TG, where the step 1 has already been processed
  • 18. Kleene’s Theorem part II Step 3: If a state has two (more than one) incoming transition edges labeled by the corresponding REs, from the same state (including the possibility of loops at a state), then replace all these transition edges with a single transition edge labeled by the sum of corresponding REs. This step can be shown by a part of TG in the following example
  • 19. Example The above TG can be reduced to
  • 20. Note The step 3 can be generalized to any finite number of transitions as shown below The above TG can be reduced to
  • 21. Kleene’s Theorem part II Step 4 (bypass and state elimination) If three states in a TG, are connected in sequence then eliminate the middle state and connect the first state with the third by a single transition (include the possibility of circuit as well) labeled by the RE which is the concatenation of corresponding two REs in the existing sequence. This step can be shown by a part of TG in the following example
  • 22. Example To eliminate state 5 the above can be reduced to Consider the following example containing a circuit
  • 23. Example Consider the part of a TG, containing a circuit at a state, as shown below To eliminate state 3 the above TG can be reduced to