You are on page 1of 9

THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 1


SNS COLLEGE OF TECHNOLOGY
COIMBATORE - 35

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (UG & PG)


Third Year Computer Science and Engineering, 6
th
Semester
Subject Code & Name : THEORY OF COMPUTATION

Prepared by : M.kavitha L/CSE, R.Durga L/CSE


UNIT-I CHURCH-TURING THESIS
1. What is aTuring Machine?
Turing machine is a simple mathematical model of a computer. TM has unlimited
an unrestricted memory and is a much more accurate model of a general purpose
computer. The turing machine is a FA with a R/W Head. It has an infinite tape
divided into cells ,each cell holding one symbol.

2. What are the difference between finite automata and Turing Machines?
Turing machine can change symbols on its tape, whereas the FA cannot change
symbols on tape. Also TM has a tape head that moves both left and right side
,whereas the FA doesn’t have such a tape head.
3. Define Turing Machine?
A turing machine is a 7-tuple (Q, Σ, , δ, q0, qaccept
, qreject) where
Q: finite set of states
Σ: input alphabet (cannot include blank symbol, _)
: tape alphabet, includes Σ and _
δ: transition function: Q × → Q × × {L, R}
q0: start state, q0 ∈ Q
qaccept: accepting state, qaccept ∈ Q
qreject: rejecting state, qreject ∈ Q

4. What is configuration?
Turing machine computes, changes occur in the current state, the current tape
contents and the current head location.a setting of these three items is called a
configuration.

5. What is a recursively enumerable language? THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 2


The languages that is accepted by TM is said to be recursively enumerable (r. e )
languages. Enumerable means that the strings in the language can be enumerated by
the TM. The class of r. e languages include CFL’s.
6. Define variants of Turing Machine?
Variants are
Non deterministic turing machine.
Mutlitape turing machine.
. Enumerators
7. What is a multitape TM?
A multi-tape Turing machine consists of a finite control with k-tape heads and
ktapes each tape is infinite in both directions. On a single move depending on the state
of finite control and symbol scanned by each of tape heads ,the machine can change
state print a new symbol on each cells scanned by tape head, move each of its tape
head independently one cell to the left or right or remain stationary.

8. Define nondeterministic TM?


• Arbitrarily chooses move when more than one possibility exists
• Accepts if there is at least one computation that terminates in an accepting
state
9. What is an algorithm?
An algorithm is a collection of simple instruction for carrying out some task. It is
sometimes called procedures or recipes.

10 What is a polynomial?
It is a sum of terms where each term is a product of certain variables and a
constant called a co-efficient.
Eg.6 x*x*x*y*z*z=6x
3
yz
2

11. Define Church-Turing thesis?


In 1936 Alonzo church used a notational system called -calculus to define
algorithms and Alan Turing did it with his “machines”. These two definitions were
shown to be equivalent .This connection between the informal notion and precise
definition has come to be called Church-Turing thesis

12. List the types of description.


Formal description.
Implementation description.
High-level description. THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 3


13. What is halting problem?
A ={=M,w =| TM M is a TM and M accepts w }

TM A is undecidable but TM A is Turing – recognizable hence TM A is


sometimes called the halting problem.

14. Mention the relationship between classes of languages.

15. Define universal Turing machine.


A universal Turing machine (UTM) is a TM which is capable of simulating any
other Turing machine from the description of the machine.
16. What is a Diagonalization language Ld?
The diagonalization language consists of all strings w such that the TM whose
code is w does not accept when w is given as input.
17. Why some languages are not decidable or even Turing – recognizable?
The reason that there are uncountable many languages yet only countably
many Turing machines. Because each Turing machine can recognize a single
language and there are more languages than Turing machines, some languages are not
recognizable by any Turing machine.
18. What do you mean by co-Turing-recognizable?
A language is called co-Turing-recognizable if it is the complement of a Turingrecognizable
language

19. Define Countable and Uncountable?


• A set is countable if it is finite or has the same size as N (the set of natural
numbers {1, 2, 3, …})
– Examples: N (natural numbers), Z (integers), Q (rational numbers), E
(even numbers), etc.
• A set is uncountable if it has more elements than N .
– Examples: R (real numbers) ⊃ [0,1] ⊃ Cantor set
– THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 4


20. What is a correspondence?
A function that is both one-to-one and onto is called correspond.
BIG QUESTIONS

1. Explain the various techniques for Turing machine construction.


