Toc QB It
Toc QB It
Om Sakthi
ADHIPARASAKTHI COLLEGE OF ENGINEERING
(NAAC ACCREDITED)
G.B. NAGAR, KALAVAI – 632 506, RANIPET DISTRICT
QUESTION BANK
SUBJECT CS3452-THEORY OF
CLASS I IYEAR–4TH SEM CSE
CODE&TITLE COMPUTATION
2023-2024
COURSE IN-CHARGE Mrs.S.SUGANYA AY
(EVEN SEM)
Vision:
The vision of Information Technology department is to make the students recognized as an
international leader in engineering education, research and application of knowledge to benefit
society globally.
Mission:
We make every decision to support the career and personal development of our students. Our
curriculum, teaching and services demonstrate that we value the diverse profiles of our learners.
Course Outcomes:
CO1 Construct automata theory using Finite Automata
CO2 Write regular expressions for any pattern
CO3 Design context free grammar and Pushdown Automata
CO4 Design Turing machine for computational functions
CO5 Differentiate between decidable and undecidable problems
Blooms Taxonomy:
REMEMBERING UNDERSTANDING APPLYING ANALYSING EVALUATE CREATE
R U A AN E C
UNIT I– AUTOMATA AND REGULAR EXPRESSIONS
Q. No. Questions BT CO
PART–A
14 Design FA which accepts odd number of 1’s and any number of 0’s. A CO1
20 Design FA which accepts odd number of 1’s and any number of 0’s. U CO1
PART- B
Prove the following by induction for all n≥0 R CO1
1 i. 1 2 +22 +32 +42 +…….+n2 =(n(n+1)(2n+1))/6
ii. 1 3 +23 +….+n3 =(n2 (n+1)2 )/4
Prove A i. S(n)=52n -1 is divisible by 24 for n>0 R
ii. 1+2+……+n=(n(n+1))/
2 R CO1
6 R CO1
8 A CO1
Design a NFA accept the following strings over the alphabets {0,1} that
9 begins with 01 and ends with 11. Check for the validity of 01111 and U CO1
0110 strings.
Minimize the FA shown in fig below and show both the given and the
reduced one are equivalent.
10 A CO2
Write and explain the algorithm for minimization of a DFA. Using the
11 U CO2
above algorithm minimize the following DFA.
Minimize the following automaton
12 R CO2
PART - C
1. (i) Draw and Explain the transition diagram for recognizing the set CO2
of all operators in c Language.(8)
Evaluate a DFA from the given NFA(7) M=({qo,q1},{a,b},δ,q0,{q1}
with the state table diagram for δ given below:
E
3. Infer the DFA which is accepting the following language over the CO2
alphabet{0,1}.The set of all the strings beginning with a1 that
wheninterrupted as a binary integer , is multiple of 5, For example A
strings 101,1010 and 1111 are in the language 0,100 and 111 are not.(15)
4. Rewrite the basic approach to convert from NFA to regularexpression. C CO2
Illustrate with an example(15)
Q. No. Questions BT CO
PART–A
1 Differentiate regular expression and regular language R CO2
2 Give the regular expression for set of all strings ending in 00. R CO2
3 State pumping lemma for regular language. AN CO2
Give the regular expression for the following
4 L1= set of all strings of 0 and 1 ending in 00 R CO2
L2= set of all string 0 and 1 beginning with 0 and ending with 1
5 Name any four CFG R CO2
6 Is regular set is closed under complement? Justify. AN CO2
Construct NFA for the regular expression (0+1)01
7 U CO2
Prove that there exists an NFA with €- transition that accepts the regular CO2
4 AN
expression r.
Which of the following language is regular? Justify.
CO2
5 i. L={ an b m /n,m>0} U
ii. ii. L={ an b n /n,>0}
Convert the following NFA into a R.E
CO2
6 R
Write and explain the algorithm for minimization of a DFA. Using the
CO2
7 above algorithm minimize the following DFA. U
Construct NFA with epsilon for the R.E=(a/b)*ab and convert into DFA and CO2
8 C
further find the minimized DFA.
Prove that the following languages are not regular:
i. {w€{a,b}*/w=w^r } CO2
9 A
ii. Set of string of 0‘s and 1‘s beginning with a 1, whose value treated as
binary number is a prime.
10 Demonstrate how the set L= {abn/n>=1} is not a regular.(13) CO2
E
11 Express that the regular languages are closed under:(13) (a)union CO2
(b)intersection(c)Kleene Closure(d)Complement (e)Difference E
PART C
1. (i) Deduce into regular expression that denotes the language accepted CO2
by following DFA.(7)
q1 q2
a
(ii) Evaluate the equalities for the following RE and prove for the same
(8)
E
a. b+ab* +aa*b+aa*ab*
b. a*(b+ab*).
a(a+b)*+aa(a+b)*+aaa(a+b)*
2. Set the algorithm for minimization of a DFA. Develop a minimized C CO2
DFA for the RE (a+b)(a+b)* and trace for the
(iii) string baaaab.(15)
3. Point out about the regular exression and regular Language. (15) A CO2
4. Develop the procedure for minimizing DFA with example (15) C CO2
UNIT III – CONTEXT FREE GRAMMAR AND PUSH DOWN AUTOMATA
Q. No. Questions BT CO
PART A
16. (ii) Identify that deterministic PDA is less powerful than non CO3
nondeterministic PDA.(7)
Construct a PDA accepting {anbman / m, n>=1} by emptystack. Also R
tell the corresponding context-free grammar accepting the same
set.(6)
PART - C
1. (i) Design and Explaina PDA to accept each of the following CO3
language E
{aibjck|i=j or j=k}(7)
The set of all string with twice as many 0’s and 1’s. (8)
2. (i) Let P be a PDA with empty stack language L=N(P) and suppose CO3
that ε is not in L. Designhow you would modify P so that it accepts C
L U { ε} by empty stack.(8).
Design a DPDA for even length palindrome.(7)
3. CO3
(i) Convert the following CFG to PDA and analyze the answer (a+b)
and a++. (8)
Ia|b|Ia|Ib|I0|I1 A
EI|E+E|E*E|(E)
(ii) Convert the following CFG to PDA by empty stack.(7)
S0S1/A;
A1A0/S/ ε Infer whether 0101 belongs to N(M).
4. (i)If L is a CFL then prove that there exists PDA M, such that L=N(M) C CO3
, language accepted by empty stack .(7) (ii)Construct a PDA empty
store , L= {am bn|n<m}.(8)
Q. No. Questions BT CO
PART A
1 What are the three ways to simplify a context free grammar? R CO4
PART B
1. Express the following grammar G into Greibach Normal CO4
Form(GNF) (13)
SXA|BB R
Bb|SBXb Aa
2. Use the CFL pumping lemma to show how each of these languages U CO4
not to be context-free{aibjck| i<j<k} (13)
3. (i) Discussa TM to accept the language LE={1n 2n 3n|n >= 1}(6) CO4
Construct a turing machine that estimate unarymultiplication (Say U
111 X 11 = 11111) (7)
4. (i) Illustrate the Turing machine for computing f(m, n)=m-n( CO4
proper subtraction). (7)
A
Demonstrate a Turing Machine to compute f(m+n)=m+n, m,n>=0
and simulate their action on the input 0100. (6)
5. (i) Examinethe role of checking off symbols in a Turing CO4
Machine.(6) R
Describe a Turing Machine M to implement the function
“multiplication” using the subroutine copy(7)
6. (i) Demonstrate the implications of halting problem.(7) A CO4
Show that if a language is accepted by a multitapeturing machine ,it is
accepted by a single-tape TM .(6)
7. (i) Summarize in detail about multihead and multitape TMwith CO4
an example.(7) E
Construct a Turing Machine to accept palindromes in analphabet
set ∑={a,b}.Trace the strings “abab” and “baab”.(6)
8. (i) Explain the TM as computer of integer function with an A CO4
example.(7)
Design a TM to implement the function f(x)= x+1. (6)
9. (i) Design a TM to accept the set of all strings {0,1} with 010as C CO4
substring.(7)
Write shot notes on Two –way infinite tape TM.(6)
10. (i)Describe computing a partial function with a TM.(6) (ii)Design a R CO4
TM to accept the language LE={anbncn |n >1}.(7)
11. (i) Define Turing machine for computing f(m, n)=m*n,n€N. (7) R CO4
Write notes on Partial solvability.(6)
12. (i) Construct a TM to reverse the given string {abb}. (6) CO4
Explain Multi tape and Multi head Turing machine withsuitable U
example.(7)
13. (i) Analyze and Construct a TM to compute a function f(w) CO4
=WR where W€{a,b}.(7) A
Construct Turing machine (TM) that replace all occurence of 111 by
101 from sequence of 0’s and 1’s.(6)
14. (i) Infer the Chomsky grammar classification with necessary CO4
example. (6) A
Explain a TM with no more than three states that accepts the
language. a(a+b) *.Assume €={a,b}. (7)
PART C CO4
1. (i) Compose the limitation of automata for Type 3, Type 2, type 0 CO4
languages.(7)
Consider two-tape Turing Machine (TM) and determine whether the C
TM always writes a nonblank symbol on its secondtape during the
computation on any input string ‘w’. Formulatethis problem as a
language and show it is undecidable.(8)
2. i) Define pumping lemma for CFL. Show that L={aibjck, i<j<k} is CO4
not context free and Judge your answer.(6)
ii) Construct a TM to move an input string over the alphabet A= E
{a} to the right one cell. Consider that the tape head starts
somewhere on a blank cell to the left of the input string to theright one
cell , leaving all the remaining cell blank.(9)
3. (i) Design and explain a TM to compute f(m,n) = m*n , for allm,n€ A CO4
N.(6)
Explain how a multi track in a TM can be used for testinggiven
positive integer is a prime or not(9).
4. (i) Prepare a subroutine to move a TM head from its current CO4
position to the right, skipping over all 0’s until reaching a 1 or a
blank. If the current position does not hold 0, then the TM should
halt. You may assume that there are no tape symbol otherthan 0,1 and C
B(blank). Then , use this subroutine to design to TM that accepts all
strings of 0’s and 1’s that do not have two 1’s in a row.(8)
Write short notes on checking off symbols(7)
UNIT-V- UNDECIDABILITY
Q. No. Questions BT CO
PART A
1 When a language is said to be recursively enumerable? R CO5
2 Define Non Recursive language. R CO5
3 When a language is said to be recursive? U CO5
4 Define decidable problems R CO5
5 Define undecidable problems. R CO5
6 Define universal language. AN CO5
7 Define problem solvable in polynomial time. C CO5
8 Define the class P and NP. R CO5
9 Define NP – Complete Problem AN CO5
10 Write the Significance of NP-Complete Problem. AN CO5
PART B
1. (i)Describe about the tractable and intractable problems.(7) R CO5
(ii)Identify that “MPCP reduce to PCP”.(6)
2. (i) Describe about Recursive and Recursive Enumerable languages R CO5
with example.(7)
State and describe RICE theorem.(6)
3. (i) Summarize diagonalization language.(6) CO5
Discuss the significance of universal turing machine and also U
construct a turing machine to add two numbers and encode it .(7)
4. Discuss post correspondence problem .Let ∑={0,1}.Let A andB be U CO5
the lists of three strings each ,defined as
(i) Does the PCP have a solution?(7)
i. Prove that the universal language is
recursivelyenumerable.(6)
5. (i)Explain computable functions with suitable example.(6) A CO5
(ii)Explain in detail notes on Unsolvable Problems.(7)
6. (i) Describe in detail notes on universal Turing machines with CO5
example.(7) R
Collectand write the short notes on NP-complete
problems.(6)
7. (i) Show that the diagonalization language (Ld) is not a A CO5
recursively enumerable.(7)
Illustrate about unsolvability.(6)
8. (i)Compare the difference between recursive and recursively E CO5
enumerable languages.(7) (ii)Explain about PCP.(6)
9. (i) Explain about Universal Turing machine and show that the C CO5
universal language (Lu) is recursively enumerable but not
recursive. Generalize your answer(8)
Design and explain how to measure and classifycomplexity.(5)
10. (i) Explain about the recursively Enumerable Language with CO5
example.(6) A
Point out that the following problem is undecidable. Given two CFGs
G1 and G2 is L(G1) L(G2) =∅.(7)
11. (i) Show that the characteristic function of the set of all even CO5
number is recursive .(7) A
Illustrate in detail notes on primitive recursive functionswith
examples.(6)
12. (i)Point out the Measuring and Classifying Complexity.(7) A CO5
(ii)Does PCP with two lists x=(b,b ab3,ba) and y=(b3,ba,a)
have a solution. Analyze your answer.(6)
13. (i) Discuss in detail about Time and Space Computing of a CO5
Turing Machine(6)
U
Express two languages which are not recursivelyenumerable.(7)
14. (i) Describe in detail Polynomial Time reduction and NP- CO5
completeness.(7) R
List out the short notes on NP-Hard Problems.(6)
PART C CO5
1. Consider and find the languages obtained from the following CO5
operations:
(i) Union of two recursive languages.(5) E
(ii) Union of two recursively enumerable languages.(5)
L if L and complement of L are recursively enumerable.(5)
2. Prove that the universal language is recursively enumerable but C CO5
not recursive. Generalize your answer.(15)
3. (i) Plan and explain on decidable and un-decidable problems CO5
with an example(7) C
Design and prove that for two recursive languages L1 andL2
their union and intersection is recursive.(8)