 Okay, our goal has been to figure out which macro-state of a system is most likely, meaning which macro-state either maximizes the multiplicity or maximizes the entropy of the system. And now we're in a position where we're able to do that not only with constraints on the probability, but also with constraints on the energy. So that's what we'll do now. So our goal is, let's say we have n particles and molecules and objects of some sort, indistinguishable particles. Each one can be in a number of different states. Again, maybe it's energy levels for a molecule, maybe it's different confirmations, maybe it's different products for reaction, and so on. We've got a number of different states that a molecule or a system can occupy. Each one of those states has an energy. In the previous example, for simplicity, we said this state had an energy of zero and an energy of one, energy of two. That's not necessarily true. Any individual state might have a completely arbitrary energy. So each state has its own energy that's just labeled e sub zero, e sub one, e sub two. And our goal is to find the probability that each state is occupied. Is it 50-50 or is it not 50-50? What are the probabilities that maximize the entropy? Or if we prefer the entropy divided by k just to keep the algebra a little simpler, and we know how to calculate that entropy from the probabilities, it's the sum of the pi log pi terms. But we want to maximize that entropy not just on its own, but with some constraints. We need, first constraint is we need the probabilities to sum to one. That's equivalent to saying, so sum up all the probabilities they add up to one. Just point out that because probabilities are the same as occupation numbers divided by the total number of molecules. If I multiply this equation by n, these p's which are little n divided by big n, if I multiply them by big n on the left, that's like saying if I add up the number of molecules in each state, that has to give me the total number of molecules. So those two constraints are equivalent to each other saying all the probabilities have to add up to 100%. That's equivalent to saying if I add up the total number of molecules in each state, I have to get my combined total number of molecules in the whole problem. So the other constraint that we have considered is an energy constraint, which I could write as the number of molecules in each state multiplied by how much that molecule, how much energy that state has, that has to add up to my total budget of available energy. If I think of it the other way around in terms of probabilities, in this case, if I divide by capital N to get over to the other side, dividing little n by capital N turns it into a probability on the left. And on the right, if I take the total energy divided by how many molecules I have, that's just a molar energy, energy per molecule or energy per mole. So that constraint is equivalent to saying the average energy, if I add up what the probabilities of being in each state for all the different states, that has to add up to the average energy. So these constraints on the left are equivalent to the constraints on the right, just depending on whether you want to think about them in terms of number of molecules N or probabilities P. And of course we'll solve this problem in terms of probabilities, so we'll use these two constraints on the left. One way of thinking about these constraints is the constraints on the right in terms of molecules. Those are extensive constraints. If I double the size of the system, the energy and N will both double. The constraints on the right side are intensive constraints. They tell us something only about the probabilities and the averages, not the total amount of material we have. So here's our problem. I want to maximize the entropy. I want to find the probabilities that maximize the entropy subject to these two constraints. We'll use Lagrange multipliers to do that, as we've gotten used to doing now. The only difference between this problem and the ones we've considered before is that we now have two constraints. If we think about how to set up the Lagrange multiplier problem, I'm maximizing some function F, subject to some constraint, that the sum of the probabilities have to add up to one. And perhaps, not perhaps, definitely subject to a second constraint that the average energy has to be constrained as well. So I've got two constraints instead of one. So what that does to the Lagrange multiplier problem is when I solve for the probabilities, Lagrange says, up till now I've said derivative of the original function with respect to a variable minus the Lagrange multiplier times the constraint. Now I've got two different constraints, so I'm going to end up with two different Lagrange multipliers. So rather than using lambda, I'm going to use alpha and beta for my two Lagrange multipliers. So I've got minus Lagrange multiplier alpha times the derivative of the first constraint, dG dP for one of my probabilities, and also a minus second Lagrange multiplier beta times derivative of the second constraint. That's what has to be zero in order for us to be at a max or a min of our constrained entropy function. So we can take these derivatives. Let's see, derivative, I'll go ahead and write out the derivatives we're going to take. Derivative with respect to p sub j of minus sum of the pi log pi's minus alpha derivative with respect to probability of the sum of the probabilities minus beta derivative the second constraint, which is the sum of the probabilities times the energies. So that's the thing that we need to be equal to zero. That looks like a mess, but it's mostly derivatives that we have successfully taken before. So derivative of a sum, we just need to grab out the piece that interests us. So derivatives with respect to p sub j, so I only care about the piece that involves p sub j. So this first derivative of minus p log p is minus log p minus one. Second piece, I've got an alpha. Again, grab out only the the piece that involves the pj. So the derivative of this pj with respect to pj is just one. So alpha times one. And then for the second constraint, this is the one that we haven't considered yet in any previous problems. Derivative with respect to pj of the sum, grab out only the piece that involves a j. So p sub j times e sub j. Derivative with respect to p sub j is just e sub j. So that's the derivative of this beta term with respect to pj. All of that has to equal zero, and it has to equal zero not just for one value of j, but for all of them. So I've got a bunch of equations all of which look like this. If I rearrange to let's say put log pj on the left, what's on the right is a minus alpha minus one and a minus beta ej, similar to results we've obtained before, but not exactly the same. Undoing the log, take e to both sides, e to the log pj gives me pj. I'm going to break this up into two terms. e to the minus alpha minus one, because that looks a lot like a result we've had before. And then I've also got e to the minus beta ej. So just explain the algebra there. e to this sum of the minus alpha minus one term and the minus beta ej term is the product of e to the one of them times e to the other. Okay, so here's an expression for what the probability is of occupying state j. It's some constant involving a Lagrange multiplier alpha and some other term involving a Lagrange multiplier beta that I can't call constant because it also depends on this value of e sub j. Our next step in order to get rid of the Lagrange multipliers because we don't really care about their values is to go back to the constraints. So if I go back to the first constraint that says the sum of the probabilities have to add up to one. If I add up all these probabilities, so using the constraints now, sum of the p i's has to be one. So if I sum up all these terms, so sum up e to the minus alpha minus one times e to the minus beta times an energy for all the possible states, that's what has to be one. Notice that the e to the minus beta e i term, that involves this index i so I can't pull that out of the sum. But the alpha e to the minus alpha minus one, there's no i's in here so I can pull that entire term out of the sum. So one has to equal e to the minus alpha minus one times this sum of e to the minus beta e sub i. If I rearrange that equation, so e to the minus alpha minus one, if I pull this entire sum over underneath the one, that term e to the minus alpha minus one is equal to one over the sum of all these e to the minus beta e i terms. What I can do with that is I can take this e to the minus alpha minus one and plug it back in here. My goal is to figure out the probabilities. The probabilities look like e to the minus alpha one times the second term. I've just figured out what the value of this e to the minus alpha one term is, so if I plug this result in for e to the minus alpha minus one, I'll find and I'll go ahead and write this up here. The probability of occupying some state j is e to the minus beta energy of that state j, so that's this piece right here, divided by the sum of e to the minus beta e j or e i summed over all of the possible states i. So that, I won't put that in a box just yet, but that's very close to an important equation that's worth naming and putting in a box. This tells us the probability of occupying some state j. Notice that we haven't yet gotten rid of that Lagrange multiplier beta. You might think that the next thing we're about to do is continue with some algebra, use the second constraint and try to eliminate that Lagrange multiplier beta. Turns out we can't do that with just algebra alone. In order to do that, I would have to tell you some extra details about what exactly are these energies, what are the values of the energies and what's the energy constraint, what is the average energy in the system. So this value of beta will be different for every problem, and solving for it algebraically at this point would be quite tricky, so we're actually going to stop with the math and leave that right here, but I'll make a couple of points about this expression. First of all, this quantity in the denominator, if I write this quantity sum of e to the minus beta e i, summed over all the possible states the system can be in, if I call that thing, if I give that a name, call it capital Q for now, that lets me rewrite this equation a little more simply. To say the probability of being in some state j is 1 over Q e to the minus beta energy of that state. The reason it's a reasonable thing to do to write this sum and give it a name Q is because this thing is a constant, it's just a number. I don't yet know what the value of beta is, but when I solve for beta, I'll get a value for beta and I can add up e to the minus that beta times one of the energies, e to the minus beta times a different energy, add that up for all the possible energies, and I'll get some number. That number is just a constant, it's not a function, it's just a constant. So I'll just give that number whatever it is a name and call it Q, and so then what that tells us is the probability doesn't really depend on what Q is, the probability is 1 over this number. What affects the size of this probability is the energy, just as we saw when we considered energy constraints for the earlier arbitrary problem with 21 molecules spending an energy budget of six energy units. The upper states with higher energies were less populated, had a lower probability of being populated than the lower energy levels with less energy, and that's because of this expression here, the higher the energy level because the probability in general behaves as e to the minus energy, the higher the energy gets, the lower the probability gets, and that agrees again with what we see in the real world, if I ask you which is more likely that a molecule is in an excited state or a ground state, it's typically more likely that it's in the ground state. What's more likely that a molecule would be found at sea level where the gravitational energy is low or up at the top of Mount Everest where the gravitational energy is high, it's more likely to be found at the ground level and that's why there's more air down here to breathe at sea level than there is at the top of Mount Everest. So in general we know that it's true that the higher the energy, the less likely we are to find particles with that higher energy. What we figured out now is that behaves as an exponential, the probability is decaying exponentially with the energy with some proportionality constant beta that we don't totally understand yet. So we will definitely be able to understand more about what this beta constant is as we go on, but the next step is to make sure we understand really what does it mean and why is it true other than the math which proves that it's true, but what does it mean that the probability decays exponentially with the energy and what does that tell us about probability of occupying systems. So that's what we'll talk about in the next lecture.