finite-state machines with no output
DESCRIPTION
Finite-State Machines with No Output. Kleene closure. A and B are subsets of V*, where V is a vocabulary The concatenation of A and B is AB={xy: x string in A and y string in B} Example: A={0, 11} and B={1, 10, 110} AB={01,010,0110,111,1110,11110} What is BA? - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/1.jpg)
Finite-State Machines with No Output
![Page 2: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/2.jpg)
Kleene closure• A and B are subsets of V*, where V is a
vocabularyThe concatenation of A and B isAB={xy: x string in A and y string in B}
• Example: A={0, 11} and B={1, 10, 110}AB={01,010,0110,111,1110,11110}
• What is BA?• A0={λ}
An+1=AnA for n=0,1,2,…
![Page 3: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/3.jpg)
Let A be any subset of V*.Kleene closure of A, denoted by A*, is
0
*
k
kAA
If B={0,1}, B*=V*.
![Page 4: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/4.jpg)
Regular Expressions
Regular expressions describe regular languages
Example:
describes the language
*)( cba
,...,,,,,*, bcaabcaabcabca
![Page 5: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/5.jpg)
Recursive Definition,,
1
1
21
21
*r
rrrrr
Are regular expressions
Primitive regular expressions:
2r1rGiven regular expressions and
![Page 6: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/6.jpg)
Examples
)(* ccbaA regular expression:
baNot a regular expression:
![Page 7: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/7.jpg)
Languages of Regular Expressions
: language of regular expression
Example
rL r
,...,,,,,*)( bcaabcaabcacbaL
![Page 8: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/8.jpg)
Definition
For primitive regular expressions:
aaL
L
L
![Page 9: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/9.jpg)
Definition (continued)
For regular expressions and
1r 2r 2121 rLrLrrL
2121 rLrLrrL
** 11 rLrL
11 rLrL
![Page 10: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/10.jpg)
ExampleRegular expression: *aba
*abaL *aLbaL *aLbaL *aLbLaL
*aba ,...,,,, aaaaaaba
,...,,,...,,, baababaaaaaa
![Page 11: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/11.jpg)
Example
Regular expression bbbaar **
}0,:{ 22 mnbbarL mn
![Page 12: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/12.jpg)
Example
Regular expression *)10(00*)10( r
)(rL = { all strings with at least two consecutive 0 }
![Page 13: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/13.jpg)
Equivalent Regular Expressions
• Definition:
• Regular expressions and
• are equivalent if
1r 2r
)()( 21 rLrL
![Page 14: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/14.jpg)
Implementing Regular Expressions
• Regular expressions, regular grammars reasonable way to generates strings in language
• Not so good for recognizing when a string is in language
• Regular expressions: which option to choose, how many repetitions to make
• Answer: finite state automata
![Page 15: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/15.jpg)
Three Equivalent Representations
Finite automata
Regularexpressions
Regular languages
Each can
describethe others
Kleene’s Theorem: For every regular expression, there is a deterministic finite-state automaton that defines the same language, and vice versa.
![Page 16: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/16.jpg)
Regular Expression Regular Grammar
a* S | aS(a+b)* S | aS | bSa* + b* S | A | B
A a | aAB b | bB
a*b S b | aSba* S bA
A | aA(ab)* S | abS
![Page 17: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/17.jpg)
EXAMPLE 1
Consider the language { ambn | m, n N}, which is represented by the regular expression a*b*.
A regular grammar for this language can be written
as follows:
S | aS | B B b | bB.
![Page 18: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/18.jpg)
Finite (State) Automata• A FA is similar to a compiler in that:
– A compiler recognizes legal programs in some (source) language.– A finite-state machine recognizes legal strings in some language.
• Example: Pascal Identifiers– sequences of one or more letters or digits,
starting with a letter:
letterletter | digit
S A
![Page 19: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/19.jpg)
Finite Automaton
• Input
“Accept” or“Reject”
String
FiniteAutomaton
Output
![Page 20: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/20.jpg)
Finite State Automata
• A finite state automation over an alphabet is illustrated by a state diagram:
– a directed graph– edges are labeled with elements of alphabet,– some nodes (or states), marked as final of “accepting”.– one node marked as start state
![Page 21: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/21.jpg)
Transition Graph
•
initialstate
accepting state
statetransition
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,
![Page 22: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/22.jpg)
Initial Configuration
•
1q 2q 3q 4qa b b a
5q
a a bb
ba,
Input Stringa b b a
ba,0q
![Page 23: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/23.jpg)
Reading the Input
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b b a
ba,
![Page 24: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/24.jpg)
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b b a
ba,
![Page 25: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/25.jpg)
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b b a
ba,
![Page 26: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/26.jpg)
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b b a
ba,
![Page 27: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/27.jpg)
0q 1q 2q 3q 4qa b b a
accept
5q
a a bb
ba,
a b b a
ba,
Input finished
![Page 28: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/28.jpg)
Rejection
•
1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b a
ba,0q
![Page 29: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/29.jpg)
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b a
ba,
![Page 30: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/30.jpg)
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b a
ba,
![Page 31: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/31.jpg)
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b a
ba,
![Page 32: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/32.jpg)
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
reject
a b a
ba,
Input finished
![Page 33: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/33.jpg)
Another Rejection
•
1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,0q
![Page 34: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/34.jpg)
•
1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,0q
reject
![Page 35: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/35.jpg)
Another Example
a
b ba,
ba,
0q 1q 2q
a ba
![Page 36: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/36.jpg)
a
b ba,
ba,
0q 1q 2q
a ba
![Page 37: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/37.jpg)
a
b ba,
ba,
0q 1q 2q
a ba
![Page 38: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/38.jpg)
a
b ba,
ba,
0q 1q 2q
a ba
![Page 39: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/39.jpg)
a
b ba,
ba,
0q 1q 2q
a ba
accept
Input finished
![Page 40: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/40.jpg)
Rejection Example
a
b ba,
ba,
0q 1q 2q
ab b
![Page 41: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/41.jpg)
a
b ba,
ba,
0q 1q 2q
ab b
![Page 42: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/42.jpg)
a
b ba,
ba,
0q 1q 2q
ab b
![Page 43: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/43.jpg)
a
b ba,
ba,
0q 1q 2q
ab b
![Page 44: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/44.jpg)
a
b ba,
ba,
0q 1q 2q
ab b
reject
Input finished
![Page 45: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/45.jpg)
Finite State Automata
• A finite state automation M=(S,I,f,s0,F) consists of
• a finite set S of states, • a finite input alphabet I, • a state transition function f: S x I S, • an initial state s0, • a subset F of S that represent the final
(accepting) states.
![Page 46: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/46.jpg)
Finite Automata• Transition
s1 a s2
• Is read ‘In state s1 on input “a” go to state s2’
• If end of input– If in accepting state => accept– Otherwise => reject
• If no transition possible (got stuck) => reject• FSA = Finite State Automata
![Page 47: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/47.jpg)
Example FSA
Construct the state diagram for M=(S,I,f,s0,F), where S={s0, s1, s2, s3}, I={0,1}, F={s0, s3}and the transition function:state Input 0 Input 1s0 s0 s1
s1 s0 s2
s2 s0 s0
s3 s2 s1
![Page 48: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/48.jpg)
Language accepted by FSA• The language accepted by a FSA is the set of strings
accepted by the FSA. • in the language of the FSM shown below:
x, tmp2, XyZzy, position27. • not in the language of the FSM shown below:
• 123, a?, 13apples.
letterletter | digit
S A
![Page 49: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/49.jpg)
Example:• FSA that accepts three letter English words that begin with
p and end with d or t.• Here we use the convenient notation of making the state
name match the input that has to be on the edge leading to that state.
pt
a
o
u
d
i
![Page 50: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/50.jpg)
Languages Accepted by FAs
FA
Definition:The language contains all input strings accepted by
= { strings that bring to an accepting state}
M
MLM
M ML
![Page 51: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/51.jpg)
Example
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,
abbaML M
accept
![Page 52: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/52.jpg)
Example
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,
abbaabML ,, M
acceptacceptaccept
•
![Page 53: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/53.jpg)
Example•
a
b ba,
ba,
0q 1q 2q
}0:{ nbaML n
accept trap state
![Page 54: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/54.jpg)
Formal Definition
Finite Automaton (FA) FqQM ,,,, 0
Q
0q
F
: set of states: input alphabet: transition function: initial state: set of accepting states
![Page 55: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/55.jpg)
Input Alphabet
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,
ba,
![Page 56: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/56.jpg)
Set of States
•
Q
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
543210 ,,,,, qqqqqqQ
ba,
![Page 57: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/57.jpg)
Initial State
•
0q
1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,0q
![Page 58: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/58.jpg)
Set of Accepting States
•
F
0q 1q 2q 3qa b b a
5q
a a bb
ba, 4qF
ba,
4q
![Page 59: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/59.jpg)
Transition Function
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
QQ :
ba,
![Page 60: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/60.jpg)
10 , qaq
2q 3q 4qa b b a
5q
a a bb
ba,
ba,0q 1q
![Page 61: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/61.jpg)
50 , qbq
1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,0q
![Page 62: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/62.jpg)
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,
32 , qbq
![Page 63: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/63.jpg)
Transition Function
•
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
a b0q
1q
2q
3q
4q
5q
1q 5q
5q 2q5q 3q
4q 5q
ba,5q5q5q5q
![Page 64: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/64.jpg)
Extended Transition Function
•
*
QQ *:*
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,
![Page 65: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/65.jpg)
20 ,* qabq
3q 4qa b b a
5q
a a bb
ba,
ba,0q 1q 2q
![Page 66: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/66.jpg)
40 ,* qabbaq
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,
![Page 67: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/67.jpg)
50 ,* qabbbaaq
1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,0q
![Page 68: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/68.jpg)
qwq ,*
Observation: if there is a walk from to with label then
q qw
q qw
q qkw 21
1 2 k
![Page 69: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/69.jpg)
50 ,* qabbbaaq
1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,0q
Example: There is a walk from to with label
0qabbbaa
5q
![Page 70: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/70.jpg)
Recursive Definition )),,(*(,*
,*
wqwq
q qw1q
qwq
),(
,*
1
1
1
,*
),(,*
qwq
qwq
)),,(*(,* wqwq
![Page 71: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/71.jpg)
0q 1q 2q 3q 4qa b b a
5q
a a bb
ba,
ba,
2
10
00
0
,,,
,,,*),,(*
,*
qbq
baqbaq
baqabq
![Page 72: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/72.jpg)
Language Accepted by FAs
• For a FA
• Language accepted by :
•
FqQM ,,,, 0
M
FwqwML ,*:* 0
0q qw Fq
![Page 73: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/73.jpg)
Observation
• Language rejected by :
FwqwML ,*:* 0
M
0q qw Fq
![Page 74: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/74.jpg)
Example
• ML = { all strings with prefix }ab
a b
ba,
0q 1q 2q
accept
ba,3q
ab
![Page 75: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/75.jpg)
Example
• ML = { all strings without
substring }001
0 00 001
1
0
110
0 1,0
![Page 76: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/76.jpg)
Example
•
*,:)( bawawaML
a
b
ba,
a
b
ba
0q 2q 3q
4q
![Page 77: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/77.jpg)
Deterministic FSA’s
• If FSA has for every state exactly one edge for each letter in alphabet then FSA is deterministic
• In general FSA in non-deterministic.
• Deterministic FSA special kind of non-deterministic FSA
![Page 78: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/78.jpg)
Example FSA
• Regular expression: (0 1)* 1• Deterministic FSA
0 1
1
0
![Page 79: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/79.jpg)
Example DFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0 1
1
0
![Page 80: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/80.jpg)
Example DFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0 1
1
0
![Page 81: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/81.jpg)
Example DFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0 1
1
0
![Page 82: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/82.jpg)
Example DFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0 1
1
0
![Page 83: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/83.jpg)
Example DFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0 1
1
0
![Page 84: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/84.jpg)
Example DFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0 1
1
0
![Page 85: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/85.jpg)
Example DFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0 1
1
0
![Page 86: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/86.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Non-deterministic FSA
0
1
1
![Page 87: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/87.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 88: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/88.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 89: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/89.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 90: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/90.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1• Guess
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 91: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/91.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1• Backtrack
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 92: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/92.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1• Guess again
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 93: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/93.jpg)
Example NFSA
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1• Guess
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 94: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/94.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1• Backtrack
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 95: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/95.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1• Guess again
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 96: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/96.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 97: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/97.jpg)
Example NFSA
• Regular expression: (0 1)* 1• Accepts string 0 1 1 0 1• Guess (Hurray!!)
0
1
1
• Regular expression: (0 + 1)* 1• Accepts string 0 1 1 0 1
![Page 98: Finite-State Machines with No Output](https://reader035.vdocuments.site/reader035/viewer/2022062218/56815df4550346895dcc2bd4/html5/thumbnails/98.jpg)
If a language L is recognized by a nondeterministic FSA, then L is recognized by a deterministic FSA
See thm. 1, p. 813. Why?
Intuition: construct the deterministic finite automaton (may be much larger!).