1310 1948 PDF
1310 1948 PDF
— Assignment No. 03 —
Course Code: CS-536 Course Title: Theory of Automata and Formal Languages
Teacher: Yawar Abbas Abid
Guidelines: 1. The submission of your assignment must be done via Student Portal.
2. Please write legibly.
3. Title Page: Assignment should have a title page having following
information:
a) Student Name, Student ID.
b) Course Code.
c) Course Title.
d) Teacher Name.
e) Date Submitted.
4. Font: Use Times New Roman (12 point size) as the font for your
assignment.
5. Page Numbers: Put numbers in line with the right margin at the
bottom of each page.
6. Borders: None.
7. Assignments that are late will receive nonnegotiable marks of 0.
Assignment: a. Minimization of DFA-Table filling method (Myhill Nerode theorem).
b. Minimization of DFA using partition method.
c. Minimization of DFA (Construct a minimum DFA equivalent to the
DFA described by given table).
d. Minimization of DFA (When there are more than one final states
involved).
e. Minimization of DFA (With Unreachable States).
f. Definition of Non-Regular Languages.
g. Pumping Lemma (Statement/Proof/Example).
h. Pumping Lemma version II.
i. Applications of Pumping Lemma.
j. Prove that a language is not regular using Pumping Lemma with
examples.
Note:
Follow examples described in Lecture No. 14 (Minimization of DFA)
& Lecture No. 15 (Pumping Lemma).
Links to video lectures:-
https://www.youtube.com/watch?v=ATGmReHfU3w
https://www.youtube.com/watch?v=jI9__cPbkXs
Required Format .pdf
Total Marks: 50
Due Date: Friday, May 22, 2020
Table of Contents
Minimization of DFA-Table filling method (Myhill Nerode theorem)........................................... 2
Algorithm .................................................................................................................................... 2
Example ....................................................................................................................................... 2
Minimization of DFA using partition method ................................................................................. 6
Example ....................................................................................................................................... 6
DFA ......................................................................................................................................... 6
State transition table for DFA.................................................................................................. 6
Minimization of DFA (Construct a minimum DFA equivalent to the DFA described by given
table) ................................................................................................................................................ 7
{AE} {G} {BH} {DF} {C} ........................................................................................................ 7
Minimization of DFA (When there are more than one final states involved) ................................. 8
Minimization of DFA (With Unreachable States) ........................................................................... 9
{A} {D, E} {B, C} {G} .............................................................................................................. 9
Definition of Non-Regular Languages .......................................................................................... 10
Note ........................................................................................................................................... 10
Pumping Lemma ........................................................................................................................... 11
Statement ................................................................................................................................... 11
Proof .......................................................................................................................................... 11
Example ..................................................................................................................................... 13
Pumping Lemma version II ........................................................................................................... 15
Applications of Pumping Lemma .................................................................................................. 15
Prove that a language is not regular using Pumping Lemma with examples. ............................... 16
Example 1 .................................................................................................................................. 16
References ..................................................................................................................................... 18
1
Minimization of DFA-Table filling method (Myhill Nerode theorem)
Algorithm
Example
2
State diagram of DFA
Step 1
a b c d e f
Step 2
a b c d e f
3
C ✓ ✓
D ✓ ✓
E ✓ ✓
F ✓ ✓ ✓
Step 3
a b c d e f
C ✓ ✓
D ✓ ✓
E ✓ ✓
F ✓ ✓ ✓ ✓ ✓
4
5
Minimization of DFA using partition method
Example
DFA
6
Minimization of DFA (Construct a minimum DFA equivalent to the
DFA described by given table)
0 1
A- B F
B G C
C+ A C
D C G
E H F 0 Equivalence {ABDEFGH} {C}
F C G 1 Equivalence {AEG} {BH} {DF} {C}
G G E 2 Equivalence {AE} {G} {BH} {DF} {C}
H G C 3 Equivalence {AE} {G} {BH} {DF} {C}
7
Minimization of DFA (When there are more than one final states
involved)
0 1
A B C
B A D
C E F
D E F
E E F 0 Equivalence {A, B, F} {C. D, E}
F E F 1 Equivalence {A, B} {F} {C. D, E}
G F F 2 Equivalence {A, B} {F} {C. D, E}
0 1
→(A,B) A,B C, D, E
F F F
(C, D, E)+ C, D, E F
8
Minimization of DFA (With Unreachable States)
Unreachable
State
0 1
A- B C
B+ D E
C+ E D 0 Equivalence {A, D, E} {B, C, G}
D G G 1 Equivalence {A, D. E} {B, C} {G}
E G G 2 Equivalence {A} {D, E} {B, C} {G}
G+ G G 3 Equivalence {A} {D, E} {B, C} {G}
9
C+ D, E D, E
D G G
Note
10
Pumping Lemma
Statement
Proof
11
12
Example
Consider the following 6 states FA, say, F which accepts an infinite language
Let the word w = bbbababa, belonging to the language L, so that the length of
word is greater than 6 (the number of states in F).
In this case the path generated by this word is such that it cannot visit a new state
for each letter i.e. there is a circuit in this path.
13
The word w, in this case, may be divided into three parts.
1. The substring which generates the path from initial state to the state which is
revisited first while reading the word w. This can be called as part x and this
may be null string.
2. The substring which generates the circuit starting from the start state which was
lead by x, this part can be called as y and this cannot be null string.
3. The substring which is the remaining part of the word after y, this part can be
called as z. It may be noted that this part may be null string as the word may
end after y or z-part may itself be a circuit.
Thus the word w may be written as w = xyz, where x, y, z are strings belonging to
∑* and y cannot be null string.
The state 2 is such that it is revisited first while reading the word w. So the word
w can be decomposed, according to pumping lemma, as
w = xyz = (b)(bba)(baba)
14
Pumping Lemma version II
15
Prove that a language is not regular using Pumping Lemma with
examples.
STEPS
Example 1
Prove that L= {ai bi |≥0} is not regular.
1. At first, we assume that L is regular and n is the no. of states.
2. Let thus .
3. By pumping lemma, let , where .
4. Let ,
Where , thus .
5. Let k=2, then .
6. Number of ’ .
7. Hence .
Since , is not of the following .
2
8. Thus xy z is not in L.
Hence, L is not regular.
16
Hence, L is not regular.
17
References
1. Abbas Abid, Y., 2020. Lecture No. 14 | Minimization Of DFA In Urdu/Hindi |
Theory Of Automata. [online] YouTube. Available at:
<https://www.youtube.com/watch?v=ATGmReHfU3w> [Accessed 21 May
2020].
2. Abbas Abid, Y., 2020. Lecture No. 15 | Pumping Lemma In Urdu/Hindi | Theory
Of Automata. [online] YouTube. Available at:
<https://www.youtube.com/watch?v=jI9__cPbkXs> [Accessed 20 May 2020].
3. Automata Theory Tutorial - Tutorialspoint (2020). Available at:
https://www.tutorialspoint.com/automata_theory/index.htm [Accessed 20 May
2020].
4. Daniel I. A. Cohen (17 January 1986). Introduction to Computer Theory. Wiley.
ISBN 978-0-471-80271-6.
18