Linear Programming Example

Linear Programming Example


ok here we are going to maximize the
function C equals x plus y given the constraints that why has to be greater
than or equal to 0 X has to be greater than or equal to 0 4x plus 2y must be
less than or equal to 8 and 2x minus y has to be less than or
equal to 0. Notice the first two constraints y greater than or equal to 0
and X greater than or equal to 0 that simply means that we’re going to be our
are feasible region is going to be in the first quadrant quadrant one so we’ll
keep that in mind and then i’m going to start graphing the inequalities 4x + 2 y
less than or equal to 8 and 2 X minus y less than or equal to 0 so I’m going to
start off by making both of these into equations so those these are just going
to be lines and the graph these i’m going to find the x and y-intercepts of
each so to find the x-intercept we can simply let y equal zero for the first
equation will be left with 4x equals eight if we divide both sides by 4 x
equals 2 for the second one well we’ll have 2x equals 0 if we divide both sides
by 2 will just get x equals 0 so this one’s a not going to be as useful
because well we’ll see in just a second to find the y-intercept we let X equal 0
and if we let X equal 0 we would have 2y equals 8 if we divide both sides by 2 will get y
equals four well ok back to what i was saying a
second ago if we let X equal 0 will have negative y equals 0 which tells us y
equals 0 so here we know we’re getting a point 2 comma 0 and 0 comma 4
on our line but for our second line we’re only getting the point 0 0 and
again we’re getting 00 so what we can do though 2x minus y equals 0 we could always
write that as 2 x equals y then we can graph it just using slope
intercept form ok so let’s start graphing here again we
said we’re in the first quadrant so I’m going to make my my graph so that we
just really only see the first quadrant ok so the first equation for x plus 2y
equals 8 there’s a point 2 comma 0 and also at 0 comma 4 against it was less
than or equal to the original constraint we can use solid to solid line and then
likewise we have y equals 2x so that’s going to have a y-intercept of 0 and
then we go up to over 1 up to over 1 etcetera ok so now we simply have to determine
the feasible region so what I’m going to do is use a test . again keeping in mind
that this has to be in the first quadrant so 4x plus 2y has to be less
than or equal to 8 and our other our other inequality was 2x minus y less
than or equal to 0 so for my line for x plus 2y equals 8 to test the inequality
i’m going to use a point not on that line and i met again just going to use
the origin 0 0 so again the other line does go through 00 but you can almost
forget about that line for a second so as long as I take a point off of the
line 4x plus 2y equals 8 I can use that as a test point so for my
first inequality i’m going to test the point 0 0 and certainly if you plug in 0
for X and 0 for y we would get that 0 is less than or equal 8 so I know for my first inequality i
would have to shade below for the second 12 X minus y less than or equal to 0 well now we can’t use the test point 00 so
we have to use some other point I don’t know how about the point 1 comma 0 so
I’m going to test the point 1 comma 0 so if we plug 1 in for X and 0 in for why i
have to ask myself does that satisfy our inequality well we’ll have to say is 2 less than
or equal to 0 certainly not so for my second inequality the test point was below
it which means we need to shade above it and again since we’re trapped in the first quadrant we know that our feasible region is going to be this
little triangular region it’s a touching the the y-axis and it’s easy to see that
this is going to cross at the point 1 comma 2 so that’s the benefit of having
a nice good graph ok so we can even label all the corner
points we’ve got 1 comma 2 we’ve got zero comma 0 the origin and then we also
have the point 0 comma 4 so now we simply need to take these three points
put them into the function that we were trying to maximize and determine which
of those gives us our largest value so we’ve got C equals we want to maximize c
equals x plus y and again we’ve got the points (0,0) (0,4) and the other one was 1
comma 2 well the arithmetic here is pretty easy i think so clearly if you
plug in 0 0 will get that c equals 0 0 plus 0 we put in 0 comma 4 will get that
c equals 0 + 4 or we will get the value of four and if we plug in 1 comma 2 into our
function will get 1 plus 2 way that only gives us three so it says the maximum
value possible will be the value of positive 4 and again that’s going to
occur at the point 0 comma 4

35 thoughts on “Linear Programming Example”

  1. I've tutored at a college and this is one of the subjects the students were learning. I loved helping them out with this and it was my first experience with Excel's solver. Btw I've tutored many, many students and I often recommend your videos. Keep up the great work Patrick!

  2. what rule rules out any other point along the triangle formed by the shaded area being the maximum? and i think its better to just use use the slope intercept form when deciding what to shade, that will leave you a y> (shade above) or y< (shade below), some thing but much easier to see i think

  3. I failed this class last semester.
    Of course, my teacher didn't make it seem so easy, it was all about subsets and hyper planes and counting and inverse matrices that represented unimaginable geometric figures.
    This stuff is so easy though. I can't but wonder why some people try and be dicks when explaining this.

  4. Oh no, it's just that this guy was a (real) dick.
    I had never complained about a teacher before, but this guy had a pretty questionable record; he told us that about 70% of his students dropped out from his class and that from the remaining 30%, only 40% of them passed.
    I mean, I understand some teachers want to express that whatever they teach isn't easy, but I'm positive I can call this guy a dick without being unjustified.

  5. thanks for this excellent technical aid, I surely send some moneys to my friend Patrick. Thanks Patrick, you are the best of the west and of the east too.

  6. Bro I just want to say I have watched a few of your videos and honestly they are really good, I now am going to take the time out to LIKE them thank you!! In a few Days I would like to post a video response about a difficult LP sum. Thank you

  7. Excuse me how do you know whether to use the test points (0,0) or (1,0)? in other words how do I know which one to use and why didn't use (0,0) again for the second line?

  8. So basically the function C we want to maximize is a plane in R^3. We could calculate the gradient of C to find in which direction its constant maximum slope occur and then draw equipotential lines to find at which corner the maximum value of C occurs

Leave a Reply

Your email address will not be published. Required fields are marked *