ICS312 Set 29 Deterministic Finite Automata Nondeterministic Finite Automata.
Finite Automata - Stanford University · Finite automata (this week) are an abstraction of...
Transcript of Finite Automata - Stanford University · Finite automata (this week) are an abstraction of...
![Page 1: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/1.jpg)
Finite AutomataPart One
Problem Set Four checkpoint due in the box up front. Late Problem Set Three's
also due up front.
Problem Set Four checkpoint due in the box up front. Late Problem Set Three's
also due up front.
![Page 2: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/2.jpg)
Last Thoughts on First-Order Logic
![Page 3: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/3.jpg)
An Extremely Important Table
For any choice of x,P(x) ∃x. ¬P(x)
When is this true? When is this false?
For some choice of x,P(x) ∀x. ¬P(x)
For any choice of x,¬P(x) ∃x. P(x)
For some choice of x,¬P(x) ∀x. P(x)
∀x. P(x)
∃x. P(x)
∀x. ¬P(x)
∃x. ¬P(x)
![Page 4: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/4.jpg)
Negating First-Order Statements
● Use the equivalences
¬∀x. φ ≡ ∃x. ¬φ
¬∃x. φ ≡ ∀x. ¬φ
to negate quantifiers.● Mechanically:
● Push the negation across the quantifier.● Change the quantifier from ∀ to ∃ or vice-versa.
● Use techniques from propositional logic to negate connectives.
![Page 5: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/5.jpg)
Analyzing Relations
“R is a binary relation over set A that is not reflexive”
¬∀a ∈ A. aRa∃a ∈ A. ¬aRa
“Some a ∈ A is not related to itself by R.”
![Page 6: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/6.jpg)
Analyzing Relations
“R is a binary relation over A that is not antisymmetric”
¬∀x ∈ A. ∀y ∈ A. (xRy ∧ yRx → x = y)∃x ∈ A. ¬∀y ∈ A. (xRy ∧ yRx → x = y)∃x ∈ A. ∃y ∈ A. ¬(xRy ∧ yRx → x = y)
∃x ∈ A. ∃y ∈ A. (xRy ∧ yRx ∧ ¬(x = y))∃x ∈ A. ∃y ∈ A. (xRy ∧ yRx ∧ x ≠ y)
“Some x ∈ A and y ∈ A are related to one another by R, but are not equal”
![Page 7: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/7.jpg)
A Useful Equivalence
● The following equivalences are useful when negating statements in first-order logic:
¬(p ∧ q) ≡ p → ¬q
¬(p → q) ≡ p ∧ ¬q● These identities are useful when negating
statements involving quantifiers.● ∧ is used in existentially-quantified statements.● → is used in universally-quantified statements.
![Page 8: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/8.jpg)
Negating Quantifiers
● What is the negation of the following statement?
∃x. (Puppy(x) ∧ Cute(x))● We can obtain it as follows:
¬∃x. (Puppy(x) ∧ Cute(x))
∀x. ¬(Puppy(x) ∧ Cute(x))
∀x. (Puppy(x) → ¬Cute(x))● “All puppies are not cute.”
![Page 9: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/9.jpg)
Uniqueness
![Page 10: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/10.jpg)
Uniqueness
● Often, statements have the form “there is a unique x such that …”
● Some sources use a uniqueness quantifier to express this:
∃!n. P(n)● However, it's possible to encode uniqueness
using just the two quantifiers we've seen.
∃!n. P(n) ≡ ∃n. (P(n) ∧ ∀m. (P(m) → m = n))
In CS103, do not use the ∃! quantifier. Just use ∃ and ∀. And whenever P is
true, it must be for n.
And whenever P is true, it must be for n.
There is some n where P(n) is true
There is some n where P(n) is true
![Page 11: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/11.jpg)
Uniqueness
● Often, statements have the form “there is a unique x such that …”
● Some sources use a uniqueness quantifier to express this:
∃!n. P(n)● However, it's possible to encode uniqueness
using just the two quantifiers we've seen.
∃!n. P(n) ≡ ∃n. (P(n) ∧ ∀m. (P(m) → m = n))● In CS103, do not use the ∃! quantifier. Just use
∃ and ∀.
![Page 12: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/12.jpg)
Summary of First-Order Logic
● Predicates allow us to reason about different properties of the same object.
● Functions allow us to transform objects into one another.
● Quantifiers allow us to reason about properties of some or all objects.
● There are many useful identities for negating first-order formulae.
![Page 13: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/13.jpg)
An Important Milestone
![Page 14: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/14.jpg)
Recap: Discrete Mathematics
● The past four weeks have focused exclusively on discrete mathematics:
Induction Functions
Graphs The Pigeonhole Principle
Relations Logic
Set Theory Cardinality
● These are the building blocks we will use throughout the rest of the quarter.
● These are the building blocks you will use throughout the rest of your CS career.
![Page 15: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/15.jpg)
Next Up: Computability Theory
● It's time to switch gears and address the limits of what can be computed.
● We'll explore● What is the formal definition of a computer?● What might computers look like with various resource
constraints?● What problems can be solved by computers?● What problems can't be solved by computers?
● Get ready to explore the boundaries of what computers could ever be made to do.
![Page 16: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/16.jpg)
Computability Theory
![Page 17: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/17.jpg)
What problems can we solve with a computer?
![Page 18: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/18.jpg)
What problems can we solve with a computer?
What kind of computer?
![Page 19: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/19.jpg)
Computers are Messy
http://www.intel.com/design/intarch/prodbref/272713.htm
![Page 20: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/20.jpg)
http://www.dharmanitech.com/
Computers are Messy
![Page 21: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/21.jpg)
Computers are Messy
http://techon.nikkeibp.co.jp/article/HONSHI/20090119/164259/
![Page 22: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/22.jpg)
Computers are Messy
http://en.wikipedia.org/wiki/File:Eniac.jpg
![Page 23: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/23.jpg)
We need a simpler way of discussing computing machines.
![Page 24: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/24.jpg)
An automaton (plural: automata) is a mathematical model of a computing device.
![Page 25: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/25.jpg)
Computers are Messy
http://www.intel.com/design/intarch/prodbref/272713.htm
![Page 26: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/26.jpg)
Automata are Clean
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 27: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/27.jpg)
http://www.dharmanitech.com/
Computers are Messy
![Page 28: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/28.jpg)
Automata are Clean
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 29: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/29.jpg)
Computers are Messy
http://techon.nikkeibp.co.jp/article/HONSHI/20090119/164259/
![Page 30: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/30.jpg)
Automata are Clean
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 31: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/31.jpg)
Computers are Messy
http://en.wikipedia.org/wiki/File:Eniac.jpg
![Page 32: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/32.jpg)
Automata are Clean
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 33: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/33.jpg)
Why Build Models?
● The models of computation we will explore in this class correspond to different conceptions of what a computer could do.
● Finite automata (this week) are an abstraction of computers with finite resource constraints.● Provide upper bounds for the computing machines
that we can actually build.
● Turing machines (later) are an abstraction of computers with unbounded resources.● Provide upper bounds for what we could ever hope
to accomplish.
![Page 34: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/34.jpg)
What problems can we solve with a computer?
![Page 35: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/35.jpg)
What problems can we solve with a computer?
What is a “problem?”
![Page 36: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/36.jpg)
Strings
● An alphabet is a finite set of characters.● Typically, we use the symbol Σ to refer to an
alphabet.
● A string is a finite sequence of characters drawn from some alphabet.
● Example: If Σ = {a, b}, some valid strings include
● a
● aabaaabbabaaabaaaabbb
● abbababba
● The empty string contains no characters and is denoted ε.
![Page 37: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/37.jpg)
Languages
● A formal language is a set of strings.● We say that L is a language over Σ if it is a
set of strings formed from characters in Σ.● Example: The language of palindromes over
Σ = {a, b, c} is the set
{ε, a, b, c, aa, bb, cc, aaa, aba, aca, bab, … }
● The set of all strings composed from letters in Σ is denoted Σ*.
● Formally: L is a language over Σ iff L ⊆ Σ*.
![Page 38: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/38.jpg)
The Model
● Goal: Given an alphabet Σ and a language L over Σ, can we build an automaton that can determine which strings are in L?
● Actually a very expressive and powerful framework; we'll see this over the next few weeks.
![Page 39: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/39.jpg)
To Summarize
● An automaton is an idealized mathematical computing machine.
● A language is a set of strings.● The automata we will study will accept as
input a string and (attempt to) output whether that string is contained in a particular language.
![Page 40: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/40.jpg)
What problems can we solve with a computer?
![Page 41: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/41.jpg)
Finite Automata
![Page 42: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/42.jpg)
A finite automaton is a mathematical machine for determining whether a string
is contained within some language.
![Page 43: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/43.jpg)
Each finite automaton consists of a setof states connected by transitions.
![Page 44: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/44.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 45: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/45.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
Each circle represents a state of the automaton.
Each circle represents a state of the automaton.
![Page 46: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/46.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 47: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/47.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
One special state is designated as the
start state.
One special state is designated as the
start state.
![Page 48: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/48.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 49: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/49.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 50: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/50.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 0
The automaton is run on an input string and answers
“yes” or “no.”
The automaton is run on an input string and answers
“yes” or “no.”
0 1 0 1 1 0
![Page 51: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/51.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 52: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/52.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 53: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/53.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 0
The automaton can be in one state at a time. It begins in the start state.
The automaton can be in one state at a time. It begins in the start state.
0 1 0 1 1 0
![Page 54: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/54.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 55: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/55.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 56: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/56.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
The automaton now begins processing characters in the
order in which they appear.
The automaton now begins processing characters in the
order in which they appear.
![Page 57: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/57.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 58: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/58.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 59: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/59.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
Each arrow in this diagram represents a transition. The automaton always
follows the transition corresponding to the current symbol being
read.
Each arrow in this diagram represents a transition. The automaton always
follows the transition corresponding to the current symbol being
read.
![Page 60: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/60.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 61: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/61.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 62: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/62.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 63: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/63.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 64: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/64.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 0
After transitioning, the automaton
considers the next symbol in the
input.
After transitioning, the automaton
considers the next symbol in the
input.
0 1 0 1 1 0
![Page 65: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/65.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 66: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/66.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 67: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/67.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 68: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/68.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 69: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/69.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 70: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/70.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 71: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/71.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 72: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/72.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 73: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/73.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 74: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/74.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 75: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/75.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 76: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/76.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 77: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/77.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 78: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/78.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 79: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/79.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 80: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/80.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 81: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/81.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 82: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/82.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 83: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/83.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 84: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/84.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 85: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/85.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
![Page 86: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/86.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 00 1 0 1 1 0
Now that the automaton has
looked at all this input, it can decide whether to say “yes”
or “no.”
Now that the automaton has
looked at all this input, it can decide whether to say “yes”
or “no.”
![Page 87: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/87.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 0
Now that the automaton has
looked at all this input, it can decide whether to say “yes”
or “no.”
Now that the automaton has
looked at all this input, it can decide whether to say “yes”
or “no.”
The double circle indicates that this
state is an accepting state, so the automaton outputs “yes.”
The double circle indicates that this
state is an accepting state, so the automaton outputs “yes.”
![Page 88: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/88.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 0
Now that the automaton has
looked at all this input, it can decide whether to say “yes”
or “no.”
Now that the automaton has
looked at all this input, it can decide whether to say “yes”
or “no.”
The double circle indicates that this
state is an accepting state, so the automaton outputs “yes.”
The double circle indicates that this
state is an accepting state, so the automaton outputs “yes.”
![Page 89: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/89.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
0 1 0 1 1 0
Now that the automaton has
looked at all this input, it can decide whether to say “yes”
or “no.”
Now that the automaton has
looked at all this input, it can decide whether to say “yes”
or “no.”
The double circle indicates that this
state is an accepting state, so the automaton outputs “yes.”
The double circle indicates that this
state is an accepting state, so the automaton outputs “yes.”
![Page 90: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/90.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 91: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/91.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 92: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/92.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 93: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/93.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 94: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/94.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 95: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/95.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 96: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/96.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 97: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/97.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 98: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/98.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 99: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/99.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 100: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/100.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 101: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/101.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 102: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/102.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 103: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/103.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 104: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/104.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 105: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/105.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 106: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/106.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 107: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/107.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 108: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/108.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 109: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/109.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 110: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/110.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 111: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/111.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 112: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/112.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 113: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/113.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 114: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/114.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 115: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/115.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 116: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/116.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 117: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/117.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
![Page 118: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/118.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
This state is not an accepting state, so the automaton
says “no.”
This state is not an accepting state, so the automaton
says “no.”
![Page 119: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/119.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
This state is not an accepting state, so the automaton
says “no.”
This state is not an accepting state, so the automaton
says “no.”
![Page 120: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/120.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 0 1 0 0 0
This state is not an accepting state, so the automaton
says “no.”
This state is not an accepting state, so the automaton
says “no.”
![Page 121: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/121.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 122: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/122.jpg)
A Simple Finite Automaton
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
1 1 0 1 1 1 0 0
Try it yourself! Does the
automaton accept (say yes) or
reject (say no)?
Try it yourself! Does the
automaton accept (say yes) or
reject (say no)?
![Page 123: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/123.jpg)
The Story So Far
● A finite automaton is a collection of states joined by transitions.
● Some state is designated as the start state.
● Some states are designated as accepting states.
● The automaton processes a string by beginning in the start state and following the indicated transitions.
● If the automaton ends in an accepting state, it accepts the input.
● Otherwise, the automaton rejects the input.
![Page 124: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/124.jpg)
Time-Out For Announcements
![Page 125: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/125.jpg)
Midterm Exam
● Midterm is October 29 from 7PM – 10PM.● Location information TBA.● Need to take the exam at an alternate time? Fill
out the alternate time form ASAP.● Covers material up through and including DFAs.
● Two practice exams available online.● Handout: Exam Strategies and Policies
available online.● Review session later this week; more details
on Wednesday.
![Page 126: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/126.jpg)
Your Questions
![Page 127: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/127.jpg)
“Keith, why did you choose to go into academia as opposed to industry? Do you
have any advice for students deciding between the two?”
![Page 128: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/128.jpg)
“What do you think is the coolest real-world application of CS103-related
material?”
![Page 129: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/129.jpg)
“Why are you taking away the Checkpoint problems... don't?”
![Page 130: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/130.jpg)
Back to CS103!
![Page 131: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/131.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 132: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/132.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 133: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/133.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 134: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/134.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 135: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/135.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 136: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/136.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 137: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/137.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 138: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/138.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 139: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/139.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 140: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/140.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 141: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/141.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 142: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/142.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 143: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/143.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 144: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/144.jpg)
Accepting States, Revisited
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
1 1 0 1
![Page 145: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/145.jpg)
A finite automaton does not accept as soon as the input enters an accepting state.
A finite automaton accepts if it ends in an accepting state.
![Page 146: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/146.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 147: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/147.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 148: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/148.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 149: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/149.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 150: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/150.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 151: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/151.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 152: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/152.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 153: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/153.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
No matter where we start in the automaton, after seeing two 1's, we end up in accepting
state q3.
No matter where we start in the automaton, after seeing two 1's, we end up in accepting
state q3.
![Page 154: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/154.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 155: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/155.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 156: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/156.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 157: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/157.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 158: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/158.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 159: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/159.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 160: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/160.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
No matter where we start in the automaton, after seeing two 0's, we end up in accepting
state q5.
No matter where we start in the automaton, after seeing two 0's, we end up in accepting
state q5.
![Page 161: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/161.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 162: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/162.jpg)
What Does This Accept?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
This automaton accepts a string iff it ends in 00 or 11.
This automaton accepts a string iff it ends in 00 or 11.
![Page 163: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/163.jpg)
The language of an automaton is the set of strings that it accepts.
If D is an automaton, we denote the language of D as ℒ(D).
ℒ(D) = { w ∈ Σ* | D accepts w }
![Page 164: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/164.jpg)
A Small Problem
q0
q1
0
start
q2 1
0
![Page 165: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/165.jpg)
A Small Problem
q0
q1
0
start
q2 1
0 0 1 1 0
![Page 166: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/166.jpg)
A Small Problem
q0
q1
0
start
q2 1
0 0 1 1 0
![Page 167: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/167.jpg)
A Small Problem
q0
q1
0
start
q2 1
0 0 1 1 0
![Page 168: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/168.jpg)
A Small Problem
q0
q1
0
start
q2 1
0 0 1 1 0
![Page 169: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/169.jpg)
A Small Problem
q0
q1
0
start
q2 1
0 0 1 1 0
![Page 170: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/170.jpg)
A Small Problem
q0
q1
0
start
q2 1
0 0 1 1 0
![Page 171: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/171.jpg)
A Small Problem
q0
q1
0
start
q2 1
0 0 1 1 0
![Page 172: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/172.jpg)
A Small Problem
q0
q1
0
start
q2 1
0 0 1 1 0
![Page 173: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/173.jpg)
Another Small Problem
q0
q2
0, 1startq1
0
0, 1
0, 1
![Page 174: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/174.jpg)
Another Small Problem
q0
q2
0, 1start
0 0 0
q1
0
0, 1
0, 1
![Page 175: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/175.jpg)
Another Small Problem
q0
q2
0, 1start
0 0 0
q1
0
0, 1
0, 1
![Page 176: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/176.jpg)
Another Small Problem
q0
q2
0, 1start
0 0 0
q1
0
0, 1
0, 1
![Page 177: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/177.jpg)
Another Small Problem
q0
q2
0, 1start
0 0 0
q1
0
0, 1
0, 1
![Page 178: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/178.jpg)
Another Small Problem
q0
q2
0, 1start
0 0 0
q1
0
0, 1
0, 1
![Page 179: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/179.jpg)
Another Small Problem
q0
q2
0, 1start
0 0 0
q1
0
0, 1
0, 1
![Page 180: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/180.jpg)
Another Small Problem
q0
q2
0, 1start
0 0 0
q1
0
0, 1
0, 1
![Page 181: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/181.jpg)
The Need for Formalism
● In order to reason about the limits of what finite automata can and cannot do, we need to formally specify their behavior in all cases.
● All of the following need to be defined or disallowed:● What happens if there is no transition out of
a state on some input?● What happens if there are multiple
transitions out of a state on some input?
![Page 182: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/182.jpg)
DFAs
● A DFA is a● Deterministic● Finite● Automaton
● DFAs are the simplest type of automaton that we will see in this course.
![Page 183: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/183.jpg)
DFAs, Informally
● A DFA is defined relative to some alphabet Σ.
● For each state in the DFA, there must be exactly one transition defined for each symbol in the alphabet.● This is the “deterministic” part of DFA.
● There is a unique start state.● There are zero or more accepting states.
![Page 184: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/184.jpg)
Is this a DFA?
![Page 185: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/185.jpg)
Is this a DFA?
q0 q1
q2q3
0
1
0
1
0
1 1
0
start
q2
![Page 186: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/186.jpg)
Is this a DFA?
![Page 187: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/187.jpg)
Is this a DFA?
q0
q2
0
start
q5
0
0
q1
q3
1
1
1
0
1
0 1
![Page 188: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/188.jpg)
Is this a DFA?
![Page 189: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/189.jpg)
Is this a DFA?
q0
q1
0
start
q2 1
0
![Page 190: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/190.jpg)
Is this a DFA?
q0
q1
0
start
q2 1
0
![Page 191: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/191.jpg)
Is this a DFA?
![Page 192: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/192.jpg)
Is this a DFA?
q0 q10, 1start
q3
0, 10, 1
q20, 1
![Page 193: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/193.jpg)
Is this a DFA?
![Page 194: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/194.jpg)
Is this a DFA?
q0
q2
0, 1startq1
0
0, 1
0, 1
![Page 195: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/195.jpg)
Is this a DFA?
q0
q2
0, 1startq1
0
0, 1
0, 1
![Page 196: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/196.jpg)
Is this a DFA?
![Page 197: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/197.jpg)
Is this a DFA?
![Page 198: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/198.jpg)
Is this a DFA?
Drinking Family of Aardvarks
![Page 199: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/199.jpg)
Designing DFAs
● At each point in its execution, the DFA can only remember what state it is in.
● DFA Design Tip: Build each state to correspond to some piece of information you need to remember.● Each state acts as a “memento” of what
you're supposed to do next.● Only finitely many different states ≈ only
finitely many different things the machine can remember.
![Page 200: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/200.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
![Page 201: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/201.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
start
![Page 202: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/202.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
start
1
![Page 203: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/203.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
startq1
0
1
![Page 204: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/204.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
startq1
0
1
1
![Page 205: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/205.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
startq1 q2
0 0
1
1
![Page 206: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/206.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
startq1 q2
0 0
1
1
![Page 207: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/207.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
startq1 q2
0 0
1
1
0, 1
![Page 208: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/208.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
startq1 q2
0 0
1
1
0, 1
![Page 209: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/209.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
startq1 q2
0 0
1
1
Σ
![Page 210: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/210.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}* | w contains 00 as a substring }
q0
startq1 q2
0 0
1
1
Σ
![Page 211: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/211.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
![Page 212: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/212.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
YES
010001
0101010001
NO
1001
00001
![Page 213: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/213.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
![Page 214: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/214.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
q0
start
![Page 215: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/215.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
q0
startq1
0
![Page 216: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/216.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
q0
startq1
0
Σ
![Page 217: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/217.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
q0
startq1
q2
0
1 Σ
![Page 218: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/218.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
q0
startq1
q2
0
1 Σ
Σ
![Page 219: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/219.jpg)
States like these are called dead
states.
States like these are called dead
states.
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
q0
startq1
q2
0
1 Σ
Σ
![Page 220: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/220.jpg)
Recognizing Languages with DFAs
L = { w ∈ {0, 1}*| every other character of w, starting with the first character, is 0 }
q0
startq1
q2
0
1 Σ
Σ
q0 q1
![Page 221: Finite Automata - Stanford University · Finite automata (this week) are an abstraction of computers with finite resource constraints. Provide upper bounds for the computing machines](https://reader033.fdocuments.net/reader033/viewer/2022041920/5e6bae894ec2b41f8b620ba5/html5/thumbnails/221.jpg)
Next Time
● Regular Languages● What is the expressive power of DFAs?
● NFAs● Automata with magic superpowers!
● Nondeterminism● Nondeterminisic computation.● Intuitions for nondeterminism.● Programming with nondeterminism.