# Linear Programming Word Problem – Example 1

alright so one more example here of a
word problem using linear programming to find a in this case of minimum suppose
you’ve got a rancher he’s got two types of food that he’s going to feed his
cattle brand x brand Y suppose you know for each serving of food has to have 60
grams of protein and 30 grams of fat brand a has 15 grams of protein and 10
grams of fat it costs eighty cents per unit Brandi
has 20 grams of protein and five grams of fat and costs fifty cents per unit we want to know how much of each type of
food this rancher would have to use in order to minimize these costs ok so let’s see a couple things here we’re trying to minimize his costs and let’s again let’s define our
variables your first so Brand X how about we let X represent the we’ll say the
number of units of Brand X and the same thing will
simply just let little y represent the number of units of brand Y so here we
are trying to minimize his costs and again we said where to go let’s see so brand a we said cost eighty
cents per unit so its cost would be 0.8 for each unit of Brand X plus we said
brand Y cost fifty cents per unit so plus 0.5 y this is going to be we’re going to
try to minimize our constraints in this case well X would have to be greater than or
equal to 0 and y would have to be greater than or equal to 0 well let’s see we’ve got some
restrictions ok we know there has to be so many grams
of protein and there has to be so many grams of fat let’s see so if we look at the stuff
that relates protein so you need 60 grams of protein total brand a has 15
grams of protein it says brained he has 20 grams of
protein so let’s see here so to me it says we’re going to get 15
grams of protein per each unit of Brand X and we’re going to get an additional
20 grams of protein per each for each unit from brand Y and again we want that
to be at least 60 ok so this is kind of the inequality
that relates the the demands from getting enough protein ok now we also have to have 30 grams of
fat and we said you get let’s see brand A has 10 grams of fat and it looks like
Brand B has five grams of fat so we want to get at least 30 grams of
fat in our diet it says again Brand A has let’s see 10
grams per 10 grams of fat per each unit Brand B has five grams of fat per each unit and I think I think that’s
everything we need now I think we’ve got all of our all of our constraints and
now we can go about graphing the region and figure out our corner points and
then use that to define our minimum value ok so I’m going to graph 15x plus 20y
equals 60 and again to do this i think i’m just going to find x and
y-intercepts to be I think that’s the easiest way in this case so if we substitute in x equals 0 we’ll just get 20y equals 60 if we
divide both sides by 20 we’ll get a y-value of three likewise if we plug in y equals 0 we’ll
have 15x equals 60 if we divide both sides by 15 will get x equals 4 alright so we connect those two points
there looks like we would get that line again we’re trying to satisfy this original
inequality 15x plus 20y greater than or equal to 60 i would take the test . 00 and if we plug that in we’ll get 15 times 0 plus 20 times 0 is that
greater than or equal to 60 well we’re going to get 0 on the left 0
is definitely not greater than or equal to 60 so that tells me we’d have to shade
above that line to get the region that satisfies that inequality again since X
is greater than or equal to 0 and also y is greater than or equal to 0 I know that we’re going to be trapped up
here in the you know the top right quadrant let’s graph are other line as well so 10 x + 5 y equals 30 so 10 x + 5 y
equals 30 again I think I would do the same thing
just find x and y-intercepts if we plug in x equals 0 we’ll get 5y equals 30 or y
equals 6 if we plug in y equals 0 will get 10 x
equals 30 if we divide both sides by 10 will get x equals 3 alright so let’s see 3 zero and then we have four five six so if we connect those two those two points we’re going to get our other line and
again the same thing we can take our test point we’re trying to satisfy 10 x + 5
y greater than or equal to 30 same thing we could take maybe this test point of the
origin if we plug in 0 and 0. Zero for X and 0 for y well then I’m thinking is 0 greater than
or equal to 30 again definitely not so that means we would have to shade above
this above and to the right of this line to get the region that satisfies that
inequality so it looks like in total to me the the
overlap of all of our region’s we would get actually a region that extends off
forever and ever and ever it’s infinite in extent and that makes sense you know because
you could always use you know a million units of Brand X and a million units of
brand why that would certainly give you the amount of protein in the matter of
fact that you need in your diet probably a little more than what you
need but now all i’m going to need are these corner points so we know that
whatever corner points is 4 comma 0 another one is zero comma six the only one I
missing here is this point of intersection between these two lines so
we’re gonna have to figure out the point of intersection so let’s see we’ve got 15 x plus 20 y
equals 60 and i’m going to use 10 x + 5 y equals 30 I think what i’m going to do is well
let’s see what would be the easiest thing to do here i think i’m just going to use
elimination by addition and i’m going to cancel out the Y’s so what I’m going to do is I’m going to
multiply both sides of my second equation by negative 4 i’m gonna leave
the first equation alone 15x plus 20 y equals 60 we’ll get negative 40 x minus 20 y
equals negative 120 if we do our elimination by addition let’s see it looks like we get so if we
add 15 x and negative 40 x that’s going to give us negative 25 x that’s going to be equal to negative 60
if we divide both sides by negative 25 by negative 25 let’s see that’s going to give us
positive let’s see 12 let’s see so we can divide the top by
five we can divide the bottom by five so that’s going to give us what is that – two and two-fifths or 2.4 and
in this case you know i’m going to assume he can use you know he doesn’t
have to use a whole number of units of food you know maybe he can you know chop it up or grind it up or whatever so
you know we’re not going to make the restriction that he has to use a whole
number of units of food so 2.4 to me that’s going to be certainly something
reasonable let’s see and we now have to figure out
so we know the x coordinate here is 2.4 now we just need to go back and
figure out the y value that goes with it again we can use any of our lines i’m going to use this original 10x plus
5y equals 30 so if we use that to solve for y will get 10 x 2.4 plus 5y equals
30 well 10 x 2.4 is going to be 24 and if we subtract 24 from both sides
will get 5y equals 6 and then we can divide will get 6 over 5. 6 over 5 would
be 1 and 1/5th or 1.2 so it looks like this point of
intersection is 2.4 , 1.2 so now we’re in business we’ve got all
our corner points here now i just need to go back to my cost
function so our cost function was point 8x plus point 5y again we’re trying to minimize
this and the points are going to use our 06 we’ve got this point to point 4 comma
1.2 and then we’ve got this point 4 comma 0 alright so that’s just some plugging and
chugging so if we use 06 our cost is going to be well point eight times 0 which
is 0 plus point 5 x y and why has the value of six so that’s going to give us the
value 3 i’m going to plug in 4 comma zero next because well that’s easier to
do if we plug in 4 we’ll get point 8 times 4 Plus point 5 x 0 point 8 times 4 is going to give
us a cost of 3.2 and last but not least if we use 2.4 comma 1.2 We’ll have C equals point eight
times the x value of 2.4 plus point five times the Y value of 1.2 let’s see point eight times 2.4 that’s
1.92 one half of 1.2 would be .6 if we add those together
we’re going to get just that let me make sure one more time so 1.92
plus point six so let’s see that’s going to give us 2.52 let’s just use my brain here
and I did something wrong and it didn’t look right so that looks like we’re going to get
the value 2.52 and in this case again we’re trying to find a minimum cost i
think we’ve got it now we’ve got the cost of three cost of 3.2 the cost of
2.52 well certainly this is going to be our minimum cost so it looks like to me he should use two point four units of
Brand X and 1.2 units of brand Y to get our a minimum cost but at the
same time it would meet all the nutritional requirements for his cattle
under using these inequalities

