We've learned a little bit about thermodynamics, which is the study of heat and thermal energy. But a more general field is the field of statistical mechanics. Statistical mechanics is a general framework that shows how macroscopic properties such as heat arise from the statistics of the actions or the mechanics of large numbers of microscopic components such as atoms or molecules. We saw an example of that for instance with our NetLogo gas model. So imagine this is a roomfull of air where each of the little balls are different air molecules moving in different speeds. A macroscopic property of this room full of air would be the temperature or the pressure in the room to be the purview of thermodynamics. A microscopic property that is the mechanics would be the positions and velocities of air molecules, and if you'd like, all the forces acting upon them. Statistical mechanics would bridge these two extremes and would tell us how the statistics of the positions and velocities of molecules give rise to temperature and pressure, et cetera. So it's about how the statistics of microscopic properties give rise to macroscopic properties. Now we can talk about the different notions of entropy in thermodynamics and statistical mechanics. In thermodynamics, as we talked about already, entropy measures the amount of heat loss when energy is transformed to work, that is, to do useful things. This notion of entropy was first proposed by Rudolf Clausius, a German scientist who worked in the 1800's. The idea is that heat loss is a kind of disorder in the system. The system is transforming energy of one kind to energy of another kind, such as energy from calories to mechanical energy. And that's very ordered, but there's some disorder in the system, which heats up things. This theory of Clausius was specific to heat. What statistical mechanics does is generalizing this whole idea. In statistical mechanics, entropy measures something more abstract. It's the number of possible microstates that leads to a macrostate. So I'll define those terms in just a little while. But let me first point out that this more general notion was developed by the Austrian physicist Ludwig Boltzmann, who worked a little bit later than Clausius. Now in this view, the disorder of the system namely the entropy is a function of the number of possible microstates. Let's talk about what that means in a minute. But I point out this is going to be a much more general theory that applies not just to heat and not even just to physics, but to many many different fields as we'll see later on. Now we're going to take a slight sidetrack where I'll tell you what the notions of microstates and macrostates mean. To show you this I'm going to use the example of a slot machine, and you'll see the relevance of this to what we're talking about a little bit later. This slot machine has three different windows. Each one contains one of five different fruits. And when you pull the lever, you insert a coin and pull the lever, the wheel spins around and lands on a fruit, a particular fruit at random. We can say that the microstate of this machine is the specific configuration of the slot machine windows, that is the specific configuration of three fruits in this order. The microstate in this picture here is the triple cherry-lemon-apple. Another possibility would be, say, apple-pear- orange on a different pull of the lever. Now it's important for you to note that a microstate here is a triple of fruit values, not an individual fruit value. That is cherry-lemon-apple is a microstate, but cherry alone would not be a microstate. A microstate here is a description of the state of the slot machine, which fruits its windows are showing. A macrostate is a collection or set of microstates. One example would be the so-called Win macrostate, which is the collection of all microstates that have three of the same fruit showing. For example, if you've got cherry-cherry-cherry, then you'd win. That is, the slot machine would give you some money back. Another example might be lemon-lemon-lemon. Now let me pose two questions for you. First, how many microstates give rise to the Win macrostate? And the second is how many microstates give rise to the Lose macrostate? That is, the Lose macrostate is the collection of all micrstates that are not wins. These aren't exactly quiz questions since I don't expect everyone to be able to figure out the answers. But I'll ask them anyway since some of you will be able to. Let's call them challenge questions. If you can't answer them, just go to the next video where I explain how to do so.