SlideShare a Scribd company logo
8
Most read
9
Most read
12
Most read
Closure Properties of DFAs
CSE 2233
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Regular Language
2
Language:
A set of strings all of which are chosen from some Σ∗
, where Σ is a particular alphabet, is
called a language.
Regular Language:
Regular languages are the languages recognized by DFA’s, by NFA’s, and 𝜀-NFA’s. They are
also the languages defined by regular expressions.
Ex.
If alphabet 𝛴 = { 0, 1 }
then 𝛴* = set of all strings over 𝛴 = { 𝜀, 0, 1, 00, 01, 10, 11, 000, … … } = 𝛴0 U 𝛴1 U 𝛴2 U … … …
Language, L = { w | w ends with 101 } = { 101, 0101, 1101, … … } ⊆ 𝛴*
If we can design a DFA or NFA or 𝜀-NFA that can recognize L or, if we can define a regular expression
then L will be a Regular Language.
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Regular Operations
3
– Arithmetic operations create a new value from 1 or 2 existing values (eg. 2+3)
– Similarly Regular operations create a new language from 1 or 2 existing languages.
We define 3 regular operations (using languages A and B):
• Union: A U B = { x | x ∈ A or x ∈ B }
• Concatenation: A o B = AB = { xy | x ∈ A and x ∈ B }
• Star: A* = { x1x2x3 … … xk | k>=0 and each xi ∈ A }
Here, languages A and B don’t have to be regular always.
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Regular Operations - Example
Let,
Alphabet Σ = { a, b, c, … … … , z }
Language A = { good, bad } ⊆ Σ*
Language B = { boy, girl } ⊆ Σ*
Then,
A⋃B = { good, bad, boy, girl }
AB = { goodboy, goodgirl, badboy, badgirl }
A* = { ℰ, good, bad, goodgood, goodbad, badgood, badbad, goodgoodgood, goodgoodbad, … … }
4
Mohammad Imam Hossain | Lecturer, dept. of CSE | UIU
Other Operations
5
Let A and B be languages, then
 Intersection:
A ∩ B = { x | x ∈ A and x ∈ B } = ҧ𝐴 ∪ ത𝐵
 Complementation:
ҧ𝐴 = { x | x ∉ A }
 Subtraction:
A − B ={ x | x ∈ A and x ∉ B } = A ∩ ത𝐵
 Reverse:
AR = { w1 . . . wk | wk . . . w1 𝜖 A }
ex. if A = { 001, 10, 111 } then AR = { 100, 01, 111 }
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Closure Properties of DFAs
6
Languages captured by DFA’s are closed under
 Union
 Concatenation
 Star
 Intersection
 Complement
 Subtraction
 Reverse
