0% found this document useful (0 votes)
30 views

FAFL Final Lecture 1.10 CMH

Uploaded by

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

FAFL Final Lecture 1.10 CMH

Uploaded by

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

Established as per the Section 2(f) of the UGC Act, 1956

Approved by AICTE, COA and BCI, New Delhi

Lecture 1.10
Deterministic Finite
Automata
School of CSE
OUTLINE

Recap of Previous Lecture

Topic of the Lecture

Lecture Discussion

• DFA accepting strings based on binary to decimal conversions.


• Miscellaneous problems on DFA construction.
Deterministic Finite Automata
Recap of Previous Lecture
RECAP OF PREVIOUS
LECTURE

Course Description
DFA accepting strings based on length of the string.

DFA accepting strings based on symbols count.


Deterministic Finite Automata
To p i c o f t h e L e c t u r e
TOPIC OF THE LECTURE

DFA accepting strings based on binary to decimal conversions.

Miscellaneous problems on DFA construction.


Deterministic Finite Automata
D FA a c c e p t i n g s t r i n g s b a s e d o n b i n a r y t o
decimal
conversions
D FA A C C E P T I N G S T R I N G S B A S E D O N B I N A RY T O
D ECIMA
Problem L CONVERSIONS
Solving
Construct a DFA to accept the binary strings which when
converted to decimal is a multiple of 3.
Here Ʃ={0, 1} and L = {0, 00, 11, 011, 00011, 110, 0110, 1001, 01001, 1111, 011110, …}
Solution 1
accept
0 1
qx q0 q1
1
0
0
0
q2
1
D FA A C C E P T I N G S T R I N G S B A S E D O N B I N A RY T O
D ECIMA
Problem L CONVERSIONS
Solving
Construct a DFA to accept the binary strings that begin with 1
and which when converted to decimal is a multiple of 3.
Here Ʃ={0, 1} and L = {11, 110, 1100, 1001, 1010, 1111, 11011, …}
Solution 1
accept
1
qx q0 q1
1
0 0
0
0
ɸ q2
0, 1 1
Deterministic Finite Automata
M i s c e l l a n e o u s p r o b l e m s o n D FA
construction
M I S C E L L A N E O U S P R O B L E M S O N D FA
C O N S TSolving
Problem RUCTION
Construct a DFA to accept the strings over { a, b} that either
begin with “ab”, or end with “ab” or both.
Here Ʃ={a, b} L = { ab, aab, bab, aaab, bbab, abab, abaab, abbab, abaabab, … }
Solution a, b

q1 b q2
a

q0 a
b
q5
a
b
q3 a
q4 b

b a
M I S C E L L A N E O U S P R O B L E M S O N D FA
C O N S TSolving
Problem RUCTION
Construct a DFA to accept the binary strings where second
symbol form the right end of the string is 1.
Here Ʃ={a, b} L = { 10, 11, 111, 010, 110, 00010, 101010, …. }
Solution
0

1 q2
0
1
q0 q1 1
0

1
0 q3
SUMMARY OF THE LECTURE

DFA accepting
DFA accepting DFA accepting Miscellaneous
strings based
strings based strings based problems on
on binary to
on length of on symbols DFA
decimal
the string count construction
conversions
RESOURCES AND TASK
Optional and non-optional reading resources of
the Lecture
Optional Resources

• https://www.eecs.wsu.edu/~ananth/CptS317/Lectures/index.htm
Web • https://www.geeksforgeeks.org/theory-of-computation-automata-tutorials/
resources • https://www.tutorialspoint.com/automata_theory/automata_theory_introdu
ction.htm
Non-Optional Resources

John E Hopcroft, Rajeev Motwani, Jeffrey D. Ullman, Introduction to Automata


Theory, Languages and Computation, 3rd Edition, Pearson Education, 2009.

Peter Linz, An Introduction to formal Languages and Automata, 4/ E, Jones


and Bartlett Publishers, 2006.
RESOURCES AND TASK
Optional and non-optional tasks to
be completed
Optional Task

Web • Construct DFA to accept binary strings that begin with 1 and when
resources interpreted in decimal is a multiple of 5.

Non-Optional Task

Web • Construct DFA for accepting binary strings that begin 0 and which when
resources converted to decimal is a multiple of 4.
SUMMARY OF THE LECTURE
Reading resources for the next
lecture
Topic of Next Lecture: Non Deterministic Finite Automata

• https://www.eecs.wsu.edu/~ananth/CptS317/Lectures/index.htm
Web • https://www.geeksforgeeks.org/theory-of-computation-automata-tutorials/
resources •
https://www.tutorialspoint.com/automata_theory/automata_theory_introduc
tion.htm

John E Hopcroft, Rajeev Motwani, Jeffrey D. Ullman, Introduction to Automata


Theory, Languages and Computation, 3rd Edition, Pearson Education, 2009.

Peter Linz, An Introduction to formal Languages and Automata, 4/ E, Jones


and Bartlett Publishers, 2006.
DISCUSSION
5 MINUTES

Construct a DFA to accept valid identifier of the programming language C.


QUIZ
Questions from Lecture

1. Comment on the statement “If a DFA accept a language L then we can


construct DFA for L too”.
A) True B) False

C) It is true for some cases D) It depends on the language

2. How many states a DFA can have to accept binary strings whose length is
multiple of 10.
A) 10 B) 5

C) 11 D) 9
QUIZ
Questions from Lecture
3. If a DFA accept binary strings that does not end with 0 then binary string
when interpreted in decimal is _______

A) Odd B) Even

C) Odd except the string λ D) Even except the string λ

4. If DFA accept all possible binary strings over {0,1} then DFA has ____
states.

A) One B) Two

C) Three D) Four
QUIZ
Questions from Lecture

5. The trap state or dead state is represented by ___________ Symbol.

A) Ʃ* B) Ʃ+

C) ɸ D) { λ }

6. The number of states needed to accept λ over an alphabet Ʃ = { a, b} is ____

A) 2 B) 3

C) 1 D) 0
QUIZ
Questions from Lecture
7. The minimum number of states present in DFA that accept binary strings
which when interpreted in decimal is a multiple of 3 is ________

A) 3 C) 4

C) 5 D) 6

8. The minimum number of states exists in a DFA that accepts strings that
begin with “a” or end with “a” or both over Ʃ = { a, b} is ________

A) 4 B) 3

C) 6 D) 5
THANK YOU

You might also like