CS3452 Theory of Computaion QuestionBank
CS3452 Theory of Computaion QuestionBank
in/
(Regulations 2021)
UNIT I
AUTOMATA AND REGULAR EXPRESSIONS
Need for automata theory - Introduction to formal proof – Finite Automata (FA) – Deterministic Finite
Automata (DFA) – Non-deterministic Finite Automata (NFA) – Equivalence between NFA and DFA –
Finite Automata with Epsilon transitions – Equivalence of NFA and DFA- Equivalence of NFAs with
and without ε-moves- Conversion of NFA into DFA – Minimization of DFAs
PART A
1. Define computation and theory of computation.
3. Design FA which accepts odd number of 1’s and any number of 0’s.
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
18 Define hypothesis.
19 Define inductive proof.
20 Draw non-deterministic automata to accept strings containing the substring 0101.
Unit I - Part B
Prove the following by induction for all n≥0
(i) 12+22+32+42+…….+n2=(n(n+1)(2n+1))/6
1. 13
(ii) 13+23+….+n3=(n2(n+1)2)/4
3. 13
Design DFA to accept the Language L={w/w has both even number of 0‘s and even
4. 13
number of 1‘s}
i) Construct an NFA for the set of strings with {0,1} ending with 01 draw the
transitiontable for the same and check whether the input string 00101 is accepted by
5. above NFA. 13
ii) Construct NFA for set of all strings {0,1} that ends with three consecutive 1‘sat
its end.
i) If a Regular language L is accepted by a non – deterministic finite automata then
there exists a Deterministic Finite Automata that accepts L.
6. 13
ii) A Language ‗L‘ is accepted by some ε – NFA if and only if L is accepted by
NFA without ε transition
Construct NFA without ε transitions for the NFA given below
7. 13
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
i) Construct a DFA that accepts all strings on {0, 1} except those containing the
substring 101.
8. 13
ii) Construct a NFA accepting the set of strings over {a,b} ending in aba. Use it to
constructa DFA accepting the same set of strings.
Define ε-NFA. Consider the following ε-closure of each state and find it‘s
equivalent DFA.
10. 13
Design a NFA accept the following strings over the alphabets {0,1} that begins with
11. 13
01 and ends with 11. Check for the validity of 01111 and 0110 strings.
Convert to a DFA, the following NFA.
0 1
P(start) {p,q} {p} 13
12.
Q {r} {r}
R {s} -
S {s} {s}
Construct the DFA which accepts a language of all string not starting with ‘a’ or not
13. 13
ending with ‘b’
Give NFA to accept the following languages over {0,1}
(i) L = {String that contains either 101 or 110 as a substring}
14. 13
(ii) L = {Strings such that every 1 is following immediately by 00}
Design a DFA to accept the language L = {w/w has both an even number of 0’s and
15. even number of 1’s} and illustrate from its transition function to check the string w= 13
110101.
Unit I - PART – C
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
15
15
15
15
15
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
2 i. L={ a b /n,m>0}
n m
13
ii. L={ anbn/n,>0}
3 13
Obtain the regular expression for the finite automata.
i) Using pumping lemma for the regular sets, prove that the language
4 L={ambn/m>n} is notregular. 13
ii) Prove any two closure properties of regular languages.
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
5 13
UNIT II – Part C
Convert the following to regular expression
1 15
2 15
Prove that there exists an NFA with €- transition that accepts the regular
4 15
expression r.
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
2 Construct a CFG for the language of palindrome string over {a, b}.
3 What is ambiguity?
6 What is a derivation?
11 What are the different ways of language acceptance by a PDA and define them?
14 Let G = ( {S,A}, {a,b}, P,S} where P consists of S aAa, A aAa/b , Find L(G))?
17 Construct a CFG for the set of strings that contain equal number of a's and b's over ∑={a,b}.
18 Define PDA.
19 Let the production of the grammar be S→0B | 1A, A→ 0 | 0S | 1AA, B→ 1|1S | 0BB.Find the
right most derivation for the string 0110.
20 Construct a PDA that accepts the language generated by the grammar S → aSbb, S→ aab.
UNIT-III PART B
1 Define Deterministic PDA.Is NPDA and DPDA equivalent? Illustrate with an eg. 13
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
i) Let L is a context free language. Prove that there exists a PDA that accepts L.
2 13
ii) Construct PDA for the Language L= {WWR | W is in (a+b)*}.
i)Construct a transition table for PDA which accepts the language
L={ (a2nbn/n>0} Trace your PDA for the input with n=3.
3 ii)Find the PDA equivalent to the give CFG with the following 13
Construct the PDA accepting the language L= { anbn/n>0} by empty stack and final
4 state. 13
Convert the grammar S0S1/A: A1A0/S/ ε into PDA that accepts the same
5 13
language by empty stack. Check whether 0101 belongs to N(M).
Convert the grammar SaSb/A, AbSa/S/ε to PDA that accepts the same
6 13
language byempty stack.
7 Construct a PDA for the language L={x€{a,b}*/ na(x)>nb(x)} 13
Design a PDA to accept {02� 1� |n>1}. Draw the transition diagram for the PDA.
8 13
Show byinstantaneous description that the PDA accepts the strings‘0011’.
9 Construct the PDA accepting the language L= { an�� �� �� /m,n>0} 13
UNIT-III PART C
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
14 What are the differences between a Finite automata and a Turing machine?
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
Convert the following CFG into CNF for the following productions:
2 13
S →ASA/aB, A → B/S,B →b/ �
Construct a equivalent grammar G in CNF for the grammar G1 where
3 13
G1=({S,A,B},{a,b},{S→ASB| ε, A→aAS|a, B→SbS|A|bb},S).
Begin with the grammar S→ 0A0 | 1B1 | BB, A → C,B →S/A, C→ S/ �
4 and simplify using safe order Eliminate � production, unit production and useless 13
symbol and put the grammar in Chomsky normal form.
Find an equivalent grammar in CNF for the grammar (Or) How a CFGf or L is
5 converted into CNF accepting the same language? Convert the following CFG into 13
CFG in CNF. S→bA|aB, A→bAA|aS|a, B→aBB|bS|b
Convert the following grammar G into Greibach Normal Form (GNF)
S→XA|BB
6 B→b|SB 13
X→b
A→a
Construct a TM for the language L={anbn/n≥0}.Draw the transition diagram.(Also
7 13
specify the instantaneous description to trace the string0011)
UNIT IV - PART C
Explain the variations of Turing machines. . Write about Multi Tape Turing
11 15
machines.ExplainMultitapeandMultiheadTuringmachinewithsuitableexample.
What is the purpose of normalization? Construct the CNF and GNF for the
following grammar and Explain the steps.
S→ aAa | bBb | ε,
12 A→ C |a 15
B→C |b
C→CDE |ε
D→A |B | ab
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
Unit V - Part A
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
Unit V - Part B
Describe about Recursive and RE languages in detail. Also discuss the properties of
1 recursive and RE 13
in detail.
Show that the union of two recursive language is recursive and union of two RE
2 13
language is recursive.
3 State and prove halting problem 13
1 8
https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/
Solve the following travelling salesman problem with all necessary steps and
explanations
2 8
Find the minimal spanning tree using Kruskal’s algorithm with all necessary steps
3 8
State whether the instances of the post correspondence problem (PCP) have a
solution. The following are the instances with ∑ = {0,1}. In case the PCP has a
solution, describe the post – correspondence solution with justification.
https://www.poriyaan.in/paper/theory-of-computation-77/
Civil
CSE
Home Mech
e
EEE
CSE –2nd sem Reg 2021 ECE
Physics
Basic for Engineering
Electrical and Data Structure
Problem Solving and Science Engineering
Electronics
Python Programming Object Oriented
Programming in C
Programming
Elective-Management
Professional Elective II
Professional Elective IV