Assignment 2
Assignment 2
Theory of Automata
5-C
R.E: + a + b + ( a + b )* ( ab + ba + bb)
b a
𝑞0 𝑞1
a
b
𝑞2
a
(b) All strings that contain an even number of b’s
a
b
a
𝑞0 𝑞1
R.E: a*b*
b
a
b a,b
𝑞0 𝑞1
𝑞2
a
(d) {w| every odd position of w is a 0} (the first position is always position 0,
similar to an array).
0,1
1 0,1
𝑞0
𝑞1 𝑞𝑇
0
(e) {w| |w| is divisible by 3 or it ends in 00}.
0
𝑞0 0 0
𝑞1 1
𝑞2 𝑞3
v
1
0
1
0
1
𝑞4 𝑞5
0
1
0 1
0
𝑞6
𝑞7