Formal hw1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Student Information

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

(q0 , abbaabab) ⊢M (q1 , bbaabab)


⊢M (q2 , baabab)
⊢M (q0 , aabab)
⊢M (q1 , abab)
⊢M (q1 , bab)
⊢M (q2 , ab)
⊢M (q3 , b)
⊢M (q3 , e)

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.

P′ 5. Define the transition function δ as taking two inputs: an Q of K and an element of a of


. The function returns the set whose elements are precisely those states E(p) in K for which
there exists a q ∈ Q and (q, a, p) ∈ ∆. Transition functions of empty string should also be included.

You might also like