Transcript Module 16

Module 16
• Distinguishability
– Definition
– Help in designing/debugging FSA’s
1
Distinguishability
2
Questions
• Let L be the set of strings over {a,b} which end with aaba.
• Let M be an FSA such that L(M) = L.
• Questions
– Can aaba and aab end up in the same state of M? Why or why
not?
– How about aa and aab?
– How about l or a?
– How about b or bb?
– How about l or bbab?
3
Definition *
• String x is distinguishable from string y
with respect to language L iff there exists a
string z such that
– xz is in L and yz is not in L OR
– xz is not in L and yz is in L
• When reviewing, identify the z for pair of
strings on the previous slide
4
Questions
• Let L be the set of strings over {a,b} that have
length 2 mod 5 or 4 mod 5.
• Let M be an FSA such that L(M) = L.
• Questions
– Are aa and aab distinguishable with respect to L? Can
they end up in the same state of M?
– How about aa and aaba?
– How about l and a?
– How about b and aabbaa?
5
Design an FSA to accept L
• L = set of strings x
over {a,b} such that
length of x is 2 or 4
mod 5
• One design method
– Is l in L?
• Implication?
– Is a distinguishable
from l wrt L?
• Implication?
– Is b distinguishable
from l wrt L?
• Implication?
– Is b distinguishable
from a wrt L?
• Implication?
6
Design an FSA to accept L
• L = set of strings x
over {a,b} such that
length of x is 2 or 4
mod 5
• Design continued
– Is aa distinguishable
from l wrt L?
• Implication?
– Is aa distinguishable
from a wrt L?
• Implication?
7
Design an FSA to accept L
• L = set of strings x
over {a,b} such that
length of x is 2 or 4
mod 5
• Design continued
– What strings would we
compare ab to?
– What results do we
get?
– Implications?
– How about ba?
– How about bb?
8
Design an FSA to accept L
• L = set of strings x
over {a,b} such that
length of x is 2 or 4
mod 5
• Design continued
– We can continue in this
vein, but it could go on
forever
– Now lets try something
different
– Consider string l.
• What set of strings are
indistinguishable from
it wrt L?
• Implications?
9
Design an FSA to accept L
• L = set of strings x
over {a,b} such that
length of x is 2 or 4
mod 5
• Design continued
– Consider string a.
• What set of strings are
indistinguishable from
it wrt L?
• Implications?
– Consider string aa.
• What set of strings are
indistinguishable from
it wrt L?
• Implications?
10
Debugging an FSA
• Do essentially the same thing
– Identify some strings which end up in each state
– Try and generalize each state to describe the
language of strings which end up at that state.
11
Example 1
a,b
I
a
a
II
III
b
IV
a
V
b
b
a
b
VI
a,b
12
Example 2
b
I
a
a
a
II
III
a,b
b
IV
a
V
b
b
13
Example 3
a,b
a
II
b
I
a
IV
a
b
III
b
14