subject

Suppose you are packing for a backpacking trip and trying to decide which snacks to bring. your home pantry contains m snack items, each of which has a certain weight wi and a calorie value vi. your backpack can only hold a maximum weight of w , and for your journey you need a minimum of v calories. therefore, you need to answer the question: is there is some set s of items from your pantry such that the sum of the weights of the items in s is less than or equal to w , while the sum of the calorie values of the items in s is greater than or equal to v. required:
a. describe a (deterministic) algorithm for answering the question. is it a polynomial-time algorithm? explain your answer.
b. describe a non-deterministic algorithm for deciding the question. is it a nondeterministic polynomial-time algorithm?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Consider how gaming consoles initially relied on joysticks and joypads and then made the switch to modern gaming controls, which include analog sticks, buttons and switches, touch controls, accelerometers, motion controls, etc. name at least two kinds of gaming experiences that are possible with these new control devices but were not possible on original joysticks. explain how new technologies made this newer game style possible.
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Write the command that can be used to answer the following questions. (hint: try each out on the system to check your results.) a. find all files on the system that have the word test" as part of their filename. b. search the path variable for the pathname to the awk command. c. find all files in the /usr directory and subdirectories that are larger than 50 kilobytes in size. d. find all files in the /usr directory and subdirectories that are less than 70 kilobytes in size. e. find all files in the / directory and subdirectories that are symbolic links. f. find all files in the /var directory and subdirectories that were accessed less than 60 minutes ago. g. find all files in the /var directory and subdirectories that were accessed less than six days ago. h. find all files in the /home directory and subdirectories that are empty. i. find all files in the /etc directory and subdirectories that are owned by the group bin."
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
You know the right answer?
Suppose you are packing for a backpacking trip and trying to decide which snacks to bring. your home...
Questions
question
Chemistry, 06.07.2021 05:30
question
Mathematics, 06.07.2021 05:30
question
Mathematics, 06.07.2021 05:30
Questions on the website: 13722362