Consider the USB problem: \"Given n USB sticks each of size x and m computer fil
ID: 656671 • Letter: C
Question
Consider the USB problem: "Given n USB sticks each of size x and m computer files of size y1, y2, ??, ...., ym, is it possible to copy all the files onto the given USB sticks?" This is a decision problem, where the answer is either yes or no. How hard is this problem? there are 2 steps to showing that a problem is NP-Complete. First show the problem is in NP by describing a polynomial time verifier. Then use proof by reduction with an existing NP-Complete problem. I recommend using the approach shown in class, where you use one solution to implement the other in modern pseudo-code.Explanation / Answer
We have n USB sticks of size x.
So total size of USB sticks= nx
Again we have m computer files of size y1,y2,y3,......,ym
So total size of computer files = y1+y2+y3+...+ym
Algorithm
IF (y1+y2+y3+...+ym)<=nx THEN
ALL FILES CAN BE COPIED
ELSE
ALL FILES CANNOT BE COPIED
Polynomial time verifier
Let each unit of time be t
In the algorithm we have basically 2 steps i.e the IF condition and the ELSE part.
So total time will be of order 2t.
To prove that a problem X is NP-Complete, we need to show that it's both in NP and that it's NP-Hard.
Step 1: Show that X is in NP.
We want to argue that there's a polytime admirer for X. In alternative words, for any affirmative instance of
X, there exists a certificate that the admirer can settle for, and for any no instance of X, there's no certificate that the admirer can settle for. each the scale of the certificate and also the period of
the admirer should be polynomial.
Step 2: decide a far-famed NP-Complete drawback.
State what drawback Y we tend to area unit reducing to X. we'd like to indicate that Y?pX.
Step 3: Construct associate degree rule to unravel Y given associate degree rule to unravel X.
We need to indicate that any instance of Y will be solved employing a polynomial range of operations, and a polynomial range of calls to a recording equipment which will solve X.
Step 4: Prove the correctness of our rule.
This has a pair of parts: we would like to indicate that given a affirmative instance of Y our rule returns
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.