text: Surprisals add where probabilities multiply. The surprisal for an event of probability  is defined as . If  is  then surprisal is in nats, bits, or  so that, for instance, there are  bits of surprisal for landing all "heads" on a toss of  coins.
  Best-guess states (e.g. for atoms in a gas) are inferred by maximizing the average surprisal  (entropy) for a given set of control parameters (like pressure  or volume ). This constrained entropy maximization, both classically and quantum mechanically, minimizes Gibbs availability in entropy units  where  is a constrained multiplicity or partition function.
  When temperature  is fixed, free energy () is also minimized. Thus if  and number of molecules  are constant, the Helmholtz free energy  (where  is energy and  is entropy) is minimized as a system "equilibrates." If  and  are held constant (say during processes in your body), the Gibbs free energy  is minimized instead. The change in free energy under these conditions is a measure of available work that might be done in the process. Thus available work for an ideal gas at constant temperature  and pressure  is  where  and  (see also Gibbs inequality).
  More generally the work available relative to some ambient is obtained by multiplying ambient temperature  by relative entropy or net surprisal  defined as the average value of  where  is the probability of a given state under ambient conditions. For instance, the work available in equilibrating a monatomic ideal gas to ambient values of  and  is thus , where relative entropy
  The resulting contours of constant relative entropy, shown at right for a mole of Argon at standard temperature and pressure, for example put limits on the conversion of hot to cold as in flame-powered air-conditioning or in the unpowered device to convert boiling-water to ice-water discussed here. Thus relative entropy measures thermodynamic availability in bits.