PANIMALAR ENGINEERING COLLEGE
(An Autonomous Institution, Affiliated to Anna University Chennai)
QUESTION BANK
Details of the Course
Name of the Department : Computer Science and Engineering
Name of the Course : Theory of Computation
Course Code : 21CS1503
Semester :V
Common To Programme(s) : CSBS
Course Outcome: (List the Course Outcomes of the Course)
CO1: Construct finite automata, regular expression for any pattern.
CO2: Write context free grammar for any construct.
CO3: Build pushdown automata to recognize a context free language.
CO4: Design Turing machines for any language.
CO5: Propose computation solutions using Turing Machine.
CO6: Drive whether a problem is decidable or not.
Bloom’s Level: BL1 - Remembering, BL2 - Understanding, BL3 - Applying, BL4 - Analyzing, BL5 – Evaluating, BL6 - Creating.
UNIT- I - FINITE AUTOMATA
Course Marks
PART A ( 2 Marks) Bloom’s Level
Outcome Allotted
1. Prove 1+2+3+………………+k= k(k+1)/2 using induction method. [BL4] [CO1] [2]
2. Differentiate between proof by contradiction and proof by contra [BL2] [CO1] [2]
positive.
3. [BL4] [CO1] [2]
Construct DFA which accepts a string that contains second symbol is zero and fourth symbol is 1 over an alphabet ={0
4. Define Non-Deterministic Finite Automation with ε Transition. [BL1] [CO1] [2]
5. Differentiate NFA and DFA. [BL2] [CO1] [2]
Descriptive Questions ( 13 /15/16 Marks)
6. i. Prove the following by the principle of induction. [BL2] [CO1] [7]
n
n ( n+ 1 ) (2 n+1)
∑ K 2= 6
k =1
ii. Prove that 2 is not rational. [BL2] [CO1] [6]
7. [BL6] [CO1] [7]
i. Given ={a,b} construct
m a DFA which recognize the language L={b
abn:m,n>0}.
ii. Construct the DFA accepting the language over the alphabet [BL6] [CO1] [6]
={0,1}, where n umber of 1’s is a multiples of 3.
8. Construct NFA that accepts all string that ends in [Link] its transition [BL3] [CO1] [13]
table and extended transition function for the input string 00101 also
construct a DFA for the above NFA using subset construction method.
9. Convert the ε -NFA to DFA and list the difference between NFA and [BL4] [CO1] [13]
DFA.
Couse Instructor Course Coordinator Head of the Department
Name & Designation Name & Designation
10. Convert the following ε –NFA to NFA and then convert the resultant [BL4] [CO1] [13]
NFA to DFA.
UNIT- II - RREGULAR EXPRESSION AND REGULAR LANGUAGES
PART A ( 2 Marks)
Course Marks
Bloom’s Level
Outcome Allotted
1. write a regular expression for the language which accepts all strings [BL2] [CO1] [2]
with at least two a’s over the set Σ= {a, b}.
2. Show that (ϕ)*= ε for a regular expression. [BL4] [CO1] [2]
3. Construct finite automata for the regular expression (0+1)*1*. [BL3] [CO1] [2]
4. State Pumping Lemma for regular Languages. [BL2] [CO1] [2]
5. Prove that the complement of a regular language is also regular. [BL2] [CO1] [2]
Couse Instructor Course Coordinator Head of the Department
Name & Designation Name & Designation
Descriptive Questions ( 13 /15/16 Marks)
6. [Link] a FA for the RE(0 +1)* (00 + 11)01. [BL4] [CO1] [7]
ii. Prove that the language L ={ am+nbman |n, m 1} is not regular . [BL2] [CO1] [6]
7. Compute Regular Expression for the given Finite Automata. [BL3] [CO1] [13]
8. Write and explain algorithm for minimization of a DFA. Using the [BL3] [CO1] [13]
above algorithm minimize following DFA.
9. Construct a minimized DFA from the Regular expression (0+1)1(0+1)* [BL5] [CO1] [15]
and trace for a string w=01101.
10. Show that the regular language is closed under: [BL2] [CO1] [13]
a. Union
b. Intersection
c. Kleen closure
d. Complement
UNIT- III - CONTEXT FREE GRAMMAR & PUSH DOWN AUTOMATA
Course Marks
PART A ( 2 Marks) Bloom’s Level
Outcome Allotted
1. Derive the string "00101" for rightmost derivation using a CFG given [BL3] [CO2] [2]
by,
SA1B
Couse Instructor Course Coordinator Head of the Department
Name & Designation Name & Designation
A0A|
B0B|1B|.
2. Define pushdown automata. [BL1] [CO3] [2]
3. State Pumping Lemma for CFL. [BL2] [CO3] [2]
4. Convert the following CFG to a push down automaton: [BL3] [CO3] [2]
A🡪0A | 1A | 0 | 1.
5. What are the closure properties of CFL? State the proof of any two [BL1] [CO1] [2]
properties.
Descriptive Questions ( 13 /15/16 Marks)
6. [Link] the following grammar: [BL3] [CO2] [9]
S🡪aAa | bBb | BB
A🡪C
B🡪S|A
C🡪S | є
For the string abaabbba. Find left most, rightmost derivation and
parse tree.
ii. Show that the following gra tommar is ambiguous: [BL4] [CO2] [4]
{S a | S + S | S S | S* | ( S ) }
7. Construct a PDA for language L = {0n+m1n2m | n>=1, m>=1} [BL5] [CO3] [13]
8. [Link] Push down Automat to recognize the grammar G with [BL4] [CO3] [7]
following production and trace for a string of acceptance and rejection.
S 🡪aSA | ε
A 🡪bB | cc
B 🡪 bd |ε
[Link] pumping lemma for CFL. Use pumping lemma to show that the [BL4] [CO4] [6]
language L = {aibjck | i<j<k} is not a CFL.
9. Construct the PDA for L= {WCWR | W is in (a+b)*} [BL5] [CO3] [13]
10. Give a CFG for the language N (M) where M=({q0,q1},{0,1},{z0,x}, [BL5] [CO3] [15]
δ,q0,z0, φ)where δ is given by ,
δ(q0,1,z0)={(q0,xz0)}
δ(q0,1,x)={(q0, xx)}
δ(q0, 0,x)= {(q1,x)}
δ(q0,ε,z0)={(q0, ε)}
δ(q1,1,x)={(q1, ε)}
δ(q1, 0,z0)={(q0, z0)}
UNIT- IV - PROPERTIES OF CONTEXT-FREE LANGUAGES
Bloom’s Level Course Marks
PART A ( 2 Marks) Outcome Allotted
1. Convert the following grammar into an equivalent one with no unit [BL3] [CO2] [2]
productions and no useless symbols:
S ABA
A aAA|aBC|bB
B A|bB|Cb
C CC|cC.
2. State the two normal forms and give an example. [BL1] [CO2] [2]
3. Define a Turing machine. [BL2] [CO4] [2]
4. Design a TM that accepts the language of even integers written in [BL3] [CO4] [2]
Couse Instructor Course Coordinator Head of the Department
Name & Designation Name & Designation
binary.
5. Construct a Turing machine for computing 2’s complement of a binary [BL3] [CO4] [2]
number with the transition diagram.
Descriptive Questions ( 13 /15/16 Marks)
6. Convert the following grammar to Chomsky Normal Form. [BL3] [CO2] [13]
S🡪 A | AB0 | A1A
A 🡪 A0 | ε
B 🡪 B1 | BC
C 🡪 CB | CA | 1B
7. i. Obtain the Greibach Normal form equivalent to the grammar [BL3] [CO2] [10]
Sa|AB, Aa|BC, Bb, Cb.
ii. Remove ε - production from the following grammar.
S 🡪 ASA | aB | b
A🡪B [BL3] [CO2] [3]
B 🡪 b | ε.
8. Design a Turing machine to recognize the language L = {0n1n2n [BL6] [CO4] [13]
| n1}.
9. Explain in detail about programming techniques of TM construction. [BL2] [CO5] [13]
10. Construct a Turing Machine for multiplying two non-negative integers [BL6] [CO5] [15]
using “copy” subroutine.
UNIT- V - UNDECIDABILITY
Course Marks
PART A ( 2 Marks) Bloom’s Level
Outcome Allotted
1. When a language is said to be recursive or recursively language? [BL2] [CO6] [2]
2. Let L be a language and L' be its complement. Identify whether the [BL4] [CO6] [2]
given language is recursive or recursively enumerable.
3. Let Σ={0,1}. Let A and B be the lists of three strings each, defined as [BL4] [CO6] [2]
List A List B
I wi xi
1 1 111
2 10111 10
3 10 0
Does this PCP have a solution? Explain?
4. What is Post Correspondence Problem (PCP)? [BL1] [CO6] [2]
5. Define Halting Problem. [BL1] [CO6] [2]
Descriptive Questions ( 13 /15/16 Marks)
6. Find whether the following languages are recursive or recursively
enumerable.
i. Union of two recursive languages. [BL4] [CO6] [4]
ii. Intersection of two recursively enumerable languages. [BL4] [CO6] [4]
iii. Universal language Lu. [BL4] [CO6] [5]
7. i Explain in detail about undecidable problems about Turing machines. [BL2] [CO6] [7]
ii. Prove that there exists an recursively enumerable language whose [BL4] [CO6] [6]
complement is not recursively enumerable.
8. i. Define a language Ld and show that the language is not recursively [BL2] [CO6] [6]
enumerable.
ii. State the halting problem of TMs. Prove that the halting problem of [BL2] [CO6] [7]
Turing Machine over {0,1}* as unsolvable.
9. Consider the turing machine M and w=01, where M=({q1,q2,q3), {0,1}, [BL5] [CO6] [15]
Couse Instructor Course Coordinator Head of the Department
Name & Designation Name & Designation
{0,1,B}, δ, q1, B,{q3}) and δ is given by
qi δ(q,0) δ(q,1) δ(q,B)
🡪q1 (q2,1,R) (q2,0,L) (q2,1,L)
q2 (q3,0,L) (q1,0,R) (q2,0,R)
*q3 - - -
Reduce the above problem to Post correspondence problem and find
whether that PCP has a solution or not.
10. [BL4] [CO6] [13]
Prove that if L1 and L2 are Recursively Enumerable language over , then L1UL2 and L1L2 are also Recursively En
Couse Instructor Course Coordinator Head of the Department
Name & Designation Name & Designation