(Solved Homework): Let KNAP = {a1#a2# . . . #an#C | ai and C are integers coded in binary, and there is a set I ⊆ {1, . . . , n} such that P

Let KNAP = {a1#a2# . . . #an#C | ai and C are integers coded in binary, and there is a set I ⊆ {1, . . . , n} such that P i∈I ai = C}. Let UKNAP be the same, except that the integers are coded in unary, i.e., a is represented by 1a, the string comprised of a 1’s. UKNAP is in P but KNAP is NP-complete. Find and explain the flaw in each of the “proofs” below. Make your proofs/counterexamples crisp and explicit.

(a) For any string u in {1, #}* we can easily produce a string v in {0, 1, #}* such that u ∈ UKNAP ⇔ v ∈ KNAP. (E.g., if u = 11#1#11111 then v = 10#1#101.) Furthermore, the transformation can be done in time bounded by a polynomial in the length of u. Thus, P=NP.

(b)  For any string v in {0, 1, #}* we can easily produce a string u in {1, #}* such that v ∈ KNAP ⇔ u ∈ UKNAP. Furthermore, the transformation can be done in time bounded by a polynomial in the length of u. Thus, P=NP

(c) 1-of-3-SAT is another known NP-complete variant of the satisfiability problem: it is the set of Boolean formulas in conjunctive normal form with exactly 3 literals per clause such that the formula is satisfied by a truth assignment making exactly one literal in each clause true. Let f be a formula in conjunctive normal form with exactly 3 literals per clause (3CNF). Suppose it has clauses c1, . . . , cq and variables x1, . . . , xm, m ≤ 3q. Suppose “xi” occurs in clauses numbered i1, . . . , ij
and “BAR xi” occurs in clauses numbered i’1…i’j. Let ai = SUM from k=1 to j of ik, and BAR ai = SUM from k = 1 to j’ of i’k . Let s = SUM from i = 1 to q of i.
Generate the string: u = 1a1#1BAR a1# . . . #1am#1BAR am#1s
Now if f is satisfiable by an assignment that makes exactly one literal per clause true, i.e. if f is in 1-of-3-SAT, then u is in UKNAP: Pick ai or BAR ai depending on whether xi is true or false respectively in the 1-of-3 satisfying assignment. Every clause is satisfied by exactly one literal, so the sum of the chosen a, BAR a’s is
exactly s. Thus u ∈ UKNAP. Further the reduction can be done in time polynomial in the length of f; e.g., note that the numbers ai, BAR ai, and s are all of magnitude at most q, since each is the sum of at most q distinct numbers between 1 and q, so the length of u is O(q^3)) = O(|f|^3)).
Thus P=NP.

Expert Answer

 a) From the definition of NP-complete, KNAP is in NP as well as in NP-HARD.

Np-complete = set Np – set P.

KNAP is in P.   UKNAP is in NP.

b) Whether a problem/string is reduced/transformed on polynomial time, from P to NP, here    v to u ,

doest not matter with the definition of NP-hard. Here u is in NP and NP-hard.

Even-though v in P, is polynomial time reduced to u, u is in NP and NP-complete.

c) 3-SAT is in NP-complete. The length and sum does not matter with NP.

Order NOW for a 10% Discount
Pages (550 words)
Approximate price: -

Why Us?

Top Quality and Well-Researched Papers

All ourbpapers are written from scratch. In fact, Clients who ask for paraphrasing services are highly discouraged. We have writers ready to craft any paper from scratch and deliver quality ahead of time.

Professional and Experienced Academic Writers

Our writers keeps you posted on your papers progress - providing you with paper outline/draft. You are also at liberty to communicate directly with your writer.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time, in many cases quite ahead of time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.


Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.


Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.


Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.


Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

× Contact Live Agents