Closure Property:
if language L1 and L2 are recognized by a DFA then there exists another DFA that will also
recognize the new language L3 generated by performing any of the above mentioned operation.
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Operation 1 - Union
7
Let, Machine M1 recognizes A1, where M1 = ( Q1, Σ, 𝛿1, q1, F1 )
and Machine M2 recognizes A2, where M2 = ( Q2, Σ, 𝛿2, q2, F2 )
To construct M that can recognize A1 ∪ A2 , here M = ( Q, Σ, 𝛿, q0, F )
▸ Q = { (r1, r2) | r1 ∈ Q1 and r2 ∈ Q2 }
▸ Σ will remain same
▸ Transition function: 𝛿 ( (r1 , r2 ) , a ) = ( 𝛿1 (r1, a), 𝛿2 (r2 , a) )
▸ q0 = ( q1 , q2 )
▸ F = { (r1 , r2 ) | r1 ∈ F1 or r2 ∈ F2 }
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Union Operation – Example 1
8
Problem:
The set of strings containing even number of 0’s or even number of 1’s over Σ = { 0, 1 }
Part 1 :
Set of strings containing
even number of 0’s and
any number of 1’s
Part 2:
Set of strings containing
even number of 1’s and
any number of 0’s
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
union
Union Operation – Example 2
9
Problem:
The set of strings either ending with 01 or 10 over Σ = { 0, 1 }
Part 1 :
Set of strings ending with 01
Part 2:
Set of strings ending with 10
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
union
Union Operation – Practices
10
1) The set of strings either begin or end with 01
2) The set of strings with 01 or 10 as substring
3) The set of strings starts and ends with the same symbol over Σ = { 0 ,1 }
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Operation 2 - Intersection
11
Let, M1 recognizes A1, where M1 = ( Q1, Σ, 𝛿1, q1, F1 )
and M2 recognizes A2 where M2 = ( Q2, Σ, 𝛿2, q2, F2 )
To construct M that can recognize A1 ∩ A2 , here M = ( Q, Σ, 𝛿, q0, F )
▸ Q = { (r1, r2) | r1 ∈ Q1 and r2 ∈ Q2 }
▸ Σ will remain same
▸ Transition function: 𝛿 ( (r1 , r2 ) , a ) = ( 𝛿1 (r1, a), 𝛿2 (r2 , a) )
▸ q0 = ( q1 , q2 )
▸ F = { (r1 , r2 ) | r1 ∈ F1 and r2 ∈ F2 }
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Problem:
L(M) = { w | w has an even number of a’s and each a is followed by at least one b }
Part 1 :
L(M1) = { w | w has an even number of a’s}
Part 2:
L(M2) = { w | each a in w is followed by at least one b}
Intersection Operation – Example 1
12
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
intersection
Problem:
L(M) = { w | w has exactly two a’s and at least two b’s }
Part 1 :
L(M1) = { w | w has exactly two a’s }
Part 2:
L(M2) = { w | w has at least two b’s }
Intersection Operation – Example 2
13
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
intersection
Intersection Operation – Practices
14
1) { w | w has at least three a’s and at least two b’s }
2) { w | w has exactly two a’s and at least two b’s }
3) { w | w has an even number of a’s and at most two b’s }
4) { w | w has an even number of a’s and each a is followed by at least one b }
5) { w | w starts with an a and has at most one b }
6) { w | w has an odd number of a’s and ends with a b }
7) { w | w has even length and an odd number of a’s }
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Operation 3 - Complement
15
Technique:
Convert all the general states to final states and all the final states to general states.
L = Set of binary strings those are multiple of 3
ത𝐿 = Set of binary strings those are not a multiple of 3
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Complement Operation – Practices
16
1) L(M) = { w | w does not contain the substring ab}
2) L(M) = { w | w does not contain the substring baba }
3) L(M) = { w | w contains neither the substrings ab nor ba }
4) L(M) = { w | w is any string that doesn’t contain exactly two a’s }
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
17
THANKS!
Any questions?
You can find me at imam@cse.uiu.ac.bd
References:
Chapter 1(section 1.1), Introduction to the Theory of Computation, 3rd Edition by Michael Sipser

More Related Content

PPTX
Regular expressions
Ratnakar Mikkili
 
PPT
Intro automata theory
Rajendran
 
PPTX
Context free grammar
Mohammad Ilyas Malik
 
PDF
Lecture: Automata
Marina Santini
 
PDF
Pumping lemma for cfl
Muhammad Zohaib Chaudhary
 
PDF
TOC 2 | Deterministic Finite Automata
Mohammad Imam Hossain
 
PPTX
language , grammar and automata
ElakkiyaS11
 
PPTX
Turing Machine
AniketKandara1
 
Regular expressions
Ratnakar Mikkili
 
Intro automata theory
Rajendran
 
Context free grammar
Mohammad Ilyas Malik
 
Lecture: Automata
Marina Santini
 
Pumping lemma for cfl
Muhammad Zohaib Chaudhary
 
TOC 2 | Deterministic Finite Automata
Mohammad Imam Hossain
 
language , grammar and automata
ElakkiyaS11
 
Turing Machine
AniketKandara1
 

What's hot (20)