## 99 thoughts on “Linear Programming Word Problem – Example 1”

1. Very informative, I'm just still trying to figure out the -4. If you're trying to eliminate y, wouldn't you get rid of the 20? I'm pretty sure I'm wrong, but I'm just confused on that part.

2. My math teacher makes us watch these…
Then take notes on it…
Then take a small 6 question quiz on it…
Every week…

3. please slove this for me….
maximize Z=3x+5y
s.t      x+y<=1500
y<=600
x,y>=0

4. There is something wrong with the Question….It should be Brand A, and Brand B not Brand X and Brand Y, like you put it in the first sentence of the question… Otherwise good job!!

5. Can someone ANSWER this? Instead of plugging in the o's into both equation to find the coordinates can you just turn the equations into y= mx+b? Then graph it?

6. I almost thought i can't handle maths . But you video's are helping me in my exams thanks bud ! I just love your handwriting & obviously your explaination rocks .
Just keep helping peeps . 🙂

7. an ice cream shop makes \$1.25 on each small cone small and \$2.25 on each large cone. on a typical Saturday, it sells at least 60 small cones and at least 120 large cones. then total sales have never exceeded 240 cones. how many of each size cone must be sold to maximize profit?

8. wow.. this is suprisingly easy to understand. My professor teaches really fast and asking him questions is kinda intimidating. Thank you very much for the tutorials!

9. Thanks alot. You're video was very helpful. Explained it in a nut shell. Keep up the great work.

10. When will you use greater than or equal to/less than or equal to when it comes to creating constraints? It confuses me when it comes to that point. Help. 🙂

