TOC - Tutorial II
TOC - Tutorial II
TOC - Tutorial II
1. Design DFA that accepts the Language, L = {w: w ϵ {a,b}* , w contains “aabab”}
Also, Test your design for the string “aaababbb”.
2. Design DFA for following Languages:
a. L = {w: w ϵ {a,b}* , w contains at-least three ‘b’}
b. L = {w: w ϵ {0,1}* , w starts with “110”}
c. L = {w: w ϵ {0,1}* , Second symbol of w is 1 and 5th Symbol is 0}
d. L = {w: w ϵ {a,b}* , w has even number of ‘a’ and odd number of ‘b’}
e. L = {w: w ϵ {0,1}* , Binary no. represented by w is exactly divisible by 5}
[eg. (1010)2 =(10)10 is exactly divisible by 5, so it should be accepted]
Use it to check whether “01111” and “1101” are exactly divisible by 5 or not.
3. Construct NFA for following Languages:
a. L = (ba ∪ baa)*
b. L = {w: w ϵ {0,1}* , w ends with “1100”}
c. L = b*a(b ∪ a)*baa
d. L = {w: w ϵ {0,1}* , Length of w is at-least 5}
e. L = {w: w ϵ {a,b}* , w contains “baa” or starts with “aba”}
4. Convert above NFAs (in question no. 3) to their equivalent DFAs.
5. Convert Following NFAs to DFAs
a. b.
a e 1 0
q0 q1 q4 q1 q2 q3
e
a q0 0, 1
e, b e a
e
1
q2 b q3 q4 0 q5 q6
a 0, 1
6. Use Pumping Lemma to show whether following Languages are Regular or not.
a. L = {w: w ϵ {a,b}* , w contains equal nuber of ‘a’ and ‘b’}
b. L = { anbncn : n ≥ 0}
c. L = { an! : n ≥ 0}
d. L = { anbm : m > n}
e. L = {w: w ϵ {a,b}* , Number of ‘a’ in w is greater than number of ‘b’}
f. L = {wwR : w ϵ {0,1}*}
g. L = { anb2n : n ≥ 1}
Chapter 2 (Theory of Computation)
0 1
q0 0 q1 1 q2 0
q3
1 0 1 1
0
1 1 0
q4 q5 q6 q7
1
0