Ask your own question, for FREE!
Mathematics 16 Online
iosangel:

Solve a Linear Programming Problem in Context

iosangel:

Theresa is planning her daughter’s birthday party. She plans to offer each of the guests a goodie bag with a variety of treats that may include a candy bar from a local chocolatier. She will choose from two varieties of candy bars: berry and nut. She has decided she will purchase at least 5 nut bars and that the number of nut bars she purchases will not exceed the number of berry bars purchased by more than 10. Thirty guests were invited and Theresa will prepare a goodie bag for each guest. The nut bars cost $4 each and the berry bars cost $2. She would like to minimize the money spent on this treat. How many of each type of candy bar should she purchase to minimize her cost?

iosangel:

first i would identify the variables # of berry bars can be B # of nut bars can be N

iosangel:

Then writing the constraints is where i mess up

SmokeyBrown:

The problem specifies that the number of nut bars will be more than 5, and also that the number of nut bars will not be more than 10 + the number of berry bars. I think these would be examples of constraints. If B is the number of berry bars and N is the number of nut bars, you could say that \[N \ge5\] and also that \[N \le B+10\] Although the problem states that 30 guests are invited and that each guest gets 1 goodie bag, I do not see any information about how many bars are included in each bag, which I think would be important to answering the question

SmokeyBrown:

... Unless the part that says each bag "may include *a* candy bar from a local chocolatier" implies that each bag will have exactly 1 candy bar (either Nut or Berry)... In which case, we can also say that \[B + N = 30\] And we also have the information about the cost of each bar. Nut bars cost $4 and Berry bars cost $2... Based on the constraints so far, it seems like the cheapest option would be to get the minimum number of Nut bars and the rest Berry bars, i.e. 5 Nut bars and 25 Berry bars, since Berry bars are the cheaper option. Perhaps I've misunderstood something about the problem?

iosangel:

i think one candy bar from each goodie bag

SmokeyBrown:

@iosangel wrote:
i think one candy bar from each goodie bag
Thanks for clarifying. In that case, based on the information given, and assuming the only priority is to spend the least amount of money, the solution should be to buy as few nut bars as possible (5) and buy as many berry bars as possible (25) Reason being, for every nut bar Theresa buys instead of a berry bar, she is spending 4 dollars instead of 2, which is 2 more dollars. Conversely, every berry bar she buys can be thought of like saving 2 dollars. Oh, and in case you still need to write code as part of the assignment even after seeing the solution, I'm happy to help with that as well :)

iosangel:

code?

SmokeyBrown:

Perhaps I misunderstood. I saw "linear programming" and I assumed there would be coding involved. If not, perhaps that is easier for us!

iosangel:

lol, i dont know maybe there should be one this is my first time learning about solving a Linear Programming Problem

iosangel:

what is tha?

SmokeyBrown:

@iosangel wrote:
lol, i dont know maybe there should be one this is my first time learning about solving a Linear Programming Problem
I was actually mistaken. It seems that "Linear Programming" does not imply computer programming, it just refers to any problem that can be modeled with linear relationships. So, this problem, which includes linear relationships in the numbers of bars bought as well as the costs of the bar, would be an example of a "Linear Programming" problem. Apologies for the confusion!

iosangel:

oh ok then id graph these constraints and |dw:1630000137897:dw| sorry my writing is really bad Then i get the vertices of the region (0,5) 0,10) (10,20) (25,5)

iosangel:

correct?

iosangel:

the constraints N≥5 and b≥0 n≤b+10 and b+n≤30

SmokeyBrown:

The "constraints" I mentioned earlier n≥5 and b≥0 n≤b+10 would be more like limits on which region of the graph we should focus, not lines on the graph themselves. b+n = 30, true... but since the question is about minimizing cost, I think it might be more illustrative to graph the number of bars purchased compared to the total cost that results in. That kind of graph (bars versus cost) would clearly allow someone to see the solution. You could make a 3d graph, with nut bars on one axis, berry bars on another axis, and total cost on the third axis... but this would be overly complex, and I don't recommend it. Instead, you could graph, for example, "number of berry bars" on one axis and "total cost" on the other axis. This would require some calculations on your part, and the graph you get at the end would clearly show how many bars to buy in order to minimize cost. Even though the graph would only show "berry bars" we know that b + n = 30, so it would also imply the number of nut bars.

Zayne:

it equals 30

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!