Re: A Math Problem (NP Complete?)
First , it helps to reduce the problem by dividing the number of calories by the $ amount with a common base .
Main Dishes
Hamburger 133.33:1
Sandwich 200 :1
Steak 100:1
Side
Fries 75:1
Corn 100:1
A bowl of melted cheese 125:1
Dessert
Pie 133.33:1
Cake 175:1
Boring Cookie 200:1
So if our goal is to select at least one from each catogory (not sure if that's what you mean), then we would prefer a sandwhich, melted cheese ,and a cookie . Now check to see that one of each selection is under $10 which it is since the total 1+4+1 = 6 . Since we are indifferent to a sandwhich or a cookie we may choose any combination such that s+c=6 and s and c are non-zero . So 5 cookies , one sandwhich and a bowl of melted cheese gives you 1700cal:$10 = 170:$1
|