0% found this document useful (0 votes)
132 views

CS3452 Theory of Computaion QuestionBank

CS3452 Theory Of Computaion QuestionBank

Uploaded by

ammukutty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

CS3452 Theory of Computaion QuestionBank

CS3452 Theory Of Computaion QuestionBank

Uploaded by

ammukutty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

www.poriyaan.in https://cse.poriyaan.

in/

(An Autonomous Institution, Affiliated to Anna University, Chennai)


DEPARTMENT: Computer Science and Engineering /Information Technology
IV - Semester
CS3452- THEORY OF COMPUTATION
(B.E/B.Tech – CSE/IT)

(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.

2 What is the need for automata?

3. Design FA which accepts odd number of 1’s and any number of 0’s.

4. Design FA to check whether given binary number is divisible by three.

5. State the difference between NFA & DFA.

6. Define the term � transition

7. Draw a NFA to accept strings containing the substring 0101

8. Define � –Closure (q) with an example

9. Define Non-Deterministic Finite Automata

10. Define Deterministic Finite Automata

11 What is structural induction?

12 What is proof by contradiction?

13 Prove 1+2+3+…+n= n(n+1)/2 using induction method

14 Write any three applications of Automata Theory

15 Define (i) Finite automaton? (ii)Transition diagram

16 Define deductive proof

https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/

17 Give some examples for additional forms of proof.

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

Prove the following by mathematical induction method


(i) 2n > n for all n≥0
2. 13
(ii) x ≥4, 2x ≥ x2

Construct DFA equivalent to the NFA given below

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.

i) Convert the following NFA-with ε, to a NFA- without ε


ε
0 1 2
q0
{q0} {φ} {φ} {q1}
(start)
q1 {φ} {q1} {φ} {q2}
9. * q2 {φ} {φ} {q2} {φ} 13
ii) Convert to a DFA, the following NFA
a b
p(start) {p} {p,q}
q {r} {r}
r {Φ} {Φ}

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/

1. Minimize the following DFA

15

2. Minimize the following DFA.

15

3. Minimise the following DFA.

15

4. Convert ∈ - NFA to NFA

15

5. Convert ∈ - NFA to NFA

15

https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/

UNIT II REGULAR EXPRESSIONS AND LANGUAGES 9


Regular expression – Regular Languages- Equivalence of Finite Automata and regular
expressions – Proving languages to be not regular (Pumping Lemma) – Closure properties of
regular languages.
UNIT II - PART A

1. What is regular expression?

2. Give the regular expression for set of all strings ending in 00

3. Is regular set is closed under complement? Justify

4. Construct NFA for the regular expression (0+1)01

5. Show whether a language L=(0n12n/n>0} is regular or not using pumping Lemma

6. Prove or disprove that (r+s)*=r*+s*.

7. Give the description for the following language (0+10)*1.

8. State pumping lemma for regular language.


Give the regular expression for the following
9. L1= set of all strings of 0 and 1 ending in 00
L2= set of all string 0 and 1 beginning with 0 and ending with 1
10. Construct NFA for the regular expression (0+1)01
UNIT II – Part B

1 Construct an �- NFA for the regular expression b+ba*. 13


Which of the following language is regular? Justify.

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/

Convert the following NFA into a R.E

5 13

6 Construct a finite automata for the RE 10+(0+11)0*1 13


Prove that the following languages are not regular: L= {w€{a,b}*/w = wr}
7 13

Show that the regular language are closed under :


8 13
Union ,Intersection, Kleene closure, Complement, Difference
State pumping lemma and hence find whether the given language is regular or not
9 13
L={anbn/m>n}
Prove the following statement with justification.
10 “the language � = ���� �� �, � > 0 is not regular” 13

UNIT II – Part C
Convert the following to regular expression

1 15

Convert the following to regular expression

2 15

3 For every DFA A= �, �, �0 , � there is a regular expression r such that L(r) = 15


L(A).

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/

UNIT III CONTEXT FREE GRAMMAR AND PUSH DOWN AUTOMATA 9


Types of Grammar - Chomsky‘s hierarchy of languages -Context-Free Grammar (CFG) and
Languages – Derivations and Parse trees – Ambiguity in grammars and languages – Push Down
Automata (PDA): Definition – Moves - Instantaneous descriptions -Languages of pushdown
automata – Equivalence of pushdown automata and CFG-CFG to PDA-PDA to CFG – Deterministic
Pushdown Automata.
UNIT-III PART A
1 Define CFG with an example.

