




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A brief explanation of Deterministic Finite Automata and Nondeterministic Finite Automata.
Typology: Slides
1 / 144
This page cannot be seen from the preview
Don't miss anything!
Department of Computer Science State University of New York at Stony Brook
January 24, 2021
Contents
Contents Deterministic Finite Automata (DFA) Regular Languages Regular Expressions Nondeterministic Finite Automata (NFA) Transformations Non-Regular Languages
Electric bulb
Problem Design the logic behind an electric bulb.
Electric bulb
Problem Design the logic behind an electric bulb.
Solution Diagram.
Analysis. States = {nolight , light}, Input = {off , on} Finite Automaton. on
off
Multispeed fan
Problem Design the logic behind a multispeed fan.
Solution Diagram.
2
Off 1 3
Analysis. States = { 0 , 1 , 2 , 3 } Input = { , }
Finite Automaton. 0
Automatic doors
Problem Design the logic behind automatic doors in Walmart.
Basic features of finite automata
A finite automaton is a simple computer with extremely limited memory A finite automaton has a finite set of states Current state of a finite automaton changes when it reads an input symbol A finite automaton acts as a language acceptor i.e., outputs “yes” or “no”
Why should you care?
Deterministic Finite Automata (DFA) are everywhere. ATMs Ticket machines Vending machines Traffic signal systems Calculators Digital watches Automatic doors Elevators Washing machines Dishwashing machines Thermostats Train switches (CS) Compilers (CS) Search engines (CS) Regular expressions
What is a decision problem?
Definition A decision problem is a computational problem with a ‘yes’ or ‘no’ answer. A computer that solves a decision problem is a decider. Input to a decider: A string w Output of a decider: Accept ( w is in the language) or Reject ( w is not in the language) w Decider yes/no
What is a decision problem?
English word Accept
Other word Reject
Language = English language = {milk , food , sleep ,... } B Accept Not in language = {zffgb , cdcapqw ,... } B Reject
How does a DFA work?
Problem Does the DFA accept the string bbab?
start q 0 q 1 q 2
b
a
a, b
a b
How does a DFA work?
Problem Does the DFA accept the string bbab?
start q 0 q 1 q 2
b
a
a, b
a b
Solution The DFA accepts the string bbab. The computation is:
How does a DFA work?
Problem Does the DFA accept the string aaba?
start q 0 q 1 q 2
b
a
a, b
a b
Solution The DFA rejects the string aaba. The computation is:
How does a DFA work?
q 0 q 1 q 2
b
a
a, b
a b
bbab Accept
q 0 q 1 q 2
b
a
a, b
a b
aaba Reject