2. Briefly explain the different types of Turing machines.
3. Design a TM to accept the language L={0
n
1
n
| n>=1}
4. Explain how a TM can be used to determine the given number is prime or not?
5. Prove that if L is recognized by a TM with a two way infinite tape if it is
recognized by a TM with a one way infinite tape
6. Prove that Halting problem is undecidable.
7. Design a Turing machine that accepts the language L={a
n
b
n
c
n
/n>1}
8. What are the various models of Turing Machine?
9. With an example explain the universal Turing machine
10. Show that halting problem of Turing machine is undecidable
11. Show that a language is decidable if it is Turing-recognizable and co-
recognizable.

UNIT-II REDUCIBILITY
1.What is reduction?
A reduction is a way of converting one problem into another in such a way
that a solution to the second problem can be used to solve the first problem.
2. What is reducibility?
The primary method of proving some problems are computationally unsolvable.
It is called reducibility.Reducibility always involves two problems which we call A
and B. If A reduces to B, we can use a solution to B to solve A.

3. What is linear bounded automation?

A linear bounded automation is restricted type of Turing machine where in the


tape head isn’t permitted to move off the portion of the tape containing the input. It
has a limited amount of memory.

4. What is a accepting computation history?


THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 5


An accepting computation history is defined as , Let M be a Turing machine
and w be a input string, for M on w is a sequence of configuration c1,c2,…cl, Where
c1 is the start configuration of M on w . cl is the accepting configuration of M and
each ci legally follows from ci-1 according to the rules of M.
5. What is a rejecting computation history?
Let M be a Turing machine and w be a input string , for M on w is a sequence
of configuration c1, c2 , … cl Where cl is a rejecting configuration of M on W .
6. Write down the algorithm that decides ALBA?

The algorithm that decides ALBA is as follows:


1. L=” on input {M,w} Where M is an LBA and w is a string .
1.1 Simulate M on w for qng^n steps until it halts
1.2 If M has halted accept if it has accepted and reject if it has rejected . If it has
not halted , reject”.
7. Write about the three conditions of computational history?

Suppose consider the input B and it has possible input C1,C2……. Cl. If B
ants to check whether the Ci satisfy the three conditions of computational history
1. C1 is a start configuration for M on w
2. Each Ci+1 legally follows from Cp
3. Cl is an accepting configuration for M

8. What is called PCP?

The phenomenon of undecidability is not confined to problems concerning


automata. An undecidable problem concerning on simple manipulation of strings is
called the post correspondence problem or PCP.
An instance of the pcp is the collection P of dominos:
P = {[t1/b1]}, [t2/b2],……….. [tk/bk]}
and a match is a sequence i1,i2,i3….il.. Where ti1,ti2….til = bi1, bi2…..bil
PCP={<P>/P is an instance of the post correspondence problem with a match}

9. How can we construct P so that a match is an accepting computation history


for M on w?

The task is to make a list of the dominos; so that the string we get by reading
off the symbols on the top is same as the string of symbols on the bottom.This list is
called a match. For example: [a/ab][b/ca][ca/a][a/ab][abc/c].Reading off the top
strings we get abcaaabc , which is same as reading off the bottom.

10. What is MPCP?


MPCP Modified Post Correspondence Problem, in that the match is
required to start with the first domino in the list. THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 6


MPCP = {<P>/P is an instance of the post correspondence with a match that starts
with the first domino}.
11. What is called mapping reducibility?
Language “A” is mapping reducible to language B, written A<=B; if there is a
computational function f: €*€* , Where for every w, w € a f(w) € B.
12. Define computable function?
A turning machine computes a function by starting with the input to the
function on the tape and halting with the output of the function on the tape a function
f: €*€* is a computable function , if some turning machine M, on every input w,
halts with just f(w) on its tape.

Eg: All arithmetic operations on integers.


13. What is recursion theorem?
Let T be a Turing machine that computes a function t: €* x €*€*. There is
a Turing machine R that computes a function r: €*€*, Where for every w :
r(w)=T(<R>,w).
The recursion theorem is a mathematical result that plays an important role in
advanced work in the theory of computability.

14. What is self reference?


The Turing machine that ignores its input and prints out a copy of its own
description, we call this as SELF.
There is a computable function q: €*€*, where for any string w, q(w) is the
description of a Turing machine Pw that prints out w and then halt.

15. What is computer virus?


