ACS COLLEGE OF ENGINEERING
Department of CSE-Data Science
THEORY OF COMPUTATION (BCS503)
ASSIGNMENT-1
CLASS: V SEM CSE-DS/CSE-CY MAX MARKS:100
(Scaled down to 10 marks)
Questions:
1. Give Formal definition of DFA and also design a DFA to read a string made up of letters
“computer” and recognize the strings that contain “come” as substring.
2. Design finite automata for following languages
i)Set of all strings that end with ab or ba over Σ={a,b}
ii)L={w/w∈ (a+b)* such that na(w)mod 3 =0 and nb(w)mod 2=0}
3. Construct DFA for the following languages defines on Σ={a,b}
A) L={w|w∈ {a,b}* and |w| mod 3≠2}
B) String with odd number of a’s and odd number of b’s.
4. Construct DFSM , String of a’s and b’s such that every block of five consecutive symbols
have at least two b’s on Σ={a,b}
5. Design a Deterministic Finite Automata over language Σ={a,b} , L={w| |w| mod 3> |w| mod 2}
6. Design a DFA that recognizes, L={W|W is non-empty and has 1 on every odd position}
7. Define DFSM. Design DFSM to accept each of the following:
i) L={w∈ {0,1}*: w corresponds to the binary encoding, without leading 0’s of natural numbers that
are evenly divisible by 4}
ii)Design a DFA, L={w∈ {a,b}*: ( #a(w)+2-#b(w)) ≡ 5 0} (#a(w) is the number of a’s in w)
8. Define NFA and design an NFA for the language L2, where L={awa|w∈ {a,b}n,n≥0}
9.Design a NFA to recognize L={w|w ∈ 0101n or 010n where n≥0}
10.Design a DFA on Σ={a,b},
i) To accept strings that doesnt have substring ‘abb’
ii) To accept strings that either begin, ends or both with string ‘ab’.