PPTX
Decision properties of reular languages
SOMNATHMORE2
 
PPTX
1.10. pumping lemma for regular sets
Sampath Kumar S
 
PPTX
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
PPTX
Mealy and moore machine
Ehatsham Riaz
 
PPTX
CFG to CNF
Zain Ul Abiden
 
PPTX
push down automata
Christopher Chizoba
 
DOCX
Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...
Farwa Ansari
 
PPTX
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Mohammad Ilyas Malik
 
PPT
Chomsky Hierarchy.ppt
AayushSingh233965
 
PPTX
Equivalence of DFAs and NFAs.pptx
SamyakJain710491
 
PDF
TOC 1 | Introduction to Theory of Computation
Mohammad Imam Hossain
 
PPT
Lecture 3,4
shah zeb
 
PPTX
Elements of dynamic programming
Tafhim Islam
 
PPTX
Introduction TO Finite Automata
Ratnakar Mikkili
 
PPT
Theory of Automata
Farooq Mian
 
PPT
POST’s CORRESPONDENCE PROBLEM
Rajendran
 
PPTX
Access to non local names
Varsha Kumar
 
PDF
Formal Languages and Automata Theory Unit 1
Srimatre K
 
PPT
pushdown automata
Sujata Pardeshi
 
DOCX
Automata theory
colleges
 
Decision properties of reular languages
SOMNATHMORE2
 
1.10. pumping lemma for regular sets
Sampath Kumar S
 
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
Mealy and moore machine
Ehatsham Riaz
 
CFG to CNF
Zain Ul Abiden
 
push down automata
Christopher Chizoba
 
Introduction to Computer theory (Automata Theory) 2nd Edition By Denial I.A. ...
Farwa Ansari
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Mohammad Ilyas Malik
 
Chomsky Hierarchy.ppt
AayushSingh233965
 
Equivalence of DFAs and NFAs.pptx
SamyakJain710491
 
TOC 1 | Introduction to Theory of Computation
Mohammad Imam Hossain
 
Lecture 3,4
shah zeb
 
Elements of dynamic programming
Tafhim Islam
 
Introduction TO Finite Automata
Ratnakar Mikkili
 
Theory of Automata
Farooq Mian
 
POST’s CORRESPONDENCE PROBLEM
Rajendran
 
Access to non local names
Varsha Kumar
 
Formal Languages and Automata Theory Unit 1
Srimatre K
 
pushdown automata
Sujata Pardeshi
 
Automata theory
colleges
 
Ad

Similar to TOC 3 | Different Operations on DFA (20)

PDF
TOC 5 | Regular Expressions
Mohammad Imam Hossain
 
PDF
Complier Design - Operations on Languages, RE, Finite Automata
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
F_Autómatas_MIT_2010--------------------
MIGUELANGEL2672
 
PDF
TOC 6 | CFG Design
Mohammad Imam Hossain
 
PPTX
Resumen material MIT
Rawel Luciano
 
PPTX
introductory Discrete structure workshop.pptx
ZahidaPerveen10
 
PDF
TOC 4 | Non-deterministic Finite Automata
Mohammad Imam Hossain
 
PDF
Theory of Computation Lecture Notes
FellowBuddy.com
 
PDF
QB104541.pdf
MrRRajasekarCSE
 
PDF
Nondeterministic Finite Automata AFN.pdf
SergioUlisesRojasAla
 
PPT
Finite automata examples
ankitamakin
 
PPT
Finite automata examples
ankitamakin
 
PPTX
BCS503 TOC Module 2 PPT.pptx VTU academic Year 2024-25 ODD SEM
VENKATESHBHAT25
 
PPT
To lec 04
Hasam Panezai
 
PPT
0227 regularlanguages
issbp
 
PPT
FiniteAutomata (1).ppt
ssuser47f7f2
 
PPT
FiniteAutomata.ppt
RohitPaul71
 
DOCX
Deterministic finite automata
Muhammad Love Kian
 
PDF
Hwsoln03 toc
parmeet834
 
