SlideShare a Scribd company logo
1 of 20
1
Recap Lecture 4
Regular expression of EVEN-EVEN language,
Difference between a* + b* and (a+b)*,
Equivalent regular expressions; sum, product
and closure of regular expressions; regular
languages, finite languages are regular,
introduction to finite automaton, definition of
FA, transition table, transition diagram.
2
Note
It may be noted that to indicate the initial state,
an arrow head can also be placed before that
state and that the final state with double circle,
as shown below. It is also to be noted that while
expressing an FA by its transition diagram, the
labels of states are not necessary.
a, b
a, b
3
Example
Σ = {a,b}
States: x, y, where x is both initial and final
state.
Transitions:
1.At state x reading a or b go to state y.
2.At state y reading a or b go to state x.
4
Example Continued …
These transitions can be expressed by the
following transition table
Old States New States
Reading
a
Reading
b
x ± y y
y x x
5
Example Continued …
It may be noted that the previous transition
table may be depicted by the following
transition diagram.
y
a, b
x 
a, b
6
Example Continued …
The previous transition diagram is an FA
accepting the language of strings, defined over
Σ={a, b} of even length. It may be noted
that this language may be expressed by the
regular expression
((a+ b) (a + b))*
7
TASK
Build an FA for the language L of strings,
defined over Σ={a, b}, of odd length.
8
Solution of Task
+
a,b
–
a,b
9
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 FA
a,b
a,b
b
a
–– +
1
10
Example:
Consider the language L of strings, defined
over Σ={a, b}, ending in a. The language L
may be expressed by RE
(a+b)*
a
This language may be accepted by the following
FA
11
Example Continued …
There may be another FA corresponding to the
given language.
a
b
+
b
–
a
12
Example continued …
a
b
b
b
a
+
a
––
13
Note
It may be noted that corresponding to a given
language there may be more than one FA
accepting that language, but for a given FA
there is a unique language accepted by that FA.
14
Note
It is to be noted that given the languages L1 and
L2 ,where
L1 = The language of strings, defined over
Σ={a, b}, beginning with a
L2 = The language of strings, defined over
Σ={a, b}, not beginning with b
The  does not belong to L1 while it does belong
to L2 . This fact may be depicted by the
corresponding transition diagrams of L1 and L2.
15
FA1
Corresponding to L1
The language L1
may be expressed by the
regular expression a(a + b)*
a,b
a
b a,b
–– +
16
FA2
Corresponding to L2
The language L2
may be expressed by the
regular expression a (a + b)*
+ Λ
a,b
a,b
a
b
 +
17
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
18
Example Continued …
b
a
a
b
+
a
b
b
a
+
b
a
–
19
Task
Build an FA accepting the Language L of Strings,
defined over Σ = {a, b}, beginning with and
ending in same letters.
20
Summing Up
Different notations of transition diagrams,
languages of strings of even length, Odd
length, starting with b, ending in a,
beginning with b, not beginning with b,
beginning and ending in same letters;

More Related Content

Similar to 5.ppt

CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...parmeet834
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of AutomataFarooq Mian
 
Theory of Automata Lesson 01
 Theory of Automata Lesson 01  Theory of Automata Lesson 01
Theory of Automata Lesson 01 hamzamughal39
 
Lesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptLesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptashja1
 
Lesson 01.ppt
Lesson 01.pptLesson 01.ppt
Lesson 01.pptImXaib
 
Problemes chap1 toc
Problemes chap1 tocProblemes chap1 toc
Problemes chap1 tocparmeet834
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2shah zeb
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02hamzamughal39
 
Regular Expression in Compiler design
Regular Expression in Compiler designRegular Expression in Compiler design
Regular Expression in Compiler designRiazul Islam
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxRaviAr5
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFAMaulik Togadiya
 
DFA Assignment solution.pptx
DFA Assignment solution.pptxDFA Assignment solution.pptx
DFA Assignment solution.pptxKamran Zafar
 

Similar to 5.ppt (20)

