21cs51 Assignment 1
21cs51 Assignment 1
ASSIGNMENT-1
1) Design a DFA which accepts any no of a’s followed by a string ba followed by a string a’s
and b’s [a*ba (a+b)*]?
2) Obtain a DFA to accept strings of 0’s, 1’s, and 2’s beginning with a one followed by odd
no of 0’s and ending with 2?
3) Obtain a DFA to accept strings starting with 2 0’s and ending with at least 2 1’s?
4) Obtain a DFA to accept a strings of a’s and b’s with at most two consecutive b’s
[abababb]?
5) Construct a DFA to accept the strings over {a,b} that every block length of 5 contains at
least 2 a’s?
6) Convert the following NFA to its equivalent DFA.
0 1
0,1
7 ,1 Q1 Q2
Q0
1.
a
a b 4 5
9
0 1 2 E 3 8
b
6 7
8) a) Prove that for every regular expression there is an equivalent Finite automaton
b)Construct an e-NFA hat accepts the following languages
i) (a+b) * (ab)
ii)(0+1)* 1 (0+1)
9) .Obtain regular expressions by elimination of states from DFA.
0 0
1
B
A
A
1
1