PDF
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
parmeet834
 
TOC 5 | Regular Expressions
Mohammad Imam Hossain
 
Complier Design - Operations on Languages, RE, Finite Automata
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
F_Autómatas_MIT_2010--------------------
MIGUELANGEL2672
 
TOC 6 | CFG Design
Mohammad Imam Hossain
 
Resumen material MIT
Rawel Luciano
 
introductory Discrete structure workshop.pptx
ZahidaPerveen10
 
TOC 4 | Non-deterministic Finite Automata
Mohammad Imam Hossain
 
Theory of Computation Lecture Notes
FellowBuddy.com
 
QB104541.pdf
MrRRajasekarCSE
 
Nondeterministic Finite Automata AFN.pdf
SergioUlisesRojasAla
 
Finite automata examples
ankitamakin
 
Finite automata examples
ankitamakin
 
BCS503 TOC Module 2 PPT.pptx VTU academic Year 2024-25 ODD SEM
VENKATESHBHAT25
 
To lec 04
Hasam Panezai
 
0227 regularlanguages
issbp
 
FiniteAutomata (1).ppt
ssuser47f7f2
 
FiniteAutomata.ppt
RohitPaul71
 
Deterministic finite automata
Muhammad Love Kian
 
Hwsoln03 toc
parmeet834
 
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
parmeet834
 
Ad

More from Mohammad Imam Hossain (20)

PDF
DS & Algo 6 - Offline Assignment 6
Mohammad Imam Hossain
 
PDF
DS & Algo 6 - Dynamic Programming
Mohammad Imam Hossain
 
PDF
DS & Algo 5 - Disjoint Set and MST
Mohammad Imam Hossain
 
PDF
DS & Algo 4 - Graph and Shortest Path Search
Mohammad Imam Hossain
 
PDF
DS & Algo 3 - Offline Assignment 3
Mohammad Imam Hossain
 
PDF
DS & Algo 3 - Divide and Conquer
Mohammad Imam Hossain
 
PDF
DS & Algo 2 - Offline Assignment 2
Mohammad Imam Hossain
 
PDF
DS & Algo 2 - Recursion
Mohammad Imam Hossain
 
PDF
DS & Algo 1 - Offline Assignment 1
Mohammad Imam Hossain
 
PDF
DS & Algo 1 - C++ and STL Introduction
Mohammad Imam Hossain
 
PDF
DBMS 1 | Introduction to DBMS
Mohammad Imam Hossain
 
PDF
DBMS 10 | Database Transactions
Mohammad Imam Hossain
 
PDF
DBMS 3 | ER Diagram to Relational Schema
Mohammad Imam Hossain
 
PDF
DBMS 2 | Entity Relationship Model
Mohammad Imam Hossain
 
PDF
DBMS 7 | Relational Query Language
Mohammad Imam Hossain
 
PDF
DBMS 4 | MySQL - DDL & DML Commands
Mohammad Imam Hossain
 
PDF
DBMS 5 | MySQL Practice List - HR Schema
Mohammad Imam Hossain
 
PDF
TOC 10 | Turing Machine
Mohammad Imam Hossain
 
PDF
TOC 9 | Pushdown Automata
Mohammad Imam Hossain
 
PDF
TOC 8 | Derivation, Parse Tree & Ambiguity Check
Mohammad Imam Hossain
 
DS & Algo 6 - Offline Assignment 6
Mohammad Imam Hossain
 
DS & Algo 6 - Dynamic Programming
Mohammad Imam Hossain
 
DS & Algo 5 - Disjoint Set and MST
Mohammad Imam Hossain
 
DS & Algo 4 - Graph and Shortest Path Search
Mohammad Imam Hossain
 
DS & Algo 3 - Offline Assignment 3
Mohammad Imam Hossain
 
DS & Algo 3 - Divide and Conquer
Mohammad Imam Hossain
 
DS & Algo 2 - Offline Assignment 2
Mohammad Imam Hossain
 
