Sie sind auf Seite 1von 2

Unit V Two mark questions. 1. Class P problem.

Class P is a class of decision problems that can be solved in polynomial time be deterministic algorithms. Class P problem are called as polynomial. 2. Class NP problem. Class NP is the class of decision problems that can be solved by non deterministic polynomial algorithm. Class NP problems are called as non deterministic polynomial. Most of the decision problems are in NP. Class NP includes all the problems in P. P is the subset of NP. 3. NP complete problem. A decision problem D is said to be NP complete if, i) It belongs to class NP. ii) Every problem in NP is polynomially reducible to D. 4. Deterministic algorithms. Algorithm which has the property that the result of every operation is uniquely defined is termed as deterministic algorithm. 5. Non deterministic algorithm 6. Algorithms which contain operations whose outcomes are non uniquely defined but are limited to specific set of possibilities are called as Non deterministic algorithm. 7. Decision Vs optimization problem. Optimization problem. i) It optimizes some objective function based on the problem instance. ii) There are many possible solutions for a problem and an optimal solution to th e problem must be found. Decision problem: i) The decision problems output is either yes or no. ii) An abstract decision that can be viewed as function that maps the instance set 1 to the solution set {0,1}. 8. Performance ratio: The performance ratio is the principle metric for measuring the accuracy of the approximation algorithm. It is defined by RA. Its value is either close to 1 or infinity. 9. Halting problem. A halting problem is given a computer program and an input to it, determine whether the program will halt on that input or continue working indefinitely on it. It is the example for undividable problem.

10. Tractable problem Problem that can be solved in polynomial time are called tractable. 11. InTractable problem Problem that cannot be solved in polynomial time are called tractable. 12. Decision problem A problem with yes/no answer is called decision problem. 13. Functions in non deterministic algorithm. i) Choice- Chooses one element of set s. ii) Failure- signals an unsuccessful completion. iii) Success- signals an successful completion. 14. Optimization problem. Optimization problem optimizes some objective function based on the problem instances. 15. Approximation algorithm. Approximation algorithms are often used to find the approximation solutions to difficult problems of combinatorial optimization. HALTING PROBLEM: Given a computer program and an input to it, determine whether the program will halt on that input or continue working indefinitely on it. Proof: Assume that A is an algorithm that solves that halting problem. That is , for any program P and Input I. A(p,I)= 1, if program P halts on Input-I; 0, if program P does not halt on Input I; We can consider program p as an input to itself and use the output of the algorithm A for pair(P,P) to construct a program Q as follows Q(p)= halts if A(Q,Q)=0 ie if program P does not halt on Input P. does not halt if A(P,P)=1 ie if program P halts on input P. Then on substituting Q for P, we obtain Q(Q)= halts if A(Q,Q)=0 ie if program Q does not halt on Input Q. does not halt if A(Q,Q)= 1 it if program Q halts on input Q.