CSc 318
Test 2
Wednesday 25 October 2000
>>>>>>>>>>SUGGESTED ANSWERS<<<<<<<<<<<<<<
1.
(15 pts)
Prove the following theorem.
Theorem.
Given DFA’s M=(Q,
Σ
, s, F,
δ
) and N=(Q,
Σ
, s, F’,
δ
).
If F
⊆
F’ then
L(M)
⊆
L(N).
x
∈
L(M)
⇒
δ
(s,x)
∈
F
⇒
δ
(s,x)
∈
F’
⇒
x
∈
L(N)
2.
(20 pts)
Let A be the regular expression given by A=(a
∪
a*)(ab) and let M be the
NFA
({s,1,2}, {a,b}, s, {2}, {(s,a,1), (1,a,1), (1,b,2), (2,b,2)}).
a.
Give the language expression for L(A). >>> ({a}
∪
{a}*){a}{b}
b.
Prove that L(A)
⊆
L(M)
>>>First I note that (clearly) L(A)={a
k
b: k>0}. For a
k
b,
∆
({s}, a
k
b) =
∆
({1}, a
k-1
b) =…
∆
({1}, b) = {2}
⇒
a
k
b
∈
L(M).
c.
Find some x
∈
L(M) - L(A), that is an x in the language of the NFA but not in L(A).
>>>>
abb
∈
L(M) - L(A),
3.
(25 pts)
Prove
that {a, b, c}* is countable.
Define the 1-1 (no onto, which is unnecessary) f:{a,b,c}*
{0, 1, 2, …} by f(
ε
)=0,
f(a)=1, f(b)=2, f(c)=3.
In general, f(
α
1
α
2
….
α