Finding a combination of food with certain vitamin values

117 Views Asked by At

I'm looking for some advice on a nutritional problem I'm working on, of all things. Seeing if there's a particular branch of mathematics that could be useful. I'm trying to find what quantity of foods I would need to hit a set of target nutritional needs.

For example: if I have three different food types and their vitamin values for $A,B,C$ are $(10,20,15),\ (5,10,30),\ (20,40,30)$ per gram and the target values for $A, B, C$ are $(1000, 900, 1200)$, what quantity (grams) of each food would I need to buy to roughly hit these values?

What I'm currently doing is summing all the initial starting values of the food, then summing the target values. Next step is to dived the target sum values by the initial sum values to find a sort of average number of grams I could multiply all the food values by to hit the target.

I've had a little success with this, and I've tried and weighting the values of each food depending on their contribution to the total. But I know there's got to be a more accurate way to go, any ideas?