System of equations? Optimization? Help me solve this problem

lwoc

New member
Joined
Jan 2, 2018
Messages
3
Hello everyone,

I have a math problem where I do not even know where to start. I have tried to solve it using minimization with constraints and also using a system of equations but have not had any luck. Any help would be appreciated.

The 3 foods below make up a meal. A final meal should be created that consists of 350 calories where 50% of calories come from carbohydrates, 25% of calories come from protein and 25% come of calories come from fat (if a solution is not possible with exactly 50% carbs, 25% protein and 25% fat, find a solution that is closest to 50% carbs). The nutritional information below is based off of one serving of food but less or more than one serving can be used to create the final meal.

1 serving of food 1 consists of:
250 calories total
150 calories come from carbohydrates
75 calories come from protein
25 calories come from fat

1 serving of food 2 consists of:
350 calories total
150 calories come from carbohydrates
100 calories come from protein
100 calories come from fat

1 serving of food 3 consists of:
420 calories total
140 calories come from carbohydrates
140 calories come from proteins
140 calories come from fat

So how many servings of each food would create a meal that is made up of 350 calories where 50% of the calories come from carbohydrates, 25% come from protein and 25% come from fat. And just a reminder that each food must be used in a solution. Any help would be appreciated.

Thanks!
 
Why would "minimization with constraints" not work? Please demonstrate your equations/inequalities and why you believe the effort ended in failure.
 
Why would "minimization with constraints" not work? Please demonstrate your equations/inequalities and why you believe the effort ended in failure.

I am confused on how to get that started. What would equation would I be trying to minimize?
 
I am confused on how to get that started. What would equation would I be trying to minimize?
Um... Didn't you start this thread by saying the following?

I have tried to solve it using minimization with constraints and also using a system of equations but have not had any luck.
Either you "have no idea how to get started", so you need links to online lessons (so you can learn this topic); or else you've learned about systems of equations, systems of linear inequalities, and optimization equations. If the former, please specify, so we can find lessons from which you can study. If the latter, then please reply with a clear listing of what you did when you "tried to solve it using" optimization techniques, and why you think your results were incorrect.

Thank you! ;)
 
Um... Didn't you start this thread by saying the following?


Either you "have no idea how to get started", so you need links to online lessons (so you can learn this topic); or else you've learned about systems of equations, systems of linear inequalities, and optimization equations. If the former, please specify, so we can find lessons from which you can study. If the latter, then please reply with a clear listing of what you did when you "tried to solve it using" optimization techniques, and why you think your results were incorrect.

Thank you! ;)

So I started with this:
Let a=servings of food 1
let b = servings of food 2
let c= servings of food 3

We want to minimize: 350-(250a+350b+420c) <- I did this since we are trying to get as close to the goal calories in the final meal as possible

The minimization is subject to:
Carbs must be 50% -> .6a+.429b+.333c=.50 (.6,.429 and .333 are the percentages that carbs make up in food 1, 2, 3)
Protons must be 25% -> .3a+.285b+.333c=.25
Fats must be 25% -> .1a + .285b +.333c = .25
Calories must be less than or equal to 350 -> 250a+350b+420c<=350
Each food must be in the final meal-> a,b,c > 0

When I solve this I get no solutions. I believe this is a case of being too specific with the requirements. If I solve it and allow for food servings to be negative I get the solution of a=.336, b=1.035, c=-.438 which when I plug back in makes sense.

Does this look like I am on the right path?
 
So I started with this:
Let a=servings of food 1
let b = servings of food 2
let c= servings of food 3

We want to minimize: 350-(250a+350b+420c) <- I did this since we are trying to get as close to the goal calories in the final meal as possible

The minimization is subject to:
Carbs must be 50% -> .6a+.429b+.333c=.50 (.6,.429 and .333 are the percentages that carbs make up in food 1, 2, 3)
This says "(so many calories of this, that, and the other food) equal (fifty percent)". This can't work. The units must be the same. If you're wanting to stick with "calories", then maybe do something like this:

. . . . .(3/5)a + (3/7)b + (1/3)c = (1/2)(a + b + c)

In this way, you have the same units on either side; namely, "calories". (Also, it is generally a good idea to use exact values, rather than rounded decimal approximations, until the very end.)

Protons must be 25% -> .3a+.285b+.333c=.25
Fats must be 25% -> .1a + .285b +.333c = .25
Same objections as above, for carbs.

Calories must be less than or equal to 350 -> 250a+350b+420c<=350
This would seem to be a repetition of what you've already chosen as your optimization equation; namely, you're wanting to minimize K = 350 - 250a - 350b - 420c (where "K" stands for "calories").

But since the real requirement is that you get as close as possible on the carbs, maybe that should be the basis of your optimization equation? And state that 250a + 350b + 420c = 350 is a constraint?
 
Top