DS & Algo 2 - Recursion
Mohammad Imam Hossain
 
DS & Algo 1 - Offline Assignment 1
Mohammad Imam Hossain
 
DS & Algo 1 - C++ and STL Introduction
Mohammad Imam Hossain
 
DBMS 1 | Introduction to DBMS
Mohammad Imam Hossain
 
DBMS 10 | Database Transactions
Mohammad Imam Hossain
 
DBMS 3 | ER Diagram to Relational Schema
Mohammad Imam Hossain
 
DBMS 2 | Entity Relationship Model
Mohammad Imam Hossain
 
DBMS 7 | Relational Query Language
Mohammad Imam Hossain
 
DBMS 4 | MySQL - DDL & DML Commands
Mohammad Imam Hossain
 
DBMS 5 | MySQL Practice List - HR Schema
Mohammad Imam Hossain
 
TOC 10 | Turing Machine
Mohammad Imam Hossain
 
TOC 9 | Pushdown Automata
Mohammad Imam Hossain
 
TOC 8 | Derivation, Parse Tree & Ambiguity Check
Mohammad Imam Hossain
 

Recently uploaded (20)

PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PDF
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 

TOC 3 | Different Operations on DFA

  • 1. Closure Properties of DFAs CSE 2233 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 2. Regular Language 2 Language: A set of strings all of which are chosen from some Σ∗ , where Σ is a particular alphabet, is called a language. Regular Language: Regular languages are the languages recognized by DFA’s, by NFA’s, and 𝜀-NFA’s. They are also the languages defined by regular expressions. Ex. If alphabet 𝛴 = { 0, 1 } then 𝛴* = set of all strings over 𝛴 = { 𝜀, 0, 1, 00, 01, 10, 11, 000, … … } = 𝛴0 U 𝛴1 U 𝛴2 U … … … Language, L = { w | w ends with 101 } = { 101, 0101, 1101, … … } ⊆ 𝛴* If we can design a DFA or NFA or 𝜀-NFA that can recognize L or, if we can define a regular expression then L will be a Regular Language. Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 3. Regular Operations 3 – Arithmetic operations create a new value from 1 or 2 existing values (eg. 2+3) – Similarly Regular operations create a new language from 1 or 2 existing languages. We define 3 regular operations (using languages A and B): • Union: A U B = { x | x ∈ A or x ∈ B } • Concatenation: A o B = AB = { xy | x ∈ A and x ∈ B } • Star: A* = { x1x2x3 … … xk | k>=0 and each xi ∈ A } Here, languages A and B don’t have to be regular always. Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 4. Regular Operations - Example Let, Alphabet Σ = { a, b, c, … … … , z } Language A = { good, bad } ⊆ Σ* Language B = { boy, girl } ⊆ Σ* Then, A⋃B = { good, bad, boy, girl } AB = { goodboy, goodgirl, badboy, badgirl } A* = { ℰ, good, bad, goodgood, goodbad, badgood, badbad, goodgoodgood, goodgoodbad, … … } 4 Mohammad Imam Hossain | Lecturer, dept. of CSE | UIU
  • 5. Other Operations 5 Let A and B be languages, then  Intersection: A ∩ B = { x | x ∈ A and x ∈ B } = ҧ𝐴 ∪ ത𝐵  Complementation: ҧ𝐴 = { x | x ∉ A }  Subtraction: A − B ={ x | x ∈ A and x ∉ B } = A ∩ ത𝐵  Reverse: AR = { w1 . . . wk | wk . . . w1 𝜖 A } ex. if A = { 001, 10, 111 } then AR = { 100, 01, 111 } Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 6. Closure Properties of DFAs 6 Languages captured by DFA’s are closed under  Union  Concatenation  Star  Intersection  Complement  Subtraction  Reverse Closure Property: if language L1 and L2 are recognized by a DFA then there exists another DFA that will also recognize the new language L3 generated by performing any of the above mentioned operation. Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 7. Operation 1 - Union 7 Let, Machine M1 recognizes A1, where M1 = ( Q1, Σ, 𝛿1, q1, F1 ) and Machine M2 recognizes A2, where M2 = ( Q2, Σ, 𝛿2, q2, F2 ) To construct M that can recognize A1 ∪ A2 , here M = ( Q, Σ, 𝛿, q0, F ) ▸ Q = { (r1, r2) | r1 ∈ Q1 and r2 ∈ Q2 } ▸ Σ will remain same ▸ Transition function: 𝛿 ( (r1 , r2 ) , a ) = ( 𝛿1 (r1, a), 𝛿2 (r2 , a) ) ▸ q0 = ( q1 , q2 ) ▸ F = { (r1 , r2 ) | r1 ∈ F1 or r2 ∈ F2 } Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 8. Union Operation – Example 1 8 Problem: The set of strings containing even number of 0’s or even number of 1’s over Σ = { 0, 1 } Part 1 : Set of strings containing even number of 0’s and any number of 1’s Part 2: Set of strings containing even number of 1’s and any number of 0’s Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU union
  • 9. Union Operation – Example 2 9 Problem: The set of strings either ending with 01 or 10 over Σ = { 0, 1 } Part 1 : Set of strings ending with 01 Part 2: Set of strings ending with 10 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU union
  • 10. Union Operation – Practices 10 1) The set of strings either begin or end with 01 2) The set of strings with 01 or 10 as substring 3) The set of strings starts and ends with the same symbol over Σ = { 0 ,1 } Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 11. Operation 2 - Intersection 11 Let, M1 recognizes A1, where M1 = ( Q1, Σ, 𝛿1, q1, F1 ) and M2 recognizes A2 where M2 = ( Q2, Σ, 𝛿2, q2, F2 ) To construct M that can recognize A1 ∩ A2 , here M = ( Q, Σ, 𝛿, q0, F ) ▸ Q = { (r1, r2) | r1 ∈ Q1 and r2 ∈ Q2 } ▸ Σ will remain same ▸ Transition function: 𝛿 ( (r1 , r2 ) , a ) = ( 𝛿1 (r1, a), 𝛿2 (r2 , a) ) ▸ q0 = ( q1 , q2 ) ▸ F = { (r1 , r2 ) | r1 ∈ F1 and r2 ∈ F2 } Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 12. Problem: L(M) = { w | w has an even number of a’s and each a is followed by at least one b } Part 1 : L(M1) = { w | w has an even number of a’s} Part 2: L(M2) = { w | each a in w is followed by at least one b} Intersection Operation – Example 1 12 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU intersection
  • 13. Problem: L(M) = { w | w has exactly two a’s and at least two b’s } Part 1 : L(M1) = { w | w has exactly two a’s } Part 2: L(M2) = { w | w has at least two b’s } Intersection Operation – Example 2 13 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU intersection
  • 14. Intersection Operation – Practices 14 1) { w | w has at least three a’s and at least two b’s } 2) { w | w has exactly two a’s and at least two b’s } 3) { w | w has an even number of a’s and at most two b’s } 4) { w | w has an even number of a’s and each a is followed by at least one b } 5) { w | w starts with an a and has at most one b } 6) { w | w has an odd number of a’s and ends with a b } 7) { w | w has even length and an odd number of a’s } Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 15. Operation 3 - Complement 15 Technique: Convert all the general states to final states and all the final states to general states. L = Set of binary strings those are multiple of 3 ത𝐿 = Set of binary strings those are not a multiple of 3 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 16. Complement Operation – Practices 16 1) L(M) = { w | w does not contain the substring ab} 2) L(M) = { w | w does not contain the substring baba } 3) L(M) = { w | w contains neither the substrings ab nor ba } 4) L(M) = { w | w is any string that doesn’t contain exactly two a’s } Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 17. 17 THANKS! Any questions? You can find me at [email protected] References: Chapter 1(section 1.1), Introduction to the Theory of Computation, 3rd Edition by Michael Sipser