0% found this document useful (0 votes)
93 views20 pages

1310 1948 PDF

{A} {D, E} {B, C} {G} {A} {D, E} {B, C} {G}

Uploaded by

Daniyal Akram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views20 pages

1310 1948 PDF

{A} {D, E} {B, C} {G} {A} {D, E} {B, C} {G}

Uploaded by

Daniyal Akram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Barani Institute of Sciences Sahiwal

Campus, JV of PMAS Arid Agriculture


University RWP.

Department of Computer Science


Assignment No. 03
Course Code: CS-536
Course Title: Theory of Automata and Formal Languages
Submitted By: Daniyal Akram (18-ARID-369)
Degree: BSCS, Semester: 5, Section: A
Submitted To: Mr. Yawar Abbas Abid

Date of Submission: Thursday, May 21, 2020


Barani Institute of Sciences Sahiwal
Campus, JV of PMAS Arid Agriculture
University RWP.

— 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

State transition table for DFA


0 1
A B C
B B D
C B C
D B E
+E B C
2 and 3 are giving the same result, see below:

0 Equivalent {ABCD} {E}


1 Equivalent {ABC} {D} {E}
2 Equivalent {AC} {B} {D} {E}
3 Equivalent {AC} {B} {D} {E}
It is time to stop the process.

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}

{AE} {G} {BH} {DF} {C}


0 1
AE - BH DF
G G AE
BH G C
DF C G
C+ AE 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

A state is said to be unreachable if there is no way it can be


reached from the initial state.

First of all, let’s remove 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}

{A} {D, E} {B, C} {G}


0 1
A- B, C B, C
B+ G G

9
C+ D, E D, E
D G G

Definition of Non-Regular Languages

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)

If y-part of w is continuously pumped, the resulting strings will be accepted by F


and hence will be words in the language accepted by F. Thus, by pumping lemma,
the language accepted by F is regular.

14
Pumping Lemma version II

Applications of Pumping Lemma

15
Prove that a language is not regular using Pumping Lemma with
examples.
STEPS

1. At first, we have to assume that L is regular


2. So, the pumping lemma should hold for L
3. It has to have a pumping length (say p)
4. All strings longer than p can be pumped |w|≥ p
5. Now find a string ‘w’ in L such that |w|≥ p
6. Divide w into xyz
7. Show that xykz ∉ L for some k.
8. Then consider all ways that w can be divided into xyz
9. Show that none of these can satisfy all the 3 pumping conditions at the
same time.
10. W cannot be pumped == CONTRADICTION

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.

L= {ww: w ∈ {a, b}*} is not regular


Where

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

You might also like