Lecture 7
Lecture 7Lecture 7
Lecture 7
 
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
 
Hwsoln03 toc
Hwsoln03 tocHwsoln03 toc
Hwsoln03 toc
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Theory of Automata Lesson 01
 Theory of Automata Lesson 01  Theory of Automata Lesson 01
Theory of Automata Lesson 01
 
Lesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptLesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.ppt
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
 
Lesson 01.ppt
Lesson 01.pptLesson 01.ppt
Lesson 01.ppt
 
Problemes chap1 toc
Problemes chap1 tocProblemes chap1 toc
Problemes chap1 toc
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2
 
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 02
Lesson 02Lesson 02
Lesson 02
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Regular Expression in Compiler design
Regular Expression in Compiler designRegular Expression in Compiler design
Regular Expression in Compiler design
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFA
 
To lec 04
To lec 04To lec 04
To lec 04
 
DFA Assignment solution.pptx
DFA Assignment solution.pptxDFA Assignment solution.pptx
DFA Assignment solution.pptx
 
TOC question bank.pdf
TOC question bank.pdfTOC question bank.pdf
TOC question bank.pdf
 

Recently uploaded

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
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
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
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
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
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
 

Recently uploaded (20)

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
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
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
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
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
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
 

5.ppt

  • 1. 1 Recap Lecture 4 Regular expression of EVEN-EVEN language, Difference between a* + b* and (a+b)*, Equivalent regular expressions; sum, product and closure of regular expressions; regular languages, finite languages are regular, introduction to finite automaton, definition of FA, transition table, transition diagram.
  • 2. 2 Note It may be noted that to indicate the initial state, an arrow head can also be placed before that state and that the final state with double circle, as shown below. It is also to be noted that while expressing an FA by its transition diagram, the labels of states are not necessary. a, b a, b
  • 3. 3 Example Σ = {a,b} States: x, y, where x is both initial and final state. Transitions: 1.At state x reading a or b go to state y. 2.At state y reading a or b go to state x.
  • 4. 4 Example Continued … These transitions can be expressed by the following transition table Old States New States Reading a Reading b x ± y y y x x
  • 5. 5 Example Continued … It may be noted that the previous transition table may be depicted by the following transition diagram. y a, b x  a, b
  • 6. 6 Example Continued … The previous transition diagram is an FA accepting the language of strings, defined over Σ={a, b} of even length. It may be noted that this language may be expressed by the regular expression ((a+ b) (a + b))*
  • 7. 7 TASK Build an FA for the language L of strings, defined over Σ={a, b}, of odd length.
  • 9. 9 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 FA a,b a,b b a –– + 1
  • 10. 10 Example: Consider the language L of strings, defined over Σ={a, b}, ending in a. The language L may be expressed by RE (a+b)* a This language may be accepted by the following FA
  • 11. 11 Example Continued … There may be another FA corresponding to the given language. a b + b – a
  • 13. 13 Note It may be noted that corresponding to a given language there may be more than one FA accepting that language, but for a given FA there is a unique language accepted by that FA.
  • 14. 14 Note It is to be noted that given the languages L1 and L2 ,where L1 = The language of strings, defined over Σ={a, b}, beginning with a L2 = The language of strings, defined over Σ={a, b}, not beginning with b The  does not belong to L1 while it does belong to L2 . This fact may be depicted by the corresponding transition diagrams of L1 and L2.
  • 15. 15 FA1 Corresponding to L1 The language L1 may be expressed by the regular expression a(a + b)* a,b a b a,b –– +
  • 16. 16 FA2 Corresponding to L2 The language L2 may be expressed by the regular expression a (a + b)* + Λ a,b a,b a b  +
  • 17. 17 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
  • 19. 19 Task Build an FA accepting the Language L of Strings, defined over Σ = {a, b}, beginning with and ending in same letters.
  • 20. 20 Summing Up Different notations of transition diagrams, languages of strings of even length, Odd length, starting with b, ending in a, beginning with b, not beginning with b, beginning and ending in same letters;