Professional Documents
Culture Documents
Formal hw1
Formal hw1
Formal hw1
Question 1
a) False
Strings over an alphabet are infinitely countable, while real numbers are uncountable.
b) False
Any finite language can naturally be converted to a finite representation by exhaustively listing
every string in the language. When infinite languages are taken into account, the problem only
gets more complicated.(textbook)
c) True
Language L consists of any number of consecutive a , again any number of consecutive b , and any
subsequent number of consecutive a , any number of consecutive b . No symbol from a*, bb from
b* , a from a* and no symbol from b*.
d) False
Not all strings start with ab because the initial a can repeat more than once.(aab)
Question 2
b a a,b
q0 a q1 b q2 a q3
start
a)
K: {q0 , q1 , q2 , q3 }
P
: {a, b}
s: q0
F: {q0 , q1 , q2 }
δ:
{((q0 , a), q1 ), ((q0 , b), q0 ), ((q1 , a), q1 ), ((q1 , b), q2 ), ((q2 , a), q3 ), ((q2 , b), q0 )((q3 , a), q3 ), ((q3 , b), q3 )}
1
b)
NO!
input = abbaabab
Since q3 is not final state, DFA does not accept the input abbaabab.
Question 3
a)
E(q0 ) = {q0 , q2 }
E(q1 ) = {q1 }
E(q2 ) = {q2 }
E(q3 ) = {q0 , q2 , q3 }
E(q4 ) = {q0 , q2 , q3 , q4 }
b)
4. Define the set of final states, F’ will consist of those elements of K that contain at least one
member of F.