I have posted these solution keys here because all the books, available in the market, have lots of wrong solutions. Most of the students, like me, find themselves in dilemma and waste a lot of time in finding the correct keys. These solution keys are those which I had corrected while preparing for GATE Computer Science 2012 Exam. You will find most of these solution keys to be correct, except few for which I could not find the correct solution. Still I suggest you that please keep your mind open while using these keys.
GATE 2003 CS Solution Keys
I think answer for Q.78 and Q.79 should be (c). Have you verified them?
It might be. I have uploaded whatever keys I had. Some might be wrong too.
For question 59 I believe B is the correct answer.
t=newtemp() is the only statement that generates a temporary variable.
E.place=id.place is just an assignment. It doesn’t generate any code.
Answer for Q. 12 should be A,
As per the definition:
A decision problem C is NP-complete if:
1. C is in NP, and
2.Every problem in NP is reducible to C in polynomial time.
Question does not talk about problem being in NP.
Yes, you are right. I have updated it.
isnt it when a npc problm is polynomial time reducible into sm unkwn problm thn
that unkwn will be nph problm and when
there is a polynomial time reduction from unkwn to npc then that unkwn will be np problm
by these two results we can say now that unknown problm is npc problm.
so answr should be c.. wt u think???
I am not sure about the second reduction. Can you give me some reference about it?
The problem is polynomial time reducible to 3-SAT.
Means if 3-SAT is solvable in polynomial time then so it the problem.
Now we know 3-SAT is solvable in non-determistic poloynomial time, hence we can use the answer, and solve the unknow in NDP time.
2. Every problem is NPC is reducible to each other.
3. A problem in NP-Hard is not an decision problem, it should be a optimization problem.
Thus the answer should be C.
u can think like that… if a problm is npc thn surly it will be np. and np ,p both can reduce from right to left.i.e. if right side is p or np thn the left one will also p or np resp. so the above problm will also belongs to np and nph which says it is npc
some facts abt nXn nultiplier (for question no.11):
In array multiplier, consider two binary numbers A and B, of n bits each. There are n^2 summands that are produced in parallel by a set of nXn AND gates. total delay due to AND gate is n.
total delay due to Adder would be (2N+1)
So in array multiplier worst case delay would be (2n+1).
Array multiplier – Refer Computer organization hamacher pg 378. for nxn array total delay is 6*(n-1) – 1. Total delay is in O(n)
The point 3 is not correct.
3. Is not correct.
An NP-Hard problem can be a decision, search or optimization problem.
The criteria is it may not be NP, and a NPC problem (like 3-SAT ) is polynomial time reducible to it. So that it can be used to solve any NPC in polynomial time.
But in our question since the unknow problem is polynomial time reducible to 3-SAT, the problem is in NP.
Hence it must be NPC.
I had a small doubt regarding Q.No 14
as per my knowledge the ans should be D(none of the above)coz,
if you take 010 as input string option A can never generate this string, so option A is eliminated
if you take 01 as input string option B can never generate this string
so option B is also eliminated
option C is eliminated for the obvious reason coz it contains 10 as sub string while the given string can accept epsilon,
Hence the only option seems correct here is None of the above.
please correct me if I am wrong…..!!