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
Meta Analysis: What is Facebook's Future? (w/ Divya Narendra @SumZeroInc)
Take a look at this. This is the one-year stock price chart for Meta, the world’s biggest social media company. As you can see, it doesn’t look so good at the time of recording, down 44% year-to-date. But if you look at, say, revenue or net income or free…
Why Is Ice Slippery?
Why is ice slippery? Ice slippery? Oh, I don’t know, I couldn’t tell you that. Um, but you skate on it. I skate on it, but, uh, you know, that it feels pretty slippery, doesn’t it? It does feel slippery, but you would feel a different slipperiness to me …
Types of RICH PEOPLE
You know, Alex, so many people think that rich people are all the same, but it’s just not quite true. Not all wealth is created or spent equally. So today, we’re talking about the 15 types of rich people. Welcome to Alux, the place where future billionair…
The Closer You Are to the Truth, the More Silent You Become Inside
One of the tweets that I put out a while back was: “The closer you get to the truth, the more silent you are inside.” We intuitively know this. When someone is blabbing too much, that person talks too much at the party—the court jester. You know they’re n…
Adam Brown on how to be resilient during a time of high stress and anxiety | Homeroom with Sal
Hi everyone, welcome to the daily homeroom live stream. Sal here from Khan Academy. For those of you who are wondering what this is, this live stream is something we started as soon as we saw schools starting to get closed around the world. Because we saw…
Lesson Planning with Khanmigo Webinar
Welcome, welcome everybody! We are here today to talk about lesson planning and how at KH Academy and with Con Migo we can support you with lesson planning. We know we are all teachers; we have been in the classroom. We have gone through lesson planning.…