Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Theory of Computation (Finite Automata), Slides of Computer Science

A brief explanation of Deterministic Finite Automata and Nondeterministic Finite Automata.

Typology: Slides

2021/2022

Uploaded on 03/31/2022

danmarino
danmarino 🇺🇸

4.2

(11)

267 documents

1 / 144

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Theory of Computation
(Finite Automata)
Pramod Ganapathi
Department of Computer Science
State University of New York at Stony Brook
January 24, 2021
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Theory of Computation (Finite Automata) and more Slides Computer Science in PDF only on Docsity!

Theory of Computation

(Finite Automata)

Pramod Ganapathi

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:

  1. Start in state q 0
  2. Read b , follow transition from q 0 to q 1.
  3. Read b , follow transition from q 1 to q 1.
  4. Read a , follow transition from q 1 to q 2.
  5. Read b , follow transition from q 2 to q 1.
  6. Accept because the DFA is in an accept state q 1 at the end of the input.

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:

  1. Start in state q 0
  2. Read a , follow transition from q 0 to q 0.
  3. Read a , follow transition from q 0 to q 0.
  4. Read b , follow transition from q 0 to q 1.
  5. Read a , follow transition from q 1 to q 2.
  6. Reject because the DFA is in a reject state q 2 at the end of the input.

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