Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A-hiking we will go (#1) My son is going backpacking. He wants calories, and isn't particularly worried about nutrition (he's a teenager). With no time

A-hiking we will go (#1)

My son is going backpacking. He wants calories, and isn't particularly worried about nutrition (he's a teenager). With no time to go shopping, he looks in the pantry and finds the following dry packaged foods:

"Nr units" is the number of units in the pantry, Weight is the weight per unit, and Calories is the number of calories per unit.

He can afford to take no more than 30 oz of food for an overnight trip. So that he has a variety of foods, we require that he take at least one package of each item listed. How many of each item should he take?

Note: He can only take full units of each item, and can't divide things up to take fractions of a unit.

(Each of the next 5 questions asks how many of a particular food to take, so work it out before you answer any of them, since how many of one thing he takes influences how many of each of the others he can take.)

FOOD NR. UNITS WEIGHT CALORIES/UNIT
Beef Jerky 2 2 80
Energy Bar 6 3 250
Noodles 4 5 535
Potato Flakes 10 1 80
Rice & Beans 3 8 1000

A. How many packets of beef jerky should he take?

B.How many energy bars should he take?

C. How many packages of noodles should he take?

D. How many packets of potato flakes should he take?

E.How many packets of rice and beans should he take?

greedy algorithm question

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions