0% found this document useful (0 votes)
11 views9 pages

Don't: Problem

gate notes

Uploaded by

adarsh gupta
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)
11 views9 pages

Don't: Problem

gate notes

Uploaded by

adarsh gupta
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/ 9

What computer science deals with?

Don’t

So we do not study how to design a computer

We do not study how to run a computer

Do

We deal with problem solving, according to computer science a problem can


be divided as follows

PROBLEM

SOLVABLE UNSOLVABLE

DECIDABLE UNDECIDABLE

P TYPE NP TYPE

Konigsberg bridge problem

Lets understand the meaning of each type

SOLVABLE - A problem is said to be solvable if either we can solve it or if we can


prove that the problem cannot be solved

UNSOLVABLE - A problem is said to be unsolvable if neither we can solve it, nor we


can proof that the problem can not be solved

Solvable problems can further be divided into two types

Decidable- if there exist a polynomial time algorithm to solve a problem then


problem is said to be decidable
Undecidable- if there exist a non- polynomial time algo to solve a problem, or
a polynomial time algo

Decidable problem can further be divided into two types

P type- a problem is said to be P type is there exist a polynomial time algo to


solve a problem

NP TYPE – a problem is said to be NP type if there exist a np time algo to


solve a problem on a deterministic machine or there exist a polynomial time
algo to verify a problem
Q The statement P ⊆ Np is
a) true b) false c) still open for argument d) none of these

Q Assuming P ≠ NP, which of the following is TRUE? (GATE-2012) (1 Marks)


a) NP-complete = NP b) NP-complete ∩ P = ∅
c) NP-hard = NP d) P = NP-complete

Q For problem X and Y, Y is NP – complete and X reduces to Y in polynomial time. Which of


the following is TRUE? (GATE – 2008) (2 Marks)
a) IF X can be solved in polynomial, time then so can Y
b) X is NP – complete
c) X is NP – hard
d) X is in NP – but not necessarily NP – complete

Q A problem in NP is NP – complete if [GATE - 2006] (2 Marks)


a) It can be reduced to the 3 – SAT problem polynomial time
b) The 3-SAT problems can be reduced to it in polynomial time
c) It can reduce to any other problem in NP in polynomial time
d) Some problem in NP can be reduced to it in polynomial time

Q Which of the following is true about NP-Complete and NP-Hard problems.


(A) If we want to prove that a problem X is NP-Hard, we take a known NP-Hard problem Y
and reduce Y to X
(B) The first problem that was proved as NP-complete was the circuit satisfiability problem.
(C) NP-complete is a subset of NP Hard
(D) All of the above
(E) None of the above

Q Suppose a polynomial time algorithm is discovered that correctly computes the largest
clique in a given graph. In this scenario, which one of the following represents the correct
Venn diagram of the complexity classes P, NP and NP Complete (NPC)? (GATE-2012) (1
Marks)
Q In order to show that a problem  is NP-complete, Sachin shows that 3-SAT   , Dravid
shows that   2-SAT, from the above reductions, the problem  is
a) NP- complete b) NP- complete but not NP-hard
c) NP-hard but not NP- complete d) None of the above

Q Let πA be a problem that belongs to the class NP. Then which one of the following is
TRUE? (GATE-2009) (1 Marks)
a) There is no polynomial time algorithm for πA
b) If πA can be solved deterministically in polynomial time, then P = NP
c) If πA is NP-hard, then it is NP-complete
d) πA may be undecidable

Q Let SHAM3 be the problem of finding a Hamiltonian cycle in graph G = (V, E) with |V|
divisible by 3 and DHAM3 be the problem of determining if a Hamiltonian cycle exists in
such graphs. Which one of the following is true? (GATE – 2006) (1 Marks)
a) Both DHAM3 and SHAM3 are NP – hard b) SHAM3 is NP – hard, but DHAM3 is not
c) DHAM3 is NP – hard, but SHAM3 is not d) Neither DHAM3 nor SHAM3 is NP – hard

Q Consider three decision problems P1, P2 and P3. It is known that P1 is decidable and P2 is
undecidable. Which one of the following is TRUE? (GATE-2005) (2 Marks)
(A) P3 is decidable if P1 is reducible to P3
(B) P3 is undecidable if P3 is reducible to P2
(C) P3 is undecidable if P2 is reducible to P3
(D) P3 is decidable if P3 is reducible to P2’s complement
Q Let A ≤m B denotes that language A is mapping reducible (also known as many-to-one
reducible) (GATE-2014) (2 Marks)
to language B. Which one of the following is FALSE?
(A) If A ≤m B and B is recursive then A is recursive.
(B) If A ≤m B and A is undecidable then B is undecidable.
(C) If A ≤m B and B is recursively enumerable then A is recursively enumerable.
(D) If A ≤m B and B is not recursively enumerable then A is not recursively enumerable.

Q Ram and Shyam have been asked to show that a certain problem Π is NP-complete. Ram
shows a polynomial time reduction from the 3-SAT problem to Π, and Shyam shows a
polynomial time reduction from Π to 3-SAT. Which of the following can be inferred from
these reductions? (GATE-2003) (2 Marks)
(A) Π is NP-hard but not NP-complete (B) Π is in NP, but is not NP-complete
(C) Π is NP-complete (D) Π is neither NP-hard, nor in NP

Q Let S be an NP – complete problem Q and R be two other problems not known to be in


NP. Q is polynomial – time reducible to S and S is polynomial – time reducible to R. Which
one of the following statements is true? (GATE-2006) (2 Marks)
a) R is NP – complete b) R is NP – hard
c) Q is NP – complete d) Q is NP- hard

Q Language L1 is polynomial time reducible to language L2. Language L3 is polynomial time


