NP complete problem:
Big project problem. To finish the big project, you need to finish X requirements. However, you only have time to write B < X more classes. Luckily, a single class can satisfy many requirements. Input are list of requirements and list of classes that satisfy each requirement.
a/ Show that the problem is in NP
b/ Show that the problem is in NP-complete by reduction
A.
NP is set of decision problems that can be solved by a
Non-deterministic Turing Machine in
Polynomial time. P is subset of NP (any problem
that can be solved by deterministic machine in polynomial time can
also be solved by non-deterministic machine in polynomial
time).
Informally, NP is set of decision problems which can be solved by a
polynomial time via a “Lucky Algorithm”, a magical algorithm that
always makes a right guess among the given set of choices .
In the given question the big project problem is solve in certain fix time so from this it is proved that problem is in NP.
B.
To prove that problem is NP compelete first we have to prove it is NP problem which we already proved . As in the question it is stated that single class can satisfy many requirements so for each requirement we dont need separate class which makes our problem NP Compelete
NP complete problem: Big project problem. To finish the big project, you need to finish X...
Problem 2. In the Subset-Sum problem the input consists of a set of positive integers X = {x1, . . . , xn}, and some integer k. The answer is YES if and only if there exists some subset of X that sums to k. In the Bipartition problem the input consists of a set of positive integers Y = {y1, . . . , yn}. The answer is YES if and only if there exists some subset of X...
In this assignment, you will prove that the Zero Sum problem is NP-Complete. The Zero Sum problem accepts an array of n integers and returns whether it is possible to negate some of those integers to make the array sum equal 0. For example, the array data = [1, 3, 5, 7, 9, 11] has a zero sum if you negate the 7 and 11, while the array data = [1, 2, 5, 9, 13, 22] cannot be reduced to...
In this problem, you will complete several classes involving boxes, locks, keys and secrets. Follow the specifications in the starter files for the classes. You can run the javadoc program to generate the API (see Tutorial 2) for the classes. A box has a secret inside it (and maybe a key!) and can be locked. In order to open a box, you need the right key to unlock the lock. Secrets.java will be a program that takes an array of...
Hello, I need help with the following Discrete problem. Please show
your work, thank you!
11. Let R be the relation defined on the set of eight-bit strings by Si R 52 provided that sy and sz have the same number of zeros. (a) Show that is an equivalence relation. (b) How many equivalence classes are there? (c) List one member of each equivalence class.
I need help with this java project and please follow the instruction below. thank Class Project - Parking Ticket simulator Design a set of classes that work together to simulate a police officer issuing a parking ticket. Design the following classes: • The ParkedCar Class: This class should simulate a parked car. The class’s responsibilities are as follows: – To know the car’s make, model, color, license number, and the number of minutes that the car has been parked. • ...
Need Help Filling in Areas: /** Based on a Big Java problem You have to write a static method that removes every other element from a linked list. Expected output: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday] [Monday, Wednesday, Friday] [Wednesday] [] */ public class DownSizeTester { public static void main(String[] args) { LinkedList list = new LinkedList() ; list.add("Sunday") ; list.add("Monday") ; list.add("Tuesday") ; list.add("Wednesday") ; list.add("Thursday") ; list.add("Friday") ; list.add("Saturday") ; System.out.println(list) ; downsize(list) ; System.out.println(list) ; downsize(list)...
I need to make a project named CStore. It is a Java starter project that only uses the console. I don't know how to even start it.. Please help me asap First I need to define 3 classes names Goods, Manage, UI. Then simply implement the Goods class, then make a function that inserts Goods object into a Goods list in the Manage class. In the UI class, the user inputs Goods that will be registered and that Goods will...
can
you guys please help me with these questions thank you
9.Given a Double Linked-List that contains the values in order: 1,2,3,4,5; and the following class declarations: class List private: Node* head; public: PrintBackwards (); class Node{ friend class List; private: int value; Node* next; Node* prev; Write the algorithm PrintBackwards that prints the whole list backwards. So your functionshould output: “ 5,4,3,2,1" Extra Credit if you instead implement the algorithm for a single linked-list (i.e. only using the Node*...
Consider the more difficult classification problem shown in the
chart below
Question 5: Consider the more difficult classification problem shown in the chart below: Class -1 0.9 O Class 1 0.8 0.6 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.91 i1 Figure 6: A set of two-dimensional input samples from two classes (a) As you certainly noticed, a single perceptron cannot do this classification task perfectly. Determine the minimum error that a single perceptron...
Need assistance with this problem. This is for a java class and using eclipse. For this assignment we’ll be doing problems 21.3 and 21.4 from your textbook. Problem 21.3 asks you to write a generic method that removes duplicate items from an ArrayList. This should be fairly straightforward. Problem 21.4 asks you to implement insertion sort within a generic method. Insertion sort is described in detail on pages 250-252 of your textbook. You can write your two methods in a...