Optimization Using the Closed Interval Method - Problem 2
We are talking about optimization problems. And no discussions about optimization problems, will be complete without a fence problem. Here’s an example of what the fence problem is about. A farmer needs to build a rectangular pen for her pigs. The pen will bordered on one side by her barn. She has 400 feet of fencing, with which to enclose the other three sides. How should she construct the fence, in order enclose the maximum area?
So I have a picture here of the situation. Here’s her barn just drawn the side of her barn. And we are going to build the three sides to enclose a rectangular area.
We are assuming that the barn is as long as we need it to be. So if the best area to build is really long and narrow, we can build as long as we like. So that’s maybe not a realistic assumption, but to assume differently will make the problem a little harder. So let’s make that assumption.
The first thing we need to do, is assign some variables here. I’m going to call this width here x, just because it's horizontal. This would also be x, and this will be y. And let me remind myself it’s an optimization problem. I’m either maximizing or minimizing something. In this problem I want to find maximum area, that’s the key.
That tells me what function I need to define here, and that’s the one that I’m going to find the maximum value of. So an area function. The area of this. Unfortunately, the area of this rectangle is x times y. I’m saying unfortunately because this is area defined in terms of two variables. We are going to need this in terms of one variable. So I’m going to have to get rid of one of these variables, using some kind information from the problem. Some kind of constraint and that’s usually what the second piece of information is called.
There is a constraint here. She has 400 feet of fencing. So somehow I have to build that into the problem. These three sides will have to be at most 400 feet. There are two x’s and one y. So that means 2x plus y equals 400. This is called the constraint. And it will allows me to solve for y, make a substitution and then my function will be entirely in terms of x. So let me do that right now. Y equals 400 minus 2x. So my area becomes x times and y is 400 minus 2x. And I’ll write this as 400x minus 2x².
That’s my area function. So I need to maximize this. I’m using the close interval method that I want to. Before I do that, I have to define what domain makes sense for this function. This is a really important step. Because, in order for you to use the close interval method I need this function defined on a closed boundered interval. It needs to have a left and right endpoint.
Think about what values of x makes sense in this problem. It certainly makes sense that be at least 0. It can’t be less than 0, that wouldn’t make sense. And so I’m going to make the requirement that x be bigger than or equal to 0. And, the biggest x can be, if you can imagine this getting longer and longer and stretching out, and y becoming smaller and smaller, the biggest x can be is 200. Because I have a 200 piece of fence here and then another one right above it, just right next to each other. So 200 is the biggest.
I’ve got my closed interval. I’ve got my function. All that's left to do, is closed interval method. Find the derivative, determine the critical points and make a table of values. So what’s A'?
The derivative of this function would be 400 minus 4x. Critical points are where the derivative is 0 or undefined. This derivative is 0 when 400 equals 4x. So when x equals 100, so, right in the middle. Let’s make our table of values.
We have x and we have A(x). We have the two endpoints 0, and 200, and we have the one critical point, 100. And I need to write the areas here, here and here of each of these values. When I look at the area function I think this is actually easiest formula to use. I plug in 0, and I’m going to get an area of 0. And it kind of makes sense. When x is 0, all I have is one long vertical piece mashed laid up against a barn. The 0 area enclosed by that, 0. When x is 200, this is going to be 400. 400 minus 400 is 0. That also makes sense. When x is as long as it can possibly be, I just have 200 foot lengths of fence right against one another, enclosing the 0 area.
But when x is 100, I have 100 here, 400 minus 200 is 200. 100 times 200, 20,000. By virtue of being the biggest value, that’s got to be the absolute maximum. So this is the absolute maximum area. Now what were we asked?
Let’s just take another look back. It says how should she construct the fence in order to enclose the maximum area? I wasn’t actually asked of the maximum area. I was asked for the dimensions that give me the maximum area. So I need to say what x is and what y is, in order to create the fence, that encloses the maximum area.
So she needs x to equal 100. And if x equals 100, just plug them back into the picture. This is a 100 and this is 100, she has 200 left for y. And so y needs to be 200. So that’s how long the dimension should be. She should build the fence 100 feet wide, and 200 feet long. 200 feet being parallel to the side of the barn.