cs3102: theory of computation class 11: moore, mealy, and markov models spring 2010 university of...
TRANSCRIPT
![Page 1: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/1.jpg)
cs3102: Theory of Computation
Class 11: Moore, Mealy, and Markov Models
Spring 2010University of VirginiaDavid Evans
![Page 2: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/2.jpg)
Menu
• Exam Review
• Variations on DFAs:– Moore Machine: states produce output– Mealy Machine: edges produce output– Markov Model: transitions have probabilities
![Page 3: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/3.jpg)
Moore Machine
Edward Moore, Gedanken-experiments on Sequential Machines, 1956.
http://people.mokk.bme.hu/~kornai/MatNyelv/moore_1956.pdf
![Page 4: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/4.jpg)
![Page 5: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/5.jpg)
Moore Machine Example
q0; 1
0
q1; 0
1
1 0
![Page 6: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/6.jpg)
“Power” of a Machine
Power of a DFA, NFA, DPDA, NPDA/CFG:
Set of languages it can recognize/produce.
Power of a Moore Machine:
Set of functions it can perform.
Language Function
Set of strings Set of <string, string> (input/output) pairs
![Page 7: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/7.jpg)
Formal Definition
![Page 8: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/8.jpg)
Computing ModelDFA Moore
![Page 9: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/9.jpg)
Computing ModelDFA Moore
![Page 10: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/10.jpg)
Moore’s Experiments
![Page 11: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/11.jpg)
![Page 12: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/12.jpg)
Okay...guess the machine!
![Page 13: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/13.jpg)
You LOSE!
q0; 1
0
q1; 01
1 0
q2; 0 q3; 0
0
1
q6; 1 q5; 0 q4; 0
1
11
0
0
01
0
![Page 14: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/14.jpg)
You always lose.
![Page 15: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/15.jpg)
![Page 16: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/16.jpg)
Sometimes “you” win...
Lorenz Cipher Machineused by Nazi high command: links between conquered capitals
Machine determined by Bill Tutte (1941) from intercepted messages
![Page 17: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/17.jpg)
Colossus
Bletchley Park, 1943
Bletchley Park, 2004 (rebuilt)
Decoded 63 million letters in Nazi command messages
Learned German troop locations to plan D-Day (knew the deception was working)
Arguably, the first electronic, digital, programmable computer.
![Page 18: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/18.jpg)
A More Fair Game
Reveal: n, maximum number of states in the machine (and , input alphabet)
Equality Rule: two machines are the same if they compute the same function
![Page 19: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/19.jpg)
S= {0, 1} n = 3
![Page 20: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/20.jpg)
q1; 01
q2; 0 q3; 1
1
00
0
![Page 21: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/21.jpg)
How many experiments is enough?
![Page 22: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/22.jpg)
Alternate Game
Given: state machineExperiment: input -> outputWin: guess what state the machine started in
Moore proved for some machines where all states are distinguishable, it is impossible to know the starting state from one experiment.
![Page 23: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/23.jpg)
Mealy MachineGeorge Mealy, A Method for Synthesizing Sequential Circuits, 1955
q0
0; 1
q1
1; 0
1; 0 0; 1
![Page 24: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/24.jpg)
Computing ModelM
oore
M
achi
neM
ealy
M
achi
ne
![Page 25: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/25.jpg)
Computing ModelM
oore
M
achi
neM
ealy
M
achi
ne
![Page 26: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/26.jpg)
Which is more powerful?
Mealy
Moore
![Page 27: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/27.jpg)
For any Moore Machine M, we can construct a Mealy Machine M’ that performs the same function:
qa; z
qi; x
qb; y
![Page 28: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/28.jpg)
For any Moore Machine M, we can construct a Mealy Machine M’ that performs the same function:
qa; z
qi; x
qb; y
qa
qi
qb
xx
![Page 29: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/29.jpg)
![Page 30: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/30.jpg)
![Page 31: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/31.jpg)
For any Mealy Machine M, we can construct a Moore Machine M’ that performs the same function:
qa
qi
qb
xy
![Page 32: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/32.jpg)
For any Mealy Machine M, we can construct a Moore Machine M’ that performs the same function:
qa
qi
qb
xy
qa
qi1; x
qb
qi2; y
Both have all the same outgoing transitions as qi
![Page 33: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/33.jpg)
![Page 34: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/34.jpg)
![Page 35: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/35.jpg)
Equally Powerful
Mealy
Moore
(Moore may need more needs more states)
![Page 36: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/36.jpg)
Are they good models?
q0
0; 1
q1
1; 01; 0
0; 1
![Page 37: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/37.jpg)
Markov Model
Andrey Markov, 1856-1922
Happy
Grumpy
Sleepy
Sneezy
0.2
0.4
0.1
0.9
0.3
0.3
0.7
0.1
1.0
![Page 38: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/38.jpg)
Markov Model with Outputs
Happy
Grumpy
Sleepy
Sneezy
0.2
0.4
0.1
0.9
0.3
0.3
0.7
0.1
1.0
“#%#$&”
“ARRGH”
0.70.3
“Zzzzzzzz”
1.0
“achoo!”
1.0
“ho ho ho!”
“wahoowa!”
0.50.5
![Page 39: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/39.jpg)
Markov Model Examples
a.com
b.com
c.org
d.com
1/3
1/3
1/3
1/2
1/2
1/2
1/2
Nodes: URLsLinks: hyperlinksProbabilities: 1/n number of non-self outgoing links
Pr(u) = probability ofreaching u starting from random seed states
![Page 40: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/40.jpg)
Lawrence Page, Sergey Brin, Rajeev Motwani and Terry Winograd
![Page 41: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/41.jpg)
Garkov
http://www.joshmillard.com/garkov/
![Page 42: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/42.jpg)
Hidden Markov Model
Happy
Grumpy
Sleepy
Sneezy
0.2
0.4
0.1
0.9
0.3
0.3
0.7
0.1
1.0
“#%#$&”
“ARRGH”
0.70.3
“Zzzzzzzz”
1.0
“achoo!”
1.0
“ho ho ho!”
“wahoowa!”
0.50.5
From just the outputs guess the states (and machine)
![Page 43: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/43.jpg)
Hidden Markov Model Example
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
Sent Review Topics
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
No Review Question
![Page 44: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/44.jpg)
Hidden Markov Model
LazyWant more challenging
exam
Active Student
No Review Question
Sent Review Topics
1.00.11.0 0.9
![Page 45: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/45.jpg)
Hidden Markov Model
A A
A K
7 2
Raise Call Fold
0.6
0.4
…0.9
0.08
0.02
Opponent Raises
0.8
Flop: 222
![Page 46: Cs3102: Theory of Computation Class 11: Moore, Mealy, and Markov Models Spring 2010 University of Virginia David Evans](https://reader036.vdocuments.mx/reader036/viewer/2022081519/56649eec5503460f94bfd30d/html5/thumbnails/46.jpg)
Return PS3front of room
A-D E-K
L-R S-Z