00:01
Okay, we want to build a water line from p to s, and we know that the cost along each of the three parts, l1, l2, and l3, are all different, and we also know that, well, the cost actually isn't very much compared to what we might expect.
00:28
But anyway, so we want to minimize the cost to build the line.
00:34
So the cost is 3l1 plus 2l2 plus l3, okay? and to get l1, l2, and l3, we want to minimize the cost.
00:50
We need actually three constraints.
00:57
So i put in two more variables, x1 and x2, which are the distances, kind of the projected distances of l1 and l2, down to here.
01:16
And so we get these three constraints.
01:18
So when we write out our lagrange function, we're going to have three lagrangian multipliers.
01:35
So here it is.
01:35
We got our cost, which is the thing we're minimizing, plus lambda 1 times the first constraint, plus lambda 2 times the second constraint, plus lambda 3 times the third constraint.
01:54
So here's the thing.
01:57
There are eight variables, because there's three l's, two x's, and three lambdas.
02:06
So we have to take the derivatives with respect to all eight and set them equal to zero.
03:23
So we set them all equal to zero.
03:38
There are eight equations there.
03:41
I'm going to number them one to eight.
03:56
Now if i take a good look at these, they occur in sets.
04:02
So equation three stands alone and tells us lambda 3.
04:08
And then there are two sets of three.
04:12
If i look at one, four, and six, since i know lambda 3, these three only depend on lambda 1, l1, and x1.
04:27
So that basically gives me three equations and three unknowns for those three things.
04:31
And then i got another similar set that's two, five, and seven.
04:41
And these depend on lambda 2, l2, and x2.
04:46
And then equation eight will serve to give us l3 once we know everything else.
04:54
So we don't really have to solve eight equations and eight unknowns all at once.
05:01
We can break it down into smaller, smaller problems.
05:06
So first of all, three tells us that lambda 3 is minus one...