2 Construct a CFG for the language of palindrome string over {a, b}.

3 What is ambiguity?

4 Define sentential form.

5 Define parse tree.

6 What is a derivation?

7 When do you say grammar is ambiguous?

8 Define DPDA and NPDA.

9 What are the two normal forms of CFG?

10 What are the conventional notations of PDA?

11 What are the different ways of language acceptance by a PDA and define them?

12 What are the 2 types of derivation?

13 Define Deterministic PDA.

14 Let G = ( {S,A}, {a,b}, P,S} where P consists of S aAa, A aAa/b , Find L(G))?

15 What are the properties of the CFL generated by a CFG?

16 Construct a parse tree of (a+b)*c for the grammar E→E+E/E*E/(E)/id

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

productions.S→A, A→BC, B→ba, C→ac

Construct the PDA accepting the language L= { anbn/n>0} by empty stack and final
4 state. 13
Convert the grammar S0S1/A: A1A0/S/ ε into PDA that accepts the same
5 13
language by empty stack. Check whether 0101 belongs to N(M).
Convert the grammar SaSb/A, AbSa/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

10 Construct the PDA accepting the language L= { an�� �� �� /m,n>0} 13

11 Construct the PDA accepting the language L= { ai�� ��+� / i,j>0} 13

12 Construct the PDA accepting the language L= { ai�� �� / i >0} 13

13 Construct a PDA for the grammar S→ aB/bA, A → a/aS/bAA, B→b/bS/aBB. 13


Let G be the grammar given by S →0BB,B→0S/1S/0. Construct a PDA and test
14 13
whether it satisfies 010000 the language.

Construct a PDA equivalent to the following productions: S →aAA, A→aS/bS/a and


15 13
hence whether the PDA accepts the string abaaaa.

UNIT-III PART C

Give CFG for the PDA, � = �0 , �1 , 0,1 , �0 , � , �, �0 , �0 , ∅ Where � is given by


� �0, 1, �0 = �0 , ��0
� �0, 1, � = �0 , ��
1 � �0, 0, � = �1 , � 15
� �0, �, �0 = �0 , �
� �1, 1, � = �1 , �
� �1, 0, �0 = �0 , �0

2 A language is context free if and only if some PDA recognizes it. 15


Convert the grammar S→0S1/A, A→1A0/S/� into an equivalent PDA and check
3 whether 0101 belongs to it. 15

https://www.poriyaan.in/paper/theory-of-computation-77/
www.poriyaan.in https://cse.poriyaan.in/

UNIT IV NORMAL FORMS AND TURING MACHINES


Normal forms for CFG – Simplification of CFG- Chomsky Normal Form (CNF) and
Greibach Normal Form (GNF) – Pumping lemma for CFL – Closure properties of Context
Free Languages –Turing Machine : Basic model – definition and representation –
Instantaneous Description – Language acceptance by TM – TM as Computer of Integer
functions – Programming techniques for Turing machines (subroutines).
UNIT IV - PART A

1 What are the three ways to simplify a context free grammar?

2 What are the closure properties of CFG?

3 State the pumping lemma for CFL

4 Give the steps to eliminate useless symbols.

5 What is null production and unit production?

6 Show that L={ap/ P is prime } is not context free.

7 List all the closure properties of CFL.

8 Define Turing Machine.

9 What are the required fields of an instantaneous description or configuration of aTM?

10 What is multiple tracks Turing machine?


Explain the multi tape Turing Machine mode. Is it more power than the basic turing machine?
11
Justify your answer.
12 List out the different techniques for TM construction.

13 What is Universal Turing machine?

14 What are the differences between a Finite automata and a Turing machine?

15 What is halting problem?

16 Write short note on Chomskian hierarchy of languages.

17 Define the language recognized by the TM.

18 When do you say a TM is an algorithm?

19 Define instantaneous description of a Turing Machine.


� � �
20 Using Pumping lemma, show that the language L={ � � � |n≥1} is not a CFL.
UNIT IV - PART B
1 Is the language L = {a b c | n>=1} is context free? Justify.
n n n
13

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)

8 Construct a TM for the language L= {�� �� �� /n ≥0}. 13


Design a Turing machine which recognizes palindrome over alphabet {a,b}.Trace
9 13
the strings “abab” and “baab”.
i) Design a Turing machine to compute multiplication of two positive integers.
10 13
ii) Design a Turing machine to recognize the language 0� 1� 0� ��� � ≥ 1

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/

13 Explain the various (programming) techniques for Turing machine construction. 15

14 Design a Turing machine to compute proper subtractions. 15


Construct a Turing machine for multiplying two non negative integers using
15 15
subroutine.
UNIT V UNDECIDABILITY
Unsolvable Problems and Computable Functions –PCP-MPCP- Recursive and recursively
enumerable languages – Properties - Universal Turing machine -Tractable and Intractable
problems - P and NP completeness – Kruskal’s algorithm – Travelling Salesman Problem-
3-CNF SAT problems.

Unit V - Part A

1 List the properties of recursive and recursively enumerable languages?

2 Define diagnalization language Ld?

3 What is primitive recursive function?

4 Define recursive language.

5 What is meant by RE languages? (Or) Define regular languages.

6 When is a recursively enumerable language said to be recursive?

7 Show that union of recursive language is recursive

8 State when a problem is said to be decidable problem and give example.

9 State when a problem is said to be undecidable problem and give example.


Define intractable problem. Give example. (Or) Identify whether ‘Tower of Hanoi’
10
problem is tractable or intractable. Justify your answer.
11 What is Universal language Lu?
12 Define PCP.
13 State RICE theorem.
14 What is Universal Turing Machine?
15 Define class P.
16 Define tractable problem. Give example.
17 Define class NP.

18 State halting problem. Is halting problem decidable or undecidable problem

19 Define Polynomial time reduction.

20 Define NP-Hard. Define NP-Complete.

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

4 What is PCP? Explain with the help of an example. 13


Explain the universal Turing machine with its significance. Also explain the
5 13
construction of Universal Turing machine with example..
6 Explain decidable and undecidable problem with example. 13

7 Explain tractable problem and intractable problem with example. 13


Explain class P, class NP, NP-complete and NP-hard problem with examples in
8 13
detail.
9 Outline the concept of polynomial-time reductions. 13

10 Prove that Post Correspondence problem is undecidable. 13


Prove that Universal Language LU is recursively enumerable but not recursive. (Or)
11 13
Prove that Universal language is recursively enumerable but not recursive.

12 Define PCP and prove that PCP is undecidable. 13

13 Explain how to measure and classify complexity. 13


Consider two-tape Turing machine and determine whether the Turing machine
14 always writes a nonblank symbol on its second tape during the computation on any 13
input string. Formulate this problem as s language and show it is undecidable.
UNIT –V PART C
Find the minimal spanning tree using Kruskal’s algorithm with all necessary steps

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.

4 Index List A List B 8


1 B CA
2 A AB
3 CA A
4 ABC C
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.

Index List A List B


5 1 10 01 8
2 110 011
3 110 01
4 000 00
5 10 010

https://www.poriyaan.in/paper/theory-of-computation-77/
Civil
CSE
Home Mech
e
EEE
CSE –2nd sem Reg 2021 ECE

2nd Semester 3rd Semester


1st Semester
Professional English II Discrete Mathematics
Professional English I
Statistics and Numerical
Methods Digital Principles and
Matrices and Calculus
Computer Organization
Engineering Graphics
Engineering Physics
Foundation of Data
Physics for Information
Science Science
Engineering Chemistry

Physics
Basic for Engineering
Electrical and Data Structure
Problem Solving and Science Engineering
Electronics
Python Programming Object Oriented
Programming in C
Programming

4th Semester 5th Semester 6th Semester


Theory of Computation Computer Networks Object Oriented Software
Engineering
Artificial Intelligence Compiler Design
and Machine Learning Embedded Systems IoT
Cryptography and
Database Management Cyber Security Open Elective I
System
Professional Elective III
Algorithms Distributed Computing
Professional Elective IV

Introduction to Operating Professional Elective I Professional Elective V


Systems
Professional Elective II Professional Elective VI
Environmental Sciences
and sustainability Mandatory Course I Mandatory Course II

7th Semester 8th Semester


Human Values and Ethics Project Work/Internship

Elective-Management

Professional Elective II

Professional Elective III

Professional Elective IV

You might also like