11. Thank you very much

12. if you follow this example step by step, you will get it. just forget about graphing on the calculator and focus on doing this on paper. Take your time and let each step sink in.
Believe me, once you get the concept you'll see how easy it is
just as ~ Classic Panda says on his comment

13. I think it would actually be 0,6 becuz even though he can chop up the food and make it exactly 2.4 and 1.2 he still has to pay for the unused parts so technically it would be 0,6. If I'm wrong please tell me.

14. this is amazing, thinking about moving to the states because of the good teacher there.. compared to Norway omg, they are all so boring when teaching!!!!!!!!!!!!

15. the question says "required," so shouldnt the constraints be "equal to" rather than "greater than or equal to?" I may have misinterpreted it.

16. Dear Patrick,
First of all I want to thank you for making the video. I am fairly new to Linear Programming and I am still having problems with setting the restrictions. I have a problem that I have not been able to identify. Would it be too much of a problem if you could please help me set it up?
A candy company has 138 kg of chocolated-covered nuts and 90 kg of chocolate covered raisins to be sold as two different mixes. One mix will contain half nuts and half raisins and will sell for \$7 per kg. The other mix will contain (3/4) nuts and (1/4) raisins and will sell for \$9.50 per kg. How many kg of each mix should the company prepare for the maximum revenue?

17. Can you please do video on integer programming and dynamic programming?

18. Why do you disregard the (3,0) and (0,3) corner points? Are they technically not corner points because they're not efficiently using all the resources like the other corner points? I'm confused because they're technically vertices of our constraint functions, which makes me think they're corner points

19. Thank you, helped me with my homework and I couldn't undestand my teacher because she talks too fast so happy that I can replay this tutorial. Cheers.

20. 2.4 and 1.2 need to be round up into 3 and 2. because you cant have 2.4 unit, must be an natural number

21. Im taking a stupid summer course on Algebra 1 and we're learning this. Our questions are way more complicated. The one i'm stuck on is about a farmer trying to plant crops and he can only invest 15,000\$ into it and he only has 100 acres. I dunno why he doesnt invest 15,000 into lettuce, he'll get the most money. I've been stuck on this for HOURS.

22. If you are using the points (0,6) , (2.4,1.2),(4,0) WHY DIDNT YOU INCLUDE (0,3) and (3,0)- aren't there points too?? Bcos if you did point(3,0) would give you the minimum cost which is USD 2.40… Check it out please.

23. how do you work out the gradient after you have worked out their future income. From what I've seen the objective function and the constraint line would have the same gradient, but I'm not sure how to work out the gradient for it. Thanks

24. How was (0,6) a corner point if its outside of the F.S. ???

25. you have the same writing style as me, its creeping me out

26. God bless you!!!! And all your future generatuibs!! My business math lecturer is soo….unclear he just writes and we don't even know what and why were doing this but thank you🙏🙏😁

27. A furniture manufacturing company plans to make two products : chairs and table , from its available resources , which consists of 400 board feet of wood and 450 man-hours. It is known that to make a chair requires 5 board feet and 10 man-hours and has a profit of Rs 45 while each table uses 20 board feet and 15 man-hours and has a profit of Rs 80. Determine how many chairs and tables the company can make , keeping within its resource constraints. Solve the LPP using simplex methods. Please help me with this question i have solved it using graphical method but unable to solve it by using simplex methods bcoz there is no negative value in iteration 1 .

28. Why is it that with a minimum, your inequalities are greater than 60 or 30? Surely they should be less than these two numbers, as you are constrained to 60g protein or 30g fat?

29. the fact the we only need to look at the intersection points is because the function we want to minimize is a plane in R^3 so it wont have any minimum points inside the region?

30. I am so thankful for this video! This is the best and most straightforward way to explain linear programming!! I'm earning my Masters online and it's hard to figure it out with just the textbook.

31. . B. Rug Manufacturers has available 1200 square yards of wool and 1000 square yards of nylon for
the manufacture of two grades of carpeting: high-grade, which sells for \$500 per roll, and low-grade, which sells for
\$300 per roll. Twenty square yards of wool and 40 square yards of nylon are used in a roll of high-grade carpet, and 40 square
yards of nylon are used in a roll of low-grade carpet. Forty work-hours are required to manufacture each roll of the highgrade carpet, and 20 work-hours are required for each roll of the low-grade carpet, at an average cost of \$6 per work-hour.
A maximum of 800 work-hours are available. The cost of wool is \$5 per square yard and the cost of nylon is \$2 per square
yard. How many rolls of each type of carpet should be manufactured to maximize income?