reducible to L2, which in turn is polynomial time reducible to language L4. Which of the
following is/are True? (GATE-2015) (2 Marks)
I. If L4 ∈ P, L2 ∈ P II. If L1 ∈ P or L3 ∈ P, then L2 ∈ P
III. L1 ∈ P, if and only if L3 ∈ P IV. If L4 ∈ P, then L1 ∈ P and L3 ∈ P
(A) II only (B) III only (C) I and IV only (D) I only

Q Let X be a recursive language and Y be a recursively enumerable but not recursive


language. Let W and Z be two languages such that Y reduces to W, and Z reduces to X
(reduction means the standard many-one reduction). Which one of the following
statements is TRUE (GATE-2016) (2 Marks)
(A) W can be recursively enumerable and Z is recursive.
(B) W can be recursive and Z is recursively enumerable.
(C) W is not recursively enumerable and Z is recursive.
(D) W is not recursively enumerable and Z is not recursive

Q Consider two decision problems Q1, Q2 such that Q1 reduces in polynomial time to 3-SAT
and 3-SAT reduces in polynomial time to Q2. Then which one of the following is consistent
with the above statement?(CS-2015)
(A) Q1 is in NP, Q2 is NP hard (B) Q2 is in NP, Q1 is NP hard
(C) Both Q1 and Q2 are in NP (D) Both Q1 and Q2 are in NP hard

Q Nobody knows yet if P = NP consider the language L defined as follows L + (0 + 1)* if = NP


= ϕ otherwise (GATE-2003) (1 Marks)
Which of the following statement is true?
a) L is recursive
b) L is recursively enumerable but not recursive
c) L is not recursively enumerable
d) Whether L is recursive or not will be known after we find out if P = NP

Q If 1 p 2 (1 is polynomially reduces to 2) then consider the statements


S1: if 1  P then 2  P
S2: if 2  P then 1  P
S3: if 1 is un-decidable then 2 is Un- decidable
S4: if 2 is un-decidable then 1 is Un- decidable
a) Only S1 and S2 b) Only S2 and S3
c) Only S3 and S4 d) Only S4 and S1

Q If there is an NP – complete language L whose complement is in NP, then the


complement of any language in NP is in
a) NP b) P c) Both a and b d) None of these

Q The Travelling Salesman Problem (TSP) is


a) NP but not NP complete b) NP – complete
c) Neither NP nor NP – complete d) none of these

Q consider the following two problems of graph. (GATE-2015) (2 Marks)


1) Given a graph, find if the graph has a cycle that visits every vertex exactly once except
the first visited vertex which must be visited again to complete the cycle.
2) Given a graph, find if the graph has a cycle that visits every edge exactly once.
Which of the following is true about above two problems.
(A) Problem 1 belongs NP Complete set and 2 belongs to P
(B) Problem 1 belongs to P set and 2 belongs to NP Complete set
(C) Both problems belong to P set
(D) Both problems belong to NP complete set

A) 1, 2 and 3 B) 1 and 2 only C) 3 and 2 only D) 1 and 3 only

Q Consider the following two problems on undirected graphs: (GATE – 2005) (1 Marks)
𝜶: Given G (V, E) does G have an independent set of size |V| - 4?
β: Given G(V, E), does G have an independent set of size 5?
Which one of the following is true?
a) 𝛼 is in P and β NP – complete b) 𝛼 is NP – complete in and β is in P
c) Both 𝛼 and β are NP – complete d) Both 𝛼 and β are in P

Q (GATE-2014) (2 Marks)

(A) solvable in polynomial time by reduction to directed graph reachability


(B) solvable in constant time since any input instance is satisfiable
(C) solvable in constant time since any input instance is satisfiable.
(D) NP-hard, but not NP-complete
Q The subset-sum problem is defined as follows: Given a set S of n positive integers and a
positive integer W, determine whether there is a subset of S whose elements sum to W. An
algorithm Q solves this problem in O(nW) time. Which of the following statements is false?
(GATE-2008) (2 Marks)
a) Q solves the subset-sum problem in polynomial time when the input is encoded in unary
b) Q solves the subset-sum problem in polynomial time when the input is encoded in binary
c) The subset sum problem belongs to the class NP
d) The subset sum problem is NP-hard

Q Which of the following statements are TRUE?


1. The problem of determining whether there exists a cycle in an undirected graph is in P.
2. The problem of determining whether there exists a cycle in an undirected graph is in NP.
3. If a problem A is NP-Complete, there exists a non-deterministic polynomial time
algorithm to solve A.
(A) 1, 2 and 3 (B) 1 and 2 only (C) 2 and 3 only (D) 1 and 3 only

Q Which of the following is in P?


PATH, HAMPATH, SAT, 3AT
a) SAT b) 3SAT c) PATH d) HAMPATH

Q The problem 3-SAT and 2-SAT are


(A) both in P (B) both NP complete
(C) NP-complete and in P respectively (D) undecidable and NP-complete respectively

Q Which of the following is false?


a) PATH is a class problem b) Dijkstra’s algorithm is a problem in P
c) CLQUE is a NP class problem d) RELPRIME is a NP class problem

A)1, 2 and 3
B)1 and 2 only
C)3 and 2 only
D)1 and 3 only

Q Let X be a recursive language and Y be a recursively enumerable but not recursive


language. Let W and Z be two languages such that Y' reduces to W, and Z reduces to X'
(reduction means the standard many-one reduction). Which one of the following
statements is TRUE? (GATE-2016) (2 Marks)
A) W can be recursively enumerable and Z is recursive.
B) W can be recursive and Z is recursively enumerable.
C) W is not recursively enumerable and Z is recursive.
D) W is not recursively enumerable and Z is not recursive
Ans: c

You might also like