Вы находитесь на странице: 1из 8

1.2.

Formal description of the deterministic finite automaton M1 in


the picture can be given by the 5-tuple,
M1 = (Q, , , q0, F)
Where,
Q = Finite set of all states = {q1, q2, q3}
= Finite set of input alphabet = (a, b)
: Q Q = Transition function, given by,

a b
q1 q2 q1
q2 q3 q3
q3 q2 q1

q0 = Start state = q1
F Q = Finite set of accept or final states = {q2}



Formal description of the deterministic finite automaton M2 in
the picture can be given by the 5-tuple,
M2 = (Q, , , q0, F)
Where,
Q = Finite set of all states = {q1, q2, q3, q4}
= Finite set of input alphabet = (a, b)
: Q Q = Transition function, given by,

a b
q1 q1 q2
q2 q3 q4
q3 q2 q1
q4 q3 q4

q0 = Start state = q1
F Q = Finite set of accept or final states = {q2, q4}



1.3.
The deterministic finite automaton M, defined by the 5-tuple,
M = ({q1, q2, q3, q4, q5}, {u, d}, , q3, {q3}),
where,
Q = Finite set of all states = {q1, q2, q3, q4,q5}
= Finite set of input alphabet = (u, d)

: Q Q = Transition function, given by,

u d
q1 q1 q2
q2 q1 q3
q3 q2 q4
q4 q3 q5
q5 q4 q5

Start state = q3
Finite set of accept or final states = {q3}


1.4 b.
Language L = {| has exactly two as and at least two bs}
L can be represented as intersection of two simple languages, L = L1L2
where,
L1 = {| has exactly two as}
L2 = {| has at least two bs}
State diagram for L1 is,

b b b a,b

a a a
State diagram for L2 is,
a a a
b b
After combining L1 and L2 using intersection construction, we get the DFA that recognizes
language L:
a a a a

a a a a

a a a a,b
b b b

b b b b
b
b b b

1.4 c.
Language L = {| has an even no of as and one or two bs}
L can be represented as intersection of two simple languages, L = L1L2
where,
L1 = {| has an even no of as }
L2 = {| has one or two bs }
State diagram for the DFA that recognizes L1 is,






State diagram for the DFA that recognizes L2 is,





After combining L1 and L2 using intersection construction, we get the DFA that recognizes
language L:























1.5 b.
Language L = {| doesnt contain any substring baba}
L can be represented as complement of a simple language L1(L = L1),
where,
L1 = {| contains at least one substring baba}
State diagram for the DFA that recognizes L1,




Therefore, state diagram of the DFA that recognizes the complement of L1 - which is basically the
DFA that recognizes language L is,









1.5 c.
Language L = {| contains neither substrings ab nor ba}
L can be represented as complement of a simple language L1(L = L1),
where,
L1 = {| contains either substrings ab or ba}
State diagram for the DFA that recognizes L1,








Therefore, state diagram of the DFA that recognizes the complement of L1 - which is basically the
DFA that recognizes language L is,









1.6 a.
State diagram for the DFA that recognizes language, L = {| begins with a 1 and ends with a 0}







1.6 b.
State diagram for the DFA that recognizes language, L = {| contains at least three 1s}







1.6 c.
State diagram for the DFA that recognizes language, L = {| contains the substring 0101}







1.6 d.
State diagram for the DFA that recognizes language,
L = {| has length at least three and its third symbol is a 0}








1.6 g.
State diagram for the DFA that recognizes language, L = {| the length of is at most five}






1.6 i.
State diagram for the DFA that recognizes language, L = {| every odd position of is a 1}







1.6 m.
State diagram for the DFA that recognizes the empty set,





1.6 n.
State diagram for the DFA that recognizes all strings except the empty string,






1.7 a.
State diagram for the NFA that recognizes language, L = {| ends with 00} with three states,






1.7 d.
State diagram for the NFA that recognizes language, L = {0} with two steps,





1.8 a.
State diagram for the DFA that recognizes language, L1 = {| begins with a 1 and ends with a 0}





State diagram for the DFA that recognizes language, L2 = {| contains at least three 1s}







Using construction in the proof of theorem 1.45, we can say that the NFA that recognizes union of
the two languages L1 and L2 can be defined by the 5-tuple, M = (Q, , , q0, F)
where,
Q = Finite set of all states
= {q0, q0, q1, q2, q3, q0, q1, q2, q3}
= {1, 2}
(q, a| qQ, a) is the transition function defined by,
0 1 0 1
q0 q0
q1 q1
q2 q2
q3 q3

(q0, a) = {}
(q0, 0) =
(q0, 1) =
F = Finite set of accept states
= {q2, q3}

State diagram of the newly formed NFA will be,

















1.9 a.
State diagram for the DFA that recognizes language, L = {| the length of is at most five}






State diagram for the DFA that recognizes language, L = {| every odd position of is a 1}




1.10 a.

1.16.

Вам также может понравиться