A computer virus is a computer program that is designed to spread itself
among computers.
Computer virus are inactive when standing alone as piece of code, but when
placed appropriately in a host computer, thereby infecting it and they can become
activated and transmit copies of themselves to other accessible machines.Various
media can transmit viruses , including internet and transferable disks.

16. Applications of recursion theorem?


1. ATM is undecidble.
2. MINTM is not Turing recognisable
3. Fixed point theorem.

17. What is a fixed point?


A fixed point of a function is a value that isn’t changed by application of the
function.
18. Define formula.
A formula is a well formed string over this alphabet. THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 7


19. What are the Boolean operations and Quantifiers?
The form of the alphabet of this language :
{^,v,¬,(,),for all, x , there exists,R1,….Rk}.The symbols ^,v, ¬ are called Boolean
operations.The symbols of “for all” and ”there exists” are called Quantifiers. The
symbol x denotes the variable R1,R2,..Rk ,called the relations.
20. What is atomic formula?
A string of the form Ri (x1,x2,x3,..xj) is an atomic formula. The value ‘j’
is the arity of the relation symbol Ri.
21. What is called Sentence/Statement and Free variable?
A variable that isn’t bound within the scope of a quantifier is called a Free
variable. A formula with no free variable is called a Sentence or Statement.
22. What is model?
A universe together with an assignment of relations to relation symbol is
called a model .
A model M is a tuple (U, P1,P2..Pk), where U is the universe and P1 through
Pk are the relations assigned to symbols R1 through Rk.
23. What is language of a model?
Language of a model is the collection of formulae that use only the relational
symbols the model assign and that use each relation symbol with the correct arity.
If is a sentence in a language of a model , is either true or false in that
model.

24. What is decidable theory?


Let (N,+) be the model, except without x relation. Its theory is Th(N,+).
For example: the formula[x+x=y] is true therefore a member of Th(N,+).
25. What is undecidable theory?
Let (N, + ,X) be a model whose universe is the Natural numbers with the
usual +,X relations.
Church showed that Th(N,+,X) the theory of this model; is undecidable.
26. What is called Turing Reducibility?
Language A is Turing reducible to language B, written A<=TB, if A is
decidable relative to B.
Turing reducibility is a generalization of mapping reducibility.
27. What is called Oracle Turing machine?
An Oracle for a language B is an external device that is capable of reporting
whether any string w is a member of B.
An Oracle Turing machine is a modified Turing machine that has the
additional capability of quering an Oracle.
28. What is an information?
Definition of information depends upon the application.
For example: A= 0101010101010101 THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 8


B= 11101110111000111
Sequence A contain little information because it is merely a repetition of
pattern 01 twenty times. In contrast sequence B appears to contain more information.
29. What is minimal Description?
Minimal Description of x, written d(x), is the shortest string (M, w), where
TM,M on input w halts with x on its tape.
30. What is Descriptive complexity?
The Descriptive complexity of x, written k(x) is k(x) = |d(x)|
where k(x) – length of the minimal description of x.
The definition of k(x) is intended to capture the amount of information in the
string x.
31. When an x is a C-compressible?
Let x be a string, say that x is C-compressible if k(x) <= |x| - C.

BIG QUESTIONS
1. Explain how Post correspondence problem is undecidable?
2. Prove that HALTTM is undecidable.
3. Prove that ETM is undecidable.
4. Prove that REGULAR TM is undecidable.
5. Prove that EQ TM is undecidable.
6. Prove that A LBA is decidable.
7. Prove that E LBA is undecidable.
8. Prove that ALL CFG is undecidable.
9. State and prove PCP is undecidable.
10. Prove that EQ TM is neither Turing-recognizable nor co-Turing-recognizable.
11. State and prove recursion therorem
12. Explain self-reference in detail.
13. Explain decidability of logical theories?
14. Write a brief note on a decidable theory?
15. Write a brief note on an undecidable theory?
16. Explain Turing reducibility?
THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 9


UNIT-III TIME COMPLEXITY
1.Define complexity
• Complexity Theory = study of what is computationally feasible (or tractable)
with limited resources:
– running time
– storage space
– number of random bits
– degree of parallelism
– rounds of interaction
others…

2. Define time complexity


The time complexity of a TM M is a function f:N N, where f(n) is the
maximum number of steps M uses on any input of length n.

3. Define Asymptotic Notation


Running time of an algorithm as a function of input size n for large n.
Expressed using only the highest-order term in the expression for the exact running
time

