SlideShare uma empresa Scribd logo
1 de 29
Lecture # 6
Automata Theory and formal languages
(CSC-307)
Muhammad Shahzeb
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
It is to be noted that if the condition on the length
of string is not imposed in the above language
then the strings a and b will then belong to
the language.
This language L may be accepted by the following
FA
Example Continued …
Example
Consider the Language L of Strings , defined over
Σ = {a, b}, beginning with and ending in
different letters.
The language L may be expressed by the
following regular expression
a (a + b)* b + b (a + b)* a
This language may be accepted by the following
FA
Example Continued …
Example
Consider the Language L , defined over
Σ = {a, b} of all strings including Λ, The
language L may be accepted by the following FA
The language L may also be accepted by the
following FA
Example Continued …
The language L may be expressed by the following
regular expression
(a + b)*
Example
Consider the Language L , defined over Σ
= {a, b} of all non empty strings. The language
L may be accepted by the following FA
The above language may be expressed by the
following regular expression (a + b)+
Example
Consider the following FA, defined over Σ
= {a, b}
It is to be noted that the above FA does not
accept any string. Even it does not accept the
null string. As there is no path starting from
initial state and ending in final state.
Equivalent FAs
It is to be noted that two FAs are said to be
equivalent, if they accept the same language, as
shown in the following FAs.
Equivalent FAs Continued …
FA1
FA2
Note (Equivalent FAs)
FA1 has already been discussed, while in FA2,
there is no final state and in FA3, there is a final
state but FA3 is disconnected as the states 2 and 3
are disconnected.
It may also be noted that the language (empty
language) of strings accepted by FA1 , FA2 and FA3
is denoted by the empty set i.e.
{ } OR Ø
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
FA
Example Continued …
Example
Consider the language L of strings, defined over
Σ={0, 1}, having double 0’s or double 1’s,
The language L may be expressed by the regular
expression
(0+1)* (00 + 11) (0+1)*
This language may be accepted by the following FA
Example Continued …
Example
Consider the language L of strings, defined over
Σ={a, b}, having triple a’s or triple b’s.
The language L may be expressed by RE
(a+b)* (aaa + bbb) (a+b)*
This language may be accepted by the following FA
Example Continued …
Example
Consider the EVEN-EVEN language, defined
over Σ={a, b}.
As discussed earlier that EVEN-EVEN language
can be expressed by the regular expression
( aa+bb+(ab+ba)(aa+bb)*(ab+ba) )*
EVEN-EVEN language may be accepted by the
following FA
Example Continued …
FA corresponding to finite languages
Example
Consider the language
L = {Λ, b, ab, bb}, defined over
Σ ={a, b}, expressed by
Λ + b + ab + bb OR Λ + b (Λ + a + b)
The language L may be accepted by the following
FA
Example continued …
Example
Consider the language
L = {aa, bab, aabb, bbba}, defined over
Σ ={a, b}, expressed by
aa + bab + aabb + bbba
OR aa (Λ + bb) + b (ab + bba)
The above language may be accepted by the
following FA
Example Continued …
Example
Consider
The language L expressed by the regular
expression
(a+b)*(ab+ba)
This language may be accepted by the following
FA
Example Continued …
Example
Consider
The language expressed by the regular
expression
Λ + a + b + (a+b)*(ab+ba+bb)
This language may be accepted by the following
FA
Example Continued …
Thank You…

Mais conteúdo relacionado

Mais procurados (20)

Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
Lesson 05
Lesson 05Lesson 05
Lesson 05
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Language
LanguageLanguage
Language
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Lesson 04
Lesson 04Lesson 04
Lesson 04
 
Lesson 08
Lesson 08Lesson 08
Lesson 08
 
Lesson 09
Lesson 09Lesson 09
Lesson 09
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata Theory
 
Finite automata
Finite automataFinite automata
Finite automata
 
Lesson 11
Lesson 11Lesson 11
Lesson 11
 
FInite Automata
FInite AutomataFInite Automata
FInite Automata
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular Languages
 
Generalized transition graphs
Generalized transition graphsGeneralized transition graphs
Generalized transition graphs
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 

Semelhante a Lecture 6

Semelhante a Lecture 6 (20)

5.ppt
5.ppt5.ppt
5.ppt
 
To lec 03
To lec 03To lec 03
To lec 03
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
 
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
 
theory of computation lecture 02
theory of computation lecture 02theory of computation lecture 02
theory of computation lecture 02
 
Theory of Automata Lesson 01
 Theory of Automata Lesson 01  Theory of Automata Lesson 01
Theory of Automata Lesson 01
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Lesson 01.ppt
Lesson 01.pptLesson 01.ppt
Lesson 01.ppt
 
Lesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptLesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.ppt
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Lesson 12
Lesson 12Lesson 12
Lesson 12
 
Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Regular Expression in Compiler design
Regular Expression in Compiler designRegular Expression in Compiler design
Regular Expression in Compiler design
 
Ch2 automata.pptx
Ch2 automata.pptxCh2 automata.pptx
Ch2 automata.pptx
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
Cs419 lec4 lexical analysis using re
Cs419 lec4   lexical analysis using reCs419 lec4   lexical analysis using re
Cs419 lec4 lexical analysis using re
 
Lesson 09.ppt
Lesson 09.pptLesson 09.ppt
Lesson 09.ppt
 

Último

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 

Último (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Lecture 6

  • 1. Lecture # 6 Automata Theory and formal languages (CSC-307) Muhammad Shahzeb
  • 2. 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 It is to be noted that if the condition on the length of string is not imposed in the above language then the strings a and b will then belong to the language. This language L may be accepted by the following FA
  • 4. Example Consider the Language L of Strings , defined over Σ = {a, b}, beginning with and ending in different letters. The language L may be expressed by the following regular expression a (a + b)* b + b (a + b)* a This language may be accepted by the following FA
  • 6. Example Consider the Language L , defined over Σ = {a, b} of all strings including Λ, The language L may be accepted by the following FA The language L may also be accepted by the following FA
  • 7. Example Continued … The language L may be expressed by the following regular expression (a + b)*
  • 8. Example Consider the Language L , defined over Σ = {a, b} of all non empty strings. The language L may be accepted by the following FA The above language may be expressed by the following regular expression (a + b)+
  • 9. Example Consider the following FA, defined over Σ = {a, b} It is to be noted that the above FA does not accept any string. Even it does not accept the null string. As there is no path starting from initial state and ending in final state.
  • 10. Equivalent FAs It is to be noted that two FAs are said to be equivalent, if they accept the same language, as shown in the following FAs.
  • 11. Equivalent FAs Continued … FA1 FA2
  • 12. Note (Equivalent FAs) FA1 has already been discussed, while in FA2, there is no final state and in FA3, there is a final state but FA3 is disconnected as the states 2 and 3 are disconnected. It may also be noted that the language (empty language) of strings accepted by FA1 , FA2 and FA3 is denoted by the empty set i.e. { } OR Ø
  • 13. 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 FA
  • 15. Example Consider the language L of strings, defined over Σ={0, 1}, having double 0’s or double 1’s, The language L may be expressed by the regular expression (0+1)* (00 + 11) (0+1)* This language may be accepted by the following FA
  • 17. Example Consider the language L of strings, defined over Σ={a, b}, having triple a’s or triple b’s. The language L may be expressed by RE (a+b)* (aaa + bbb) (a+b)* This language may be accepted by the following FA
  • 19. Example Consider the EVEN-EVEN language, defined over Σ={a, b}. As discussed earlier that EVEN-EVEN language can be expressed by the regular expression ( aa+bb+(ab+ba)(aa+bb)*(ab+ba) )* EVEN-EVEN language may be accepted by the following FA
  • 21. FA corresponding to finite languages Example Consider the language L = {Λ, b, ab, bb}, defined over Σ ={a, b}, expressed by Λ + b + ab + bb OR Λ + b (Λ + a + b) The language L may be accepted by the following FA
  • 23. Example Consider the language L = {aa, bab, aabb, bbba}, defined over Σ ={a, b}, expressed by aa + bab + aabb + bbba OR aa (Λ + bb) + b (ab + bba) The above language may be accepted by the following FA
  • 25. Example Consider The language L expressed by the regular expression (a+b)*(ab+ba) This language may be accepted by the following FA
  • 27. Example Consider The language expressed by the regular expression Λ + a + b + (a+b)*(ab+ba+bb) This language may be accepted by the following FA