 So we've seen that when we try to maximize the entropy, when we try to figure out which macro state of the system is most likely, when we're using probability constraints, then we get a fairly boring result. Every state is equally likely to all the others, but it turns out things get a lot more interesting when we impose constraints on the energy of the system. So to illustrate what I mean by that, let's start with a fairly basic example. Let's say that we have a system where the molecules can be in any one of three energy levels. They can have an energy of zero, an energy of one, or an energy of two. So this is essentially a lattice model for the energy. I'm only allowing the energies to have energies of zero or one or two, no other values in between. So if the particles can have energies of zero, one or two, so these are the possible energies that the particle can have. For my problem, let's say we've got a total of 21 molecules, each of which can be in any one of these energy states they like, except I only have a total budget of six units of energy to go around. So not every molecule can be in the upper energy levels. Energy is conserved. I only have six units of energy. I can't create or destroy energy. So if I start out with six units of energy, if one molecule gains some energy, another molecule has to lose energy to compensate. So the question becomes, which macro state, which distribution of particles in the system is going to be most likely under these conditions? And in this case, what I mean by a macro state is, if I tell you how many molecules have energy zero, how many have energy one, how many have energy two, that's a macro state of the system. For example, if I say 15 of the molecules are in the ground state with energy zero and six of them are in this state, that would be, and none of them are in the state two, that would be one macro state of the system. There's several different macro states I can write down and we'll write several of them down. The question is, which of those is more likely than the others? So this is our macro state. A micro state, on the other hand, would be if each of my 21 particles had a label and I could say particle number one is in this state, particle number two is in that state, particle number three is that state. If I knew microscopically where every individual particle was and what its individual energy was, that would be the micro state of the system. The macro state, I don't care which one is which, I'm just saying five of them are in one state, 12 of them are in another state, and so on. So let's start by writing down a few possible macro states of the system. So again, as a reminder for this diagram, those are the different energy levels. For each of those energy levels, I can, let's illustrate that macro state by populating these energy levels with actual molecules. So if I have to put 21 molecules into these energy levels, let's start by figuring out which ones have some energy. So the easiest way I can think of to do it would be to have, let's say six molecules, one, two, three, four, five, six of them have an energy of one. So that's used up all my total energy budget of six units of energy, so I can't have any molecules left up in the E2 state. There's no energy left for those, so all the other 15 molecules have to be down at the bottom. One, two, three, four, five, six, seven, eight, nine, 10, 11, 12, 13, 14, 15. So all 15 of the remaining molecules are down in the ground state. So that's one individual macro state of the system, so N0, N1, N2, I put 15 of them in the ground state, six of them in the next state, and none of them in the highest state. So that's a macro state of the system. That's one of my possibilities. I can think of others, for example, so I could do that, or it's not terribly interesting to have none of them in the E2 state. Let's suppose I do want to put one of my molecules up there with the total energy of two. I've taken one of these molecules and I've lifted it up to here, but remember energy has to be conserved. Total energy has to be six. One way of thinking about that is if this molecule gained one unit of energy, somebody else had to lose one unit of energy. So there's only four of them left in that intermediate state. Or the other way of thinking about it is in order to add up to six, this molecule has two units of energy. Each of these four have to have one unit of energy each to add up to six. Five molecules with any energy whatsoever and the other 16 of them have to be in the ground state. So that's 16 molecules in the ground state. So that would be a macro state described by 16 in the ground state, four in the intermediate state and one in the highest state. So that's a different macro state. I can write down multiple different macro states. I've written down two. There are some more. But notice that each of these valid macro states has to obey two constraints. There were two rules I had to obey when drawing one of these diagrams. First of all, if I add up how many are in each individual state? If I add up N0 and N1 and N2, those have to add up to 21. I've got 21 molecules in this macro state. I've got 21 molecules in this macro state. I have to have 21 molecules no matter what. I could not, for example, put 10 molecules in this state, 10 molecules in that state, 10 molecules in that state. That certainly would not obey this constraint. I have to have 21 molecules total. Likewise, there's a constraint on the total energy. I had to be careful not to spend more than six units of energy when partitioning these molecules among different states. So the way to write that constraint down is however many molecules in each state multiplied by the energy of that state. So for example, 16 times 0 plus 4 molecules with energy of 1 plus 1 molecule with an energy of 2, that has to add up to the total energy of 6. So for all my three states, the 0 state, the 1 state, the 2 state, molecules times energies have to add up to my total energy. That's two different constraints on my macro states. So we can use those constraints to identify possible macro states. So we've already written down 15 comma 6 comma 0. We've written down 16 comma 4 comma 1 as two possible macro states that obey these constraints. To find some others, we can just continue this process. If I can certainly have 0 molecules in the highest energy level, I can have 1 molecule in the highest energy level. I could have 2 molecules in the highest energy level. But again, if I want to pay to lift 1 molecule up, I have to, in order to conserve energy, let 1 molecule fall back down. So I'm going to lose not only the one that I excited, but one that has to fall down to the ground state. So I can double check and make sure that I've got 21 total molecules and that 2 with energy 1 and 2 with energy 2 adds up to a total energy of 6. So that's another valid macro state of the system. And if I do that one more time, I can put as many as 3 molecules up in the top state if I wish. But then I don't have any energy left to put anybody in the intermediate state. So there's another valid macro state of the system. So what can I do with that information? My goal was to figure out which of these macro states is most probable and I can't write down anymore. If I can't have any fewer than 0 molecules in the top most state, I can't have any more than 3 molecules in the top most state because I've used up my full energy budget. So these, it turns out, are the only 4 macro states that are allowed for this particular system if I'm limited to having only 6 energy. My goal then is to figure out which of these has the highest entropy. So for each of these macro states, if I know the probabilities, I can calculate the entropy divided by Boltzmann's constant to be minus the sum of P log P's. So just as an example, to show you that we do, in fact, know what the probabilities are. If I have 21 particles and 15 of them are in the ground state, 6 of them are in the intermediate state, none of them are in the upper state, then the probability that I'm gonna find a molecule in the ground state is 15 out of 21. In the intermediate state, it's 6 out of 21. And in the top state, it's 0 out of 21. So knowing the total number of particles in each state and knowing the total number of particles, these probabilities are just little ends over the total begin. So we do, in fact, know what these probabilities are. If I were to calculate minus the sum of the probability, log probabilities, in other words, negative 1521 times log of 15 over 21 added to negative 6 over 21, log of 6 over 21 added to zero, log zero. If I calculate that for this macro state, I get a number. I can tell you what that is. That number is 0.60. And I can do that for each of these states. Calculate the probabilities, sum up the P log P's. And what I find is that each one has a different value for the entropy. So which one of these states is most probable? Which distribution of particles among these energy levels is most likely and has the highest entropy? That would be this one, the one with the highest value of the entropy. So what that tells us is this macro state where I've got 16 in the ground state, four in the first excited state, one in the uppermost state, that's the one with the highest entropy. So this one that I happen to draw second here is the most probable macro state. More likely that I have 16 in the ground state, one up in the uppermost state than I have this distribution or some other distribution. Just to answer a potential question, you might ask yourself, based on what we talked about in the last video lecture, what we learned is that entropy is maximized when the distribution is flat, when every probability is equal, right? So if I have an equal probability, one third or seven out of 21 chance of being in the ground state, seven out of 21 chance of being in the middle state, seven out of 21 chance of being in the upper state, seems like that ought to have a higher entropy than these cases based on what we talked about previously. And that's in fact true. The probabilities, one third, one third, one third, if I calculate minus one third, log one third, add that to minus one third, one third, add that to minus one third, along one third, what I get when I do that is 1.10 times k. So that does in fact have a higher entropy than this state where they're not as equally distributed. It's a higher entropy, more random, to put an equal number of particles in each state rather than to have a distribution like this one. But what's wrong with this solution, with an entropy of 1.10 times k? What's wrong with that solution is it disobeys this requirement. I still have 21 particles, but I have spent more than my total budget of energy. I've put seven molecules in the upper most state. That costs 14 energy, these cost seven energy. I used up 21 energy in order to get this much entropy, and that's not allowed. If I only have six units of energy to go around, this state is not permitted because it breaks the constraint on the energy. So what we found can be summed up by two observations. Number one, when we have an energy constraint, when the energy is constrained, in addition to just the number of particles or probabilities being constrained, then we may not be allowed to have equal number of particles in every state. So the flat distribution of equal number of particles in every state isn't allowed, and one of the other distributions is going to be most probable or have the highest entropy. And notice that it's interesting that what we see here is typical for what we see in a chemistry problem in the real world, which is that high energy states are less probable, less occupied, have a lower probability than low energy states. In the real world, it certainly is true that low energy states, states with relatively little energy are pretty common, they happen with high probability, only rarely do you find systems with a lot of energy in them. So we're beginning to see why that's true. We've only done this for one particular example. We had to enumerate every individual possibility to figure out which one had the highest entropy. So the next step is going to be to use Lagrange multipliers and the general case to see what, in a case where we have an arbitrary energy constraint, what indeed are the probabilities that are most likely.