4. What do you mean by polynomial and exponential bounds?


Bounds of the form n
c
for c greater than 0 .such a bound are called polynomial
bounds.Bounds of the form 2
(n )
.

s
.
uch a bound are called exponential bounds when
is a real number greater than 0

5. What is Hamiltonian path?


A Hamiltonian path in a directed graph G is a directed path that goes through each
node exactly once. We consider a special case of this problem where the start node
and target node are fixed.
THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 10


6. List the types of

Asymptotic Notation.

• Big Oh (O) notation provides an upper bound for the function f


• Omega (Ω) notation provides a lower-bound
• Theta (Q) notation is used when an algorithm can be bounded both from
above and below by the same function
• Little oh (o) defines a loose upper bound.
7. What is Hamiltonian path?
A Hamiltonian path in a directed graph G is a directed path that goes through
each
node exactly once. We consider a special case of this problem where the start node
and target node are fixed.

8. Defines brute –force search


Exponential time algorithms typically arise when we solve by searching through
a spsce of solutions called brute –force search
9. Define running time.
The running time of N is the function N→N, wheref(n) is the maximum of
steps that N uses on any branch of its computation on any of length n.
10. Define class P
The class of all sets L that can be recognized in polynomial time by deterministic
TM. The class of all decision problems that can be decided in polynomial time.
11. Define class NP.
Problems that can be solved in polynomial time by a nondeterministic TM.
Includes all problems in P and some problems possibly outside P.

12. Define verifier.


A verifier for a language A is an algorithm V, where
A = {w | V accepts <w,c> for some string c}.
We measure the time of a verifier only in terms of the length of w, so a
polynomial time verifier runs in polynomial time in the length of w.
A language A is polynomially verifiable if it has a polynomial time verifier. The
above string c, used as additional information to verify that w∈∈∈A, is called a
certificate, or proof, of membership in A. THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 11


13. What do you mean by NP-completeness?
If a polynomial time algorithm exists for any of the NP-complete problems, all
problems in NP would be polynomial time solvable. These problems are called
by NP-completeness
14. Define polynomial time computable functions.
A function f:£ →£* is a polynomial time computable functions if some polynomial
time turing machine exists that halts with just f(w) on its tape. when started on
any input w.
15. Define polynomial time mapping reducible.
We say that A is polynomial time mapping reducible, or simply polynomial
time reducible, to B, written A≤≤≤PB, if a polynomial time computable function f: ΣΣΣ*
→→→ ΣΣΣ* exists s.t. for every string w∈∈∈∈ΣΣΣΣ*, w∈∈∈A iff f(w)∈∈∈B. Such
a function f is
called a polynomial time reduction of A to B.
16. Define literal.
A literal is a Boolean variable x or a negated Boolean variable x.
17. Define clause.
A clause s several literals connected with ∨∨∨s, as in (x ∨∨∨ y ∨∨∨ z ∨∨∨ t).
18 .Define conjunctive normal form.
A Boolean formula is in conjunctive normal form, called a cnf-formula, if it
comprises several clauses connected with ∧∧∧s, as in
(x ∨∨∨ y ∨∨∨ z ∨∨∨ t) ∧∧∧ (x ∨∨∨ z) ∧∧∧ (x ∨∨∨ y∨∨∨ t)
• A cnf-formula is a 3cnf-formula if all the clauses have 3 literals, as in
(x ∨∨∨ y ∨∨∨ z) ∧∧∧ (x ∨∨∨ z ∨∨∨ t) ∧∧∧ (x ∨∨∨ y ∨∨∨ t) ∧∧∧ (z ∨∨∨

BIG QUESTIONS
1. Show that every CFL is a member of class P problem
2. Show that a language is in NP if it is decided by some non deterministic
polynomial time Turing machine.
3. Explain the cook-Levin theorem
4. Explain about the vertex cover problem.
5. Explain about Hamiltonian path problem.
6. Briefly discuss about the subset sum problem? THOERY OF COMPUTATION

SNSCT – Department of Computer Science & Engineering (UG&PG) Page 12


7. With an example explain BIG-O and SMALL-O notation.
8. Explain about Analyzing algorithms in detail?
9. Explain CLASS P in briefly with an example?
10. State and prove PATH € P.
11. State and prove RELPRIME € P.
12. Prove that every context-free language is a member of P.
13. Explain with an example CLASS-NP?
UNIT-IV-

1. Define space complexity?

You might also like