There are 3 foods with the following Protein/Fat/Carbs (grams/ounce): 2,3,4; 3,3,1; 3,3,2. We want a meal using the 3 foods that results in 24g of protein, 27g of fat, 20g of carbs. How much of each food is needed?

1 Answer

(A,B,C)=(3,4,2) ounces of food

Explanation:

I'm going to use the Food letters - A, B, C - to be the number of ounces of that food that should be used.

I'm going to put the chart here (numbers in grams/ounce):

Food0Protein0Fat0Carbs

00A0000020000030004

00B0000030000030001

00C0000030000030002

And we need 24g of Protein, 27g of Fat, 20g Carbs, so:

(P)rotein: 2A+3B+3C=24
(F)at: 0003A+3B+3C=27
(C)arbs: 04A+1B+2C=20

I'm first going to work on expressing the B values in terms of A and C. I'll do that by subtracting 3×C and first P and then F:

3C: 000012A+3B+6C=60
P: 0000002A+3B+3C=24

3CP: 10A+000003C=36

3C: 000012A+3B+6C=60
F: 0000003A+3B+3C=27

3CF: 9A+0000003C=33

And I can now subtract 3CF from 3CP to get rid of C and solve for A:

3CP: 10A+000003C=36
3CF: 9A+0000003C=33

(3CP)(3CF): A=3

And now we can substitute this back in to one of our equations (I'll do both to double check our answer this far - I'll use colours to help highlight what we're doing):

3CP: 10A+3C=36

3CP: 10(3)+3C=36

3CP: 30+3C=36

3CP: 3C=6

3CP: C=2

3CF: 9A+3C=33

3CF: 9(3)+3C=33

3CF: 27+3C=33

3CF: 3C=6

3CF: C=2

Ok - C checks out as equaling 2. Now let's substitute into one of the originals (and I'll do all 3 to show it works in all the original equations):

(P)rotein: 2A+3B+3C=24

(P)rotein: 2(3)+3B+3(2)=24

(P)rotein: 6+3B+6=24

(P)rotein: 3B=12

(P)rotein: B=4

(F)at: 3A+3B+3C=27

(F)at: 3(3)+3B+3(2)=27

(F)at: 9+3B+6=27

(F)at: 3B=12

(F)at: B=4

(C)arbs: 4A+1B+2C=20

(C)arbs: 4(3)+1B+2(2)=20

(C)arbs: 12+1B+4=20

(C)arbs: B=4

Everything checks out!

(A,B,C)=(3,4,2) ounces of food