yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Lagrange multiplier example, part 2


4m read
·Nov 11, 2024

So where we left off, we have these two different equations that we want to solve. Um, and there's three unknowns: there's S, the tons of steel that you're using; H, the hours of labor; and then Lambda, this Lagrange multiplier we introduced that's basically a proportionality constant between the gradient vectors of the revenue function and the constraint function.

And always the third equation that we're dealing with here to solve this is the constraint itself that gives us another equation that'll help solve for H and S, and ultimately Lambda if that's something you want as well.

So as kind of a first pass here, I'm going to do a little more simplifying, but I'm going to make a substitution that'll make this easier for us. So I see S over H here, and they're both to the same power, so I feel it might be a little bit easier if I just substitute U in for S / H. What that'll let me do is rewrite this first equation here as 3/23 * U^(1/3), and that's equal to 20 * Lambda.

Then likewise, what that means for this guy is, well, this is H over S, not S over H, so that one's going to be 1003, not times U^(2/3), but times U^(-2/3) because we swapped the H and S here. So that's U^(-2/3), and this is just to make it a little bit cleaner; I think we kind of want to treat H and S in the same package.

Now let me go ahead and put all the constants together, and I'm going to take this guy and multiply it by 3, divide by 200, and multiply both sides of that just to cancel out what's on the left side here. What that's going to give me, and I'll go ahead and write it over here, kind of all over the place, U^(1/3) is equal to, let's see, 3/200. So that 20 almost cancels out with the 200; it just leaves a 10, so that's going to give me 3/10 * Lambda.

Then similarly over here, I'm going to take this whole equation and multiply it by 3 over 100, and what that's going to leave me with is that U^(-2/3) is equal to, let's see, this 2,000 when we divide by 100 becomes 20, and that 20 * 3 is 60. So that'll be 60 * Lambda.

Alright, so now I want a way to simplify each of these, and what I notice is they look pretty similar on each side. You know that it's something related to U equal to Lambda. So if I can get this in a form where I'm really isolating U, that would be great. The way I'm going to do this is I'm going to multiply each one of them by U^(2/3).

I'm going to multiply it into this guy, and I'm going to multiply it into that guy because on the top it's going to turn this into just U, which will be nice, and on the bottom, it'll cancel out that U entirely. So it feels like it'll make both of these nicer, even though it might make the right side a little uglier. Those right sides will still kind of be the same, and we'll take advantage of that.

So when I do that to the top part, like I said, that U^(1/3) * U^(2/3) ends up being U, and then on the right side we have our 3/10 * Lambda but now U^(2/3). Then on the bottom here, when I multiply it by U^(2/3), the right side becomes one because it cancels out with U^(-2/3), and the right side is 60 * Lambda * U^(2/3).

Now these right sides look very similar, and the left sides are quite simple, so I'm going to multiply this top one by whatever it takes to make it look exactly like that right side. So in this case, I'm going to multiply that top by 10, which will get it to 30, and then by another 20 to make that constant 60.

So I'm going to multiply this entire top equation by 200, and what that gives me is that 200 * U is equal to 60 * Lambda * U^(2/3). Now these two equations have the same right side, so this is the same as saying 200 * U is equal to, well, one, because each one of those expressions equals the same complicated thing.

And now, 200 * U, well that's S / H, so this is the same thing as saying 200 * (S / H) = 1, which we can write more succinctly as H is equal to 200 * S. Great! So I'm going to go ahead and circle that: H is equal to 200 * S.

Now what we apply that to is the constraint: 200 * H + 2,000 * S equals our budget. I'll go ahead and kind of write that down again: that our 20 * H, I think 20 * the hours of labor plus $2,000 per ton of steel is equal to our budget of $20,000.

Now we can just substitute in. Instead of H, I'm going to write 200S. So that's 200; sorry, 20 * 200S plus 2,000 * S is equal to 20,000. Now this right side, 20 * 200 is equal to 4,000, and I'm just going to go ahead and kind of write, so this here is 4,000S.

So the entire right side of the equation simplifies to 6,000S is equal to 20,000, and when those cancel out, what that gives us is S is equal to 20 / 6, which is the same as 10 divided by 3.

So that's how many tons of steel we should get. S is 10 over 3. Then when we apply that to the fact that H is 200 * S, that's going to mean that H is equal to 200 times that value, 10 over 3, which is equal to 2,000 over 3. That's how many hours of labor we want.

So evidently, in our original problem where we have this model for our revenue function for our widgets, with $20 per hour of labor and $2,000 per ton of steel, with a budget of $20,000, the allocation that you should make is to buy 10/3 of a ton of steel and 2,000/3 hours of labor.

More Articles

View All
Cortex Subtle T's & Hoodies! Annual Limited Drop!
For years I struggled to find the perfect t-shirt, sadly without success. Then, over at Cortex Incorporated, where we mostly make premium paper productivity products, we pondered: can we also produce the perfect shirt? Something everyday casual, but that…
Curvature formula, part 3
So continuing on with where we were in the last video, um, we’re looking for this unit tangent vector function given the parameterization. So the specific example that I have is a function that parameterizes a circle with radius capital R, but I also kin…
Tiger Sharks' Superpowered Jaws | SharkFest | National Geographic
Tiger sharks are one of the largest predatory sharks on the planet. They feed off an extensive menu: whales, birds, even other sharks. But there’s one delicacy that takes more effort than others. Turtles! So how much jaw power does it take to crunch throu…
Danae Ringelmann at Startup School SV 2014
First of all, this is totally awesome. Um, I want everybody to actually take a minute, a moment of silence, and appreciate the fact that you’re here. Um, and appreciate the fact that your whole life has been leading to this point. You might all be thinkin…
Boost writing skills with Khan Academy's new essay feedback feature
Hey there! If you’ve heard of Kigo KH Academy’s AI-powered tutor and teaching assistant, you probably know about how it’s been developed to help students solve math problems without giving away the answer, strengthen arguments through debate, or break dow…
Elad Gil and Pejman Nozad - Startup Investor School Day 3
Just yesterday, the main topic was really focused on the hardest thing about investing, I think, which is how do you decide to invest? How do you go about making decisions? So we heard from Dalton, who talked about founder meetings, talked about the proc…