Theory of Computation (Toc) Tutorial - 2: By: Shayak Raj Giri
Theory of Computation (Toc) Tutorial - 2: By: Shayak Raj Giri
TUTORIAL -2
1. Design a Deterministic Finite Automata (DFA) M that accepts the language L (M) = {w∊ {a, b}*:
w has even numbers of b’s}.
2. Design a deterministic finite automaton M that accepts the language L (M) = {w∊ {a, b}*: w has
abab as substring}.
3. Design a deterministic finite automaton M that accepts the language L (M) = {w∊ {a, b}*: w does
not contain three consecutive b’s}.
4. Design a deterministic finite state automaton M, which accepts the language L = {w ∊ {0, 1}*: every
string w in the language L ends with 00.
5. Design a DFA which accepts the language L = {w ∊ {0, 1}*: second symbol of w is ‘0’ and fourth
symbol is ‘1’}.
6. Design a deterministic finite automaton M that accepts the language L (M) = {w∊ {a, b}*: w has
neither aa nor bb as a substring}.
7. Design a deterministic finite state automaton M that accepts the language L (M) = {w∊ {0, 1}*: w
has even numbers of 0’s and odd numbers of 1’s}.
8. Construct a DFA that accepts the language L (M) = {w ∊ {0, 1}*: w has number of zeros that are
multiple of three}.
9. Design a DFA that accepts the strings over an alphabet ∑ = {0, 1} that either start with 01 or end
with 01.
10. Design a DFA which accepts a set of strings containing four 1’s in every string over ∑ = {0, 1}.
11. Design a DFA that accepts the language L= {w: w has neither 010 nor 101 as substring with
∑={0,1}}.
12. Design a DFA that accepts the language L (M) = {w∊ {a, b}*: w has number of a's divisible by 3}.
13. Design a DFA that accepts the language L (M) = {w∊ {a, b}*: w has number of a divisible by 3 and
number of b by 2}.
14. Design a DFA that accepts the language L (M) = {w∊ {a, b}*: w does not have abb as a substring}.
15. Design a DFA and NFA for: (i) (abUaba)* (ii) (ab)*U(aba)* (iii) (aa)*(bb)*b with ∑ = {a, b}.
16. Design a NFA for: (i) (aa)* (ii) aa*ba (iii) (aa)*(bb)* (iv) (a(ab)*b)* with ∑ = {a, b}.
17. Convert the following NFA to DFA. M=(K, ∑,Δ,S,F) Where K={q0,q1,q2,q3,q4}, ∑ = { , }, S= q0,
F=( q1,q4), Δ={(q0,a,q0),( q0,a,q3),( q0,∊,q1),( q0,b,q1),( q1,b,q2),( q2,a,q4),( q2,b,q4), ( q3,b,q2),( q3,∊ ,q2),
( q4,a,q4),( q4,b,q4)}.