text:
# 7.1. Collections of Molecules at or Near Equilibrium

As introduced in Chapter 5, the approach one takes in studying a system composed of a very large number of molecules at or near thermal equilibrium can be quite different from how one studies systems containing a few isolated molecules. In principle, it is possible to conceive of computing the quantum energy levels and wave functions of a collection of many molecules (e.g., ten $$Na^+$$ ions, ten $$Cl^-$$ ions and 550 $$H_2O$$ molecules in a volume chosen to simulate a concentration of 1 molar $$NaCl_{(aq)}$$), but doing so becomes impractical once the number of atoms in the system reaches a few thousand or if the molecules have significant intermolecular interactions as they do in condensed-phase systems. Also, as noted in Chapter 5, following the time evolution of such a large number of molecules can be confusing if one focuses on the short-time behavior of any single molecule (e.g., one sees jerky changes in its energy, momentum, and angular momentum). By examining, instead, the long-time average behavior of each molecule or, alternatively, the average properties of a significantly large number of molecules, one is often better able to understand, interpret, and simulate such condensed-media systems. Moreover, most experiments do not probe such short-time dynamical properties of single molecules; instead, their signals report on the behavior of many molecules lying within the range of their detection device (e.g., laser beam, STM tip, or electrode). It is when one want to describe the behavior of collections of molecules under such conditions that the power of statistical mechanics comes into play.

### 7.1.1 The Distribution of Energy Among Levels

One of the most important concepts of statistical mechanics involves how a specified total amount of energy $$E$$ can be shared among a collection of molecules and within the internal (rotational, vibrational, electronic) and intermolecular (translational) degrees of freedom of these molecules when the molecules have a means for sharing or redistributing this energy (e.g., by collisions). The primary outcome of asking what is the most probable distribution of energy among a large number $$N$$ of molecules within a container of volume $$V$$ that is maintained in equilibrium by such energy-sharing at a specified temperature $$T$$ is the most important equation in statistical mechanics, the Boltzmann population formula:

$P_j = \dfrac{\Omega_j \exp(- E_j /kT)}{Q}.$

This equation expresses the probability $$P_j$$ of finding the system (which, in the case introduced above, is the whole collection of $$N$$ interacting molecules) in its $$j^{th}$$ quantum state, where $$E_j$$ is the energy of this quantum state, $$T$$ is the temperature in K, $$\Omega_j$$ is the degeneracy of the $$j^{th}$$ state, and the denominator $$Q$$ is the so-called partition function:

$Q = \sum_j \Omega_j \exp\bigg(- \dfrac{E_j}{kT}\bigg).$

The classical mechanical equivalent of the above quantum Boltzmann population formula for a system with a total of $$M$$ coordinates (collectively denoted $$q$$- they would be the internal and intermolecular coordinates of the $$N$$ molecules in the system) and $$M$$ momenta (denoted $$p$$) is:

$P(q,p) = \dfrac{ h^{-M}\exp \bigg(- \dfrac{H(q, p)}{kT}\bigg)}{Q},$

where $$H$$ is the classical Hamiltonian, $$h$$ is Planck's constant, and the classical partition function $$Q$$ is

$Q = h^{-M} \int \exp \bigg(- \dfrac{H(q, p)}{kT}\bigg) dq \;dp .$

This probability density expression, which must integrate to unity, contains the factor of $$h^{-M}$$ because, as we saw in Chapter 1 when we learned about classical action, the integral of a coordinate-momentum product has units of Planck’s constant.

Notice that the Boltzmann formula does not say that only those states of one particular energy can be populated; it gives non-zero probabilities for populating all states from the lowest to the highest. However, it does say that states of higher energy $$E_j$$ are disfavored by the $$\exp (- E_j /kT)$$ factor, but, if states of higher energy have larger degeneracies $$\Omega_j$$ (which they usually do), the overall population of such states may not be low. That is, there is a competition between state degeneracy $$\Omega_j$$, which tends to grow as the state's energy grows, and $$\exp (-E_j /kT)$$ which decreases with increasing energy. If the number of particles $$N$$ is huge, the degeneracy $$-\Omega$$ grows as a high power (let’s denote this power as $$K$$) of $$E$$ because the degeneracy is related to the number of ways the energy can be distributed among the $$N$$ molecules. In fact, $$K$$ grows at least as fast as $$N$$. As a result of $$-\Omega$$ growing as $$E^K$$, the product function $$P(E) = E^K \exp(-E/kT)$$ has the form shown in Fig.

### 7.1 (for $$K=10$$, for illustrative purposes)

Figure 7.1 Probability Weighting Factor $$P(E)$$ as a Function of $$E$$ for $$K$$ = 10.

By taking the derivative of this function $$P(E)$$ with respect to E, and finding the energy at which this derivative vanishes, one can show that this probability function has a peak at $$E^* = K kT$$, and that at this energy value,

$P(E^*) = (KkT)^K \exp(-K),$

By then asking at what energy $$E'$$ the function $$P(E)$$ drops to $$\exp(-1)$$ of this maximum value $$P(E^*)$$:

$P(E') = \exp(-1) P(E^*),$

one finds

$E' = K kT \bigg(1+ \sqrt{\dfrac{2}{K}} \bigg).$

So the width of the $$P(E)$$ graph, measured as the change in energy needed to cause $$P(E)$$ to drop to $$\exp(-1)$$ of its maximum value divided by the value of the energy at which $$P(E)$$ assumes this maximum value, is

$\dfrac{E'-E^*}{E^*} = \sqrt{\dfrac{2}{K}}.$

This width gets smaller and smaller as $$K$$ increases.

The primary conclusion is that as the number $$N$$ of molecules in the sample grows, which, as discussed earlier, causes $$K$$ to grow, the energy probability function becomes more and more sharply peaked about the most probable energy $$E^*$$. This, in turn, suggests that we may be able to model, aside from infrequent fluctuations which we may also find a way to take account of, the behavior of systems with many molecules by focusing on the most probable situation (i.e., those having the energy $$E^*$$) and ignoring or making small corrections for deviations from this case.

It is for the reasons just shown that for macroscopic systems near equilibrium, in which $$N$$ (and hence $$K$$) is extremely large (e.g., $$N$$ ~ $$10^{10}$$ to $$10^{24}$$), only the most probable distribution of the total energy among the $$N$$ molecules need be considered. This is the situation in which the equations of statistical mechanics are so useful. Certainly, there are fluctuations (as evidenced by the finite width of the above graph) in the energy content of the $$N$$-molecule system about its most probable value. However, these fluctuations become less and less important as the system size (i.e., $$N$$) becomes larger and larger.

#### 1. Basis of the Boltzmann Population Formula

To understand how this narrow Boltzmann distribution of energies arises when the number of molecules $$N$$ in the sample is large, we consider a system composed of $$M$$ identical containers, each having volume V, and each made out a material that allows for efficient heat transfer to its surroundings (e.g., through collisions of the molecules inside the volume with the walls of the container) but material that does not allow any of the $$N$$ molecules in each container to escape. These containers are arranged into a regular lattice as shown in Fig. 7.2 in a manner that allows their thermally conducting walls to come into contact. Finally, the entire collection of $$M$$ such containers is surrounded by a perfectly insulating material that assures that the total energy (of all $$N \times M$$ molecules) can not change. So, this collection of $$M$$ identical containers each containing $$N$$ molecules constitutes a closed (i.e., with no molecules coming or going) and isolated (i.e., so total energy is constant) system.

Figure 7.2 Collection of $$M$$ identical cells having energy-conducting walls that do not allow molecules to pass between cells.

#### 2. Equal a priori Probability Assumption

One of the fundamental assumptions of statistical mechanics is that, for a closed isolated system at equilibrium, all quantum states of the system having energy equal to the energy $$E$$ with which the system is prepared are equally likely to be occupied. This is called the assumption of equal a priori probability for such energy-allowed quantum states. The quantum states relevant to this case are not the states of individual molecules, nor are they the states of $$N$$ of the molecules in one of the containers of volume $$V$$. They are the quantum states of the entire system comprised of $$N\times M$$ molecules. Because our system consists of $$M$$ identical containers, each with $$N$$ molecules in it, we can describe the quantum states of the entire system in terms of the quantum states of each such container. It may seem foolish to be discussing quantum states of the large system containing $$N\times M$$ molecules, given what I said earlier about the futility in trying to find such states. However, what I am doing at this stage is to carry out a derivation that is based upon such quantum states but whose final form and final working equations will not actually require one to know or even be able to have these states in hand.

Let’s pretend that we know the quantum states that pertain to $$N$$ molecules in a container of volume $$V$$ as shown in Fig. 7.2, and let’s label these states by an index $$J$$. That is $$J=1$$ labels the lowest-energy state of $$N$$ molecules in the container of volume $$V$$, $$J=2$$ labels the second such state, and so on. As I said above, I understand it may seem daunting to think of how one actually finds these $$N$$-molecule eigenstates. However, we are just deriving a general framework that gives the probabilities of being in each such state. In so doing, we are allowed to pretend that we know these states. In any actual application, we will, of course, have to use approximate expressions for such energies.

Assuming that the walls that divide the $$M$$ containers play no role except to allow for collisional (i.e., thermal) energy transfer among the containers, an energy-labeling for states of the entire collection of $$M$$ containers can be realized by giving the number of containers that exist in each single-container J-state. This is possible because, under the assumption about the role of the walls just stated, the energy of each $$M$$-container state is a sum of the energies of the $$M$$ single-container states that comprise that $$M$$-container state. For example, if $$M= 9$$, the label 1, 1, 2, 2, 1, 3, 4, 1, 2 specifies the energy of this 9-container state in terms of the energies {$$\varepsilon_j$$} of the states of the 9 containers: $$E = 4\varepsilon_1 + 3\varepsilon_2 + \varepsilon_3 + \varepsilon_4$$. Notice that this 9-container state has the same energy as several other 9-container states; for example, 1, 2, 1, 2, 1, 3, 4, 1, 2 and 4, 1, 3, 1, 2, 2, 1, 1, 2 have the same energy although they are different individual states. What differs among these distinct states is which box occupies which single-box quantum state.

The above example illustrates that an energy level of the $$M$$-container system can have a high degree of degeneracy because its total energy can be achieved by having the various single-container states appear in various orders. That is, which container is in which state can be permuted without altering the total energy $$E$$. The formula for how many ways the $$M$$ container states can be permuted such that:

1. there are $$n_J$$ containers appearing in single-container state $$J$$, with
2. a total of $$M$$ containers, is

$\Omega(n) = \dfrac{M!}{\prod_Jn_J!}.$

Here $$n = \{n_1, n_2, n_3, \cdots n_J, \cdots \}$$ denote the number of containers existing in single-container states 1, 2, 3, … $$J$$, ….  This combinatorial formula reflects the permutational degeneracy arising from placing $$n_1$$ containers into state 1, $$n_2$$ containers into state 2, etc.

If we imagine an extremely large number of containers and we view $$M$$ as well as the {$$n_J$$} as being large numbers (n.b., we will soon see that this is the case at least for the most probable distribution that we will eventually focus on), we can ask- for what choices of the variables $$\{n_1, n_2, n_3, \cdots n_J, \cdots \}$$ is this degeneracy function $$\Omega(n)$$ a maximum? Moreover, we can examine $$\Omega(n)$$ at its maximum and compare its value at values of the {$$n$$} parameters changed only slightly from the values that maximized $$\Omega(n)$$. As we will see, $$-\Omega$$ is very strongly peaked at its maximum and decreases extremely rapidly for values of {$$n$$} that differ only slightly from the optimal values. It is this property that gives rise to the very narrow energy distribution discussed earlier in this Chapter. So, let’s take a closer look at how this energy distribution formula arises.

We want to know what values of the variables $$\{n_1, n_2, n_3, \cdots n_J, \cdots \}$$ make $$-\Omega = M!/{\Pi_Jn_J!}$$ a maximum. However, all of the $$\{n_1, n_2, n_3, \cdots n_J, \cdots \}$$ variables are not independent; they must add up to $$M$$, the total number of containers, so we have a constraint

$\sum_J n_J = M$

that the variables must obey. The {$$n_j$$} variables are also constrained to give the total energy $$E$$ of the $$M$$-container system when summed as

$\sum_J n_J\varepsilon_J = E.$

We have two problems: i. how to maximize $$-\Omega$$ and ii. how to impose these constraints. Because $$-\Omega$$ takes on values greater than unity for any choice of the {$$n_j$$}, $$-\Omega$$ will experience its maximum where $$\ln\Omega$$ has its maximum, so we can maximize $$\ln \Omega$$ if doing so helps. Because the $$n_J$$ variables are assumed to take on large numbers (when $$M$$ is large), we can use Sterling’s approximation for the natural logarithm of the factorial of a large number:

$\ln X! \approx X \ln X – X$

to approximate $$\ln \Omega$$ as follows:

$\ln \Omega \approx \ln M! - \sum_J (n_J \ln n_J – n_J).$

This expression will prove useful because we can take its derivative with respect to the $$n_J$$ variables, which we need to do to search for the maximum of $$\ln \Omega$$.

To impose the constraints $$\sum_J n_J = M$$ and $$\sum_J n_J \varepsilon_J = E$$ we use the technique of Lagrange multipliers. That is, we seek to find values of {$$n_J$$} that maximize the following function:

$F = \ln M! - \sum_J (n_J \ln n_J – n_J) - \alpha(\sum_Jn_J – M) - \beta(\sum_J n_J \varepsilon_J –E).$

Notice that this function $$F$$ is exactly equal to the $$\ln\Omega$$ function we wish to maximize whenever the {$$n_J$$} variables obey the two constraints. So, the maxima of $$F$$ and of $$\ln\Omega$$ are identical if the {$$n_J$$} have values that obey the constraints. The two Lagrange multipliers $$\alpha$$ and $$\beta$$ are introduced to allow the values of {$$n_J$$} that maximize $$F$$ to ultimately obey the two constraints. That is, we first find values of the {$$n_J$$} variables that make $$F$$ maximum; these values will depend on $$\alpha$$ and $$\beta$$ and will not necessarily obey the constraints. However, we will then choose $$\alpha$$ and $$\beta$$ to assure that the two constraints are obeyed. This is how the Lagrange multiplier method works.

#### Lagrange Multiplier Method

Taking the derivative of $$F$$ with respect to each independent $$n_K$$ variable and setting this derivative equal to zero gives:

$- \ln n_K - \alpha - \beta \varepsilon_K = 0.$

This equation can be solved to give $$n_K = \exp(- \alpha) \exp(- \beta \varepsilon_K)$$. Substituting this result into the first constraint equation gives $$M = \exp(- \alpha) \sum_J \exp(- \beta \varepsilon_J)$$, which allows us to solve for

$$\exp(- \alpha)$$ in terms of $$M$$. Doing so, and substituting the result into the expression for $$n_K$$ gives:

$n_K = M\dfrac{\exp(- \beta \varepsilon_K)}{Q}$

where

$Q = \sum_J \exp(- \beta \varepsilon_J).$

Notice that the $$n_K$$ are, as we assumed earlier, large numbers if $$M$$ is large because $$n_K$$ is proportional to $$M$$. Notice also that we now see the appearance of the partition function $$Q$$ and of exponential dependence on the energy of the state that gives the Boltzmann population of that state.

It is possible to relate the $$\beta$$ Lagrange multiplier to the total energy $$E$$ of the $$M$$ containers by summing the number of containers in the Kth quantum state $$n_K$$ multiplied by the energy of that quantum state $$\varepsilon_K$$

$E = \sum_K n_K \varepsilon_K = M\sum_K \dfrac{\varepsilon_K\exp(- \beta \varepsilon_K)}{Q}$

$= - M\left(\frac{∂\ln Q}{∂\beta} \right)_{N,V}.$

This shows that the average energy of a container, computed as the total energy $$E$$ divided by the number $$M$$ of such containers can be computed as a derivative of the logarithm of the partition function $$Q$$.  As we show in the following Section of this Chapter, all thermodynamic properties of the $$N$$ molecules in the container of volume $$V$$ can be obtained as derivatives of the natural logarithm of this $$Q$$ function. This is why the partition function plays such a central role in statistical mechanics.

To examine the range of energies over which each of the $$M$$ single-container system varies with appreciable probability, let us consider not just the degeneracy $$\Omega(n^*)$$ of that set of variables $$\{n^*\} = \{n^*_1, n^*_2, \cdots \}$$ that makes $$-\Omega$$ maximum, but also the degeneracy $$\Omega(n)$$ for values of $$\{n_1, n_2, \cdots\}$$ differing by small amounts {$$\delta n_1, \delta n_2, \cdots$$} from the optimal values {$$n^*$$}. Expanding $$\ln \Omega$$ as a Taylor series in the parameters $$\{n_1, n_2, \cdots\}$$ and evaluating the expansion in the neighborhood of the values {$$n^*$$}, we find:

$\ln \Omega = \ln \Omega({n^*_1, n^*_2, …}) + \sum_J \left(\frac{∂\ln\Omega}{∂n_J}\right) \delta n_J + \frac{1}{2} \sum_{J,K} \left(\frac{∂^2\ln\Omega}{∂n_J∂n_K}\right) \delta n_J \delta n_K + …$

We know that all of the first derivative terms ($$\dfrac{∂\ln\Omega}{∂n_J}$$) vanish because $$\ln\Omega$$ has been made maximum at {$$n^*$$}. To evaluate the second derivative terms, we first note that the first derivative of $$\ln\Omega$$ is

$\left(\frac{∂\ln\Omega}{∂n_J}\right) = \frac{∂(\ln M! - \sum_J (n_J \ln n_J – n_J))}{∂n_J} = -\ln(n_J).$

So the second derivatives needed to complete the Taylor series through second order are:

$\left(\frac{∂^2\ln\Omega}{∂n_J∂nK}\right) = - \frac{\delta_{J,K}}{n_j}.$

Using this result, we can expand $$\Omega(n)$$ in the neighborhood of {$$n^*$$} in powers of $$\delta n_J = n_J-n_J^*$$ as follows:

$\ln \Omega(n) = \ln \Omega(n^*) – \frac{1}{2} \frac{\sum_J (\delta n_J)^2}{n_J^*},$

or, equivalently,

$\Omega(n) = \Omega(n^*) \frac{\exp[-\frac{1}{2}\sum_J (\delta n_J)^2]}{n_J^*}$

This result clearly shows that the degeneracy, and hence, by the equal a priori probability hypothesis, the probability of the $$M$$-container system occupying a state having {$$n_1, n_2, \cdots$$} falls off exponentially as the variables $$n_J$$ move away from their most-probable values {$$n^*$$}.

#### 3. The Thermodynamic Limit

As we noted earlier, the $$n_J^*$$ are proportional to $$M$$ (i.e., $$n_J^* = \dfrac{M\exp(-\beta\varepsilon_J)}{Q} = f_J M$$), so when considering deviations $$\delta n_J$$ away from the optimal $$n_J^*$$, we should consider deviations that are also proportional to $$M$$: $$\delta n_J = M \delta f_J$$. In this way, we are treating deviations of specified percentage or fractional amount which we denote $$f_J$$. Thus, the ratio $$\dfrac{(\delta n_J)^2}{n_J^*}$$ that appears in the above exponential has an M-dependence that allows $$\Omega(n)$$ to be written as:

$\Omega(n) = \Omega(n^*) \exp\left[-\dfrac{M}{2}\sum_J \dfrac{(\delta f_J)^2}{f_J^*}\right],$

where $$f_J^*$$ and $$\delta f_J$$ are the fraction and fractional deviation of containers in state $$J$$: $$f_J^* = \dfrac{n_J^*}{M}$$ and $$\delta f_J = \dfrac{\delta n_J}{M}$$. The purpose of writing $$\Omega(n)$$ in this manner is to explicitly show that, in the so-called thermodynamic limit, when $$M$$ approaches infinity, only the most probable distribution of energy {$$n^*$$} need to be considered because only {$$\delta f_J=0$$} is important as $$M$$ approaches infinity.

#### 4. Fluctuations

Let’s consider this very narrow distribution issue a bit further by examining fluctuations in the energy of a single container around its average energy $$E_{\rm ave} = \dfrac{E}{M}$$. We already know that the number of containers in a given state $$K$$ can be written as $$n_K = \dfrac{M\exp(- \beta \varepsilon_K)}{Q}$$. Alternatively, we can say that the probability of a container occupying the state $$J$$ is:

$p_J = \dfrac{\exp(- \beta \varepsilon_K)}{Q}.$

Using this probability, we can compute the average energy $$E_{\rm ave}$$ as:

$E_{\rm ave} = \sum_J p_J \varepsilon_J = \dfrac{\sum_J \varepsilon_J \exp(- \beta \varepsilon_K)}{Q} = - \left(\dfrac{∂\ln Q}{∂\beta} \right)_{N,V}.$

To compute the fluctuation in energy, we first note that the fluctuation is defined as the average of the square of the deviation in energy from the average:

$(E-E_{\rm ave})^2_{\rm ave} = \sum_J (\varepsilon_J –E_{\rm ave})^2 p_J = \sum_J p_J (\varepsilon_J^2 - 2\varepsilon_J E_{\rm ave} +E_{\rm ave}^2) = \sum_J p_J(\varepsilon_J^2 – E_{\rm ave}^2).$

The following identity is now useful for further re-expressing the fluctuations:

$\left(\dfrac{∂^2\ln Q}{∂\beta^2}\right)_{N,V} = \dfrac{ ∂\left( -\sum_J\dfrac{\varepsilon_J \exp(-\beta\varepsilon_J)}{Q} \right) }{∂\beta}$

$= \sum_J \dfrac{\varepsilon_J^2\exp(-\beta\varepsilon_J)}{Q} - \left(\sum_J \dfrac{\varepsilon_J\exp(-\beta\varepsilon_J)}{Q}\right) \left(\sum_L \dfrac{\varepsilon_L\exp(-\beta\varepsilon_L)}{Q}\right)$

Recognizing the first factor immediately above as $$\sum_J \varepsilon_J^2 p_J$$, and the second factor as $$- E_{\rm ave}^2$$, and noting that $$\sum_J p_J = 1$$, allows the fluctuation formula to be rewritten as:

$(E-E_{\rm ave})^2_{\rm ave} = \left(\dfrac{∂^2\ln Q}{∂\beta^2}\right )_{N,V} = - \left(\dfrac{∂E_{\rm ave}}{∂\beta}\right)_{N,V}.$

Because the parameter $$\beta$$ can be shown to be related to the Kelvin temperature $$T$$ as $$\beta =\dfrac{1}{kT}$$, the above expression can be re-written as:

$(E-E_{\rm ave})^2_{\rm ave} = - \left(\dfrac{∂ E_{\rm ave}}{∂\beta}\right)_{N,V} = kT^2 \left(\dfrac{∂E_{\rm ave}}{∂T}\right)_{N,V}.$

Recognizing the formula for the constant-volume heat capacity

$C_V = \left(\dfrac{∂E_{\rm ave}}{∂T}\right)_{N,V}$

allows the fractional fluctuation in the energy around the mean energy $$E_{\rm ave} = \dfrac{E}{M}$$ to be expressed as:

$\dfrac{(E-E_{\rm ave})^2_{\rm ave}}{E_{\rm ave}^2} = \dfrac{kT^2 C_V}{E_{\rm ave}^2}.$

What does this fractional fluctuation formula tell us? On its left-hand side it gives a measure of the fractional spread of energies over which each of the containers ranges about its mean energy $$E_{\rm ave}$$. On the right side, it contains a ratio of two quantities that are extensive properties, the heat capacity and the mean energy. That is, both $$C_V$$ and $$E_{\rm ave}$$ will be proportional to the number $$N$$ of molecules in the container as long as $$N$$ is reasonably large. However, because the right-hand side involves $$C_V/E_{\rm ave}^2$$, it is proportional to $$N-1$$ and thus will be very small for large $$N$$ as long as $$C_V$$ does not become large. As a result, except near so-called critical points where the heat capacity does indeed become extremely large, the fractional fluctuation in the energy of a given container of $$N$$ molecules will be very small (i.e., proportional to $$N-1$$). This finding is related to the narrow distribution in energies that we discussed earlier in this section.

Let’s look at the expression

$\dfrac{(E-E_{\rm ave})^2_{\rm ave}}{E_{\rm ave}^2} = \frac{kT^2 C_V}{E_{\rm ave}^2}$

in a bit more detail for a system that is small but still contains quite a few particles-a cluster of $$N$$ Ar atoms at temperature $$T$$. If we assume that each of the Ar atoms in the cluster has $$\dfrac{3}{2} kT$$ of kinetic energy and that the potential energy holding the cluster together is small and constant (so it cancels in $$E-E_{\rm ave}$$), $$E_{\rm ave}$$ will be $$\dfrac{3}{2}NkT$$ and $$C_V$$ will be $$\dfrac{3}{2} Nk$$. So,

$\frac{(E-E_{\rm ave})^2_{\rm ave}}{E_{\rm ave}^2} = \frac{kT^2 C_V}{E_{\rm ave}^2} = kT^2 \dfrac{\dfrac{3}{2}Nk}{\bigg(\dfrac{3}{2} NkT\bigg)^2} = \frac{2}{3 N}.$

In a nano-droplet of diameter 100 Å, with each Ar atom occupying a volume of ca. $$4/3 \pi (3.8Å)^3 = 232 Å^3$$, there will be ca.

$N = \frac{4}{3} \pi \dfrac{100^3}{\dfrac{4}{3} \pi 3.83} = 1.8 \times10^4$

Ar atoms. So, the average fractional spread in the energy

$\sqrt{\frac{(E-E_{\rm ave})^2_{\rm ave}}{E_{\rm ave}^2}} = \sqrt{\frac{2}{3 N}}=0.006.$

That is, even for a very small nano-droplet, the fluctuation in the energy of the system is only a fraction of a percent (assuming $$C_V$$ is not large as near a critical point). This example shows why it is often possible to use thermodynamic concepts and equations even for very small systems, albeit realizing that fluctuations away from the most probable state are more important than in much larger systems.

### 7.1.2  Partition Functions and Thermodynamic Properties

Let us now examine how this idea of the most probable energy distribution being dominant gives rise to equations that offer molecular-level expressions for other thermodynamic properties. The first equation is the fundamental Boltzmann population formula that we already examined:

$P_j = \dfrac{\exp(- E_j /kT)}{Q},$

which expresses the probability for finding the $$N$$-molecule system in its $$J^{\rm th}$$ quantum state having energy $$E_j$$. Sometimes, this expression is written as

$P_j = \dfrac{\Omega_j \exp(- E_j /kT)}{Q}$

where now the index $$j$$ is used to label an energy level of the system having energy $$E_j$$ and degeneracy. It is important for the student to be used to either notation; a level is just a collection of those states having identical energy.

#### 1. System Partition Functions

Using this result, it is possible to compute the average energy $$E_{\rm ave}$$, sometimes written as $$\langle E \rangle$$, of the system

$\langle E \rangle = \sum_j P_j E_j ,$

and, as we saw earlier in this Chapter, to show that this quantity can be recast as

$\langle E \rangle = kT^2 \left(\frac{∂\ln Q}{∂T}\right)_{N,V} .$

To review how this proof is carried out, we substitute the expressions for $$P_j$$  and for $$Q$$ into the expression for $$\langle E \rangle$$ (I will use the notation labeling energy levels rather than energy states to allow the student to become used to this)

$\langle E \rangle = \frac{\sum_j E_j \Omega_j \exp(-E_j/kT)}{\sum_I \Omega_I\exp(-E_l/kT)}.$

By noting that $$\dfrac{∂ (\exp(-E_j/kT))}{∂T} = \dfrac{1}{kT^2} E_j \exp(-E_j/kT)$$, we can then rewrite $$\langle E \rangle$$ as

$\langle E \rangle = kT^2 \frac{\sum_j \Omega_j \dfrac{∂ (\exp(-E_j/kT))}{∂T} }{\sum_I \Omega_I\exp(-E_l/kT)}.$

And then recalling that $$\dfrac{∂X/∂T}{X} = \dfrac{∂\ln X}{∂T}$$, we finally obtain

$\langle E \rangle = kT^2 \left(\frac{∂\ln Q}{∂T}\right)_{N,V}.$

All other equilibrium properties can also be expressed in terms of the partition function $$Q$$. For example, if the average pressure $$\langle p \rangle$$ is defined as the pressure of each quantum state (defined as how the energy of that state changes if we change the volume of the container by a small amount)

$p_j = \bigg(\frac{∂E_j}{∂V}\bigg)_N$

multiplied by the probability $$P_j$$ for accessing that quantum state, summed over all such states, one can show, realizing that only $$E_j$$ (not $$T$$ or $$W$$) depend on the volume $$V$$, that

$\langle p \rangle = \sum_j \bigg(\frac{∂E_j}{∂V}\bigg)\dfrac{N \Omega_j \exp(- E_j /kT)}{Q}$

$= kT\left(\frac{∂\ln Q}{∂V}\right)_{N,T} .$

If you wonder why the energies $$E_J$$ should depend on the volume $$V$$, think of the case of $$N$$ gas-phase molecules occupying the container of volume V. You know that the translational energies of each of these $$N$$ molecules depend on the volume through the particle-in-a-box formula

$E_{n_x,n_y,n_z}=\dfrac{\hbar^2}{8mL^2}(n_x^2+n_y^2+n_z^2).$

Changing $$V$$ can be accomplished by changing the box length $$L$$. This makes it clear why the energies do indeed depend on the volume $$V$$. Of course, there are additional sources of the V-dependence of the energy levels. For example, as one shrinks $$V$$, the molecules become more crowded, so their intermolecular energies also change.

Without belaboring the point further, it is possible to express all of the usual thermodynamic quantities in terms of the partition function $$Q$$. The average energy and average pressure are given above, as is the heat capacity. The average entropy is given as

$\langle S\rangle = k \ln Q + kT \left(\frac{∂\ln Q}{∂N}\right)_{V,T}$

the Helmholtz free energy A is

$A = -kT \ln Q$

and the chemical potential $$\mu$$ is expressed as follows:

$\mu = -kT \left(\frac{∂\ln Q}{∂N}\right)_{T,V}.$

As we saw earlier, it is also possible to express fluctuations in thermodynamic properties in terms of derivatives of partition functions and, thus, as derivatives of other properties. For example, the fluctuation in the energy $$\langle (E-\langle E\rangle )^2\rangle$$ was shown above to be given by

$\langle (E-\langle E\rangle )^2\rangle = kT^2 C_V.$

The text Statistical Mechanics, D. A. McQuarrie, Harper and Row, New York (1977) has an excellent treatment of these topics and shows how all of these expressions are derived.

So, if one were able to evaluate the partition function $$Q$$ for $$N$$ molecules in a volume $$V$$ at a temperature T, either by summing the quantum-level degeneracy and $$\exp(-E_j/kT)$$ factors

$Q = \sum_j \Omega_j \exp(- E_j /kT),$

or by carrying out the phase-space integral over all $$M$$ of the coordinates and momenta of the system

$Q = h^{-M} \int \exp \bigg(- \dfrac{H(q, p)}{kT}\bigg) dq \; dp ,$

one could then use the above formulas to evaluate any thermodynamic properties and their fluctuations as derivatives of $$\ln Q$$.

The averages discussed above, derived using the probabilities $$p_J = \dfrac{\Omega_J \exp(- E_J /kT)}{Q}$$ associated with the most probable distribution, are called ensemble averages with the set of states associated with the specified values of $$N$$, $$V$$, and $$T$$ constituting what is called a canonical ensemble. Averages derived using the probabilities $$\Pi_J$$ = constant for all states associated with specified values of $$N$$, $$V$$, and $$E$$ are called ensemble averages for a microcanonical ensemble. There is another kind of ensemble that is often used in statistical mechanics; it is called the grand canonical ensemble and relates to systems with specified volume $$V$$, temperature $$T$$, and chemical potential $$\mu$$ (rather than particle number $$N$$). To obtain the partition function (from which all thermodynamic properties are obtained) in this case, one considers maximizing the same function

$\Omega(n) = \dfrac{M!}{\prod_Jn_J!}$

introduced earlier, but now considering each quantum (labeled J) as having an energy $$E_J(N,V)$$ that depends on the volume and on how may particles occupy this volume. The variables $$n_J(N)$$ are now used to specify how many of the containers introduced earlier contain $$N$$ particles and are in the $$J^{\rm th}$$ quantum state.  These variables have to obey the same two constraints as for the canonical ensemble

$\sum_J,N n_J(N) = M$

$\sum_J,N n_J(N) \varepsilon_J(N,V) =E,$

but they also are required to obey

$\sum_{J,N} N n_J(N) = N_{\rm total}$

which means that the sum adds up to the total number of particles in the isolated system’s large container that was divided into M smaller container. In this case, the walls separating each small container are assumed to allow for energy transfer (as in the canonical ensemble) and for molecules to move from one container to another (unlike the canonical ensemble). Using Lagrange multipliers as before to maximize $$\ln\Omega(n)$$ subject to the above three constraints involves maximizing

$F = \ln M!-\sum_{J,N} (n_{J,N} \ln n_{J,N} – n_{J,N}) - \alpha(\sum_{J,N} n_{J,N} – M) -\beta(\sum_{J,N} n_{J,N} \varepsilon_J –E) –\gamma(\sum_{J,N} N n_{J,N}(N) - N_{\rm total})$

and gives

$- \ln n_{K,N} - \alpha - \beta \varepsilon_K -\gamma N = 0$

or

$n_{K,N} = \exp[- \alpha - \beta \varepsilon_K -\gamma N].$

Imposing the first constraint gives

$M = \sum_{K,N}\exp[- \alpha - \beta \varepsilon_K -\gamma N],]$

or

$\exp(-\alpha)=\frac{M}{\sum_{K,N}\exp(-\beta\varepsilon_K(N)-\gamma N)}=\frac{M}{Q(\gamma,V,T)}$

where the partition function $$Q$$ is defined by the sum in the denominator. So, now the probability of the system having $$N$$ particles and being in the $$K^{\rm th}$$ quantum state is

$P_K(N)=\frac{\exp(-\beta\varepsilon_K(N)-\gamma N)}{Q}.$

Very much as was shown earlier for the canonical ensemble, one can then express thermodynamic properties (e.g., $$E$$, $$C_V$$, etc.) in terms of derivatives of $$\ln Q$$. The text Statistical Mechanics, D. A. McQuarrie, Harper and Row, New York (1977) goes through these derivations in good detail, so I will not repeat them here because we showed how to do so when treating the canonical ensemble. To summarize them briefly, one again uses $$\beta = \dfrac{1}{kT}$$, finds that g is related to the chemical potential $$\mu$$ as

$\gamma = - \mu \beta$

and obtains

$p=\sum_{N,K} P_K(N)\left(\frac{-\partial \varepsilon_K(N,V)}{\partial V}\right)_N=kT \left(\frac{-\partial Q}{\partial V}\right)_{\mu,T}$

$N_{\rm ave}=\sum_{N,K} N P_K(N)=kT \left(\frac{-\partial Q}{\partial \mu}\right)_{V,T}$

$S=kT\left(\frac{-\partial Q}{\partial T}\right)_{\mu,V}=k\ln Q$

$E=\sum_{N,K} \varepsilon_K(N)P_K(N)=kT^2 \left(\frac{-\partial Q}{\partial T}\right)_{\mu,V}$

$Q=\sum_{N,K} \exp(-\beta\varepsilon_K(N)+\mu\beta N).$

The formulas look very much like those of the canonical ensemble, except for the result expressing the average number of molecules in the container Nave in terms of the derivative of the partition function with respect to the chemical potential $$\mu$$.

In addition to the equal a priori probability postulate stated earlier (i.e., that, in the thermodynamic limit (i.e., large $$N$$), every quantum state of an isolated system in equilibrium having fixed $$N$$, $$V$$, and $$E$$ is equally probable), statistical mechanics makes another assumption. It assumes that, in the thermodynamic limit, the ensemble average (e.g., using equal probabilities $$\Pi_J$$ for all states of an isolated system having specified $$N$$, $$V$$, and $$E$$ or using $$P_j = \dfrac{\exp(- E_j /kT)}{Q}$$ for states of a system having specified $$N$$, $$V$$, and $$T$$ or using $$P_K(N)=\dfrac{\exp(-\beta\varepsilon_K(N,V)+\mu\beta N)}{Q}$$ for the grand canonical case) of any quantity is equal to the long-time average of this quantity (i.e., the value one would obtain by monitoring the dynamical evolution of this quantity over a very long time). This second postulate implies that the dynamics of an isolated system spends equal amounts of time in every quantum state that has the specified $$N$$, $$V$$, and $$E$$; this is known as the ergodic hypothesis.

Let’s consider a bit more what the physical meaning or information content of partition functions is. Canonical ensemble partition functions represent the thermal-averaged number of quantum states that are accessible to the system at specified values of $$N$$, $$V$$, and $$T$$. This can be seen best by again noting that, in the quantum expression,

$Q = \sum_j \Omega_j \exp\bigg(- \dfrac{E_j}{kT}\bigg)$

the partition function is equal to a sum of the number of quantum states in the jth  energy level multiplied by the Boltzmann population factor $$\exp(-E_j/kT)$$ of that level. So, $$Q$$ is dimensionless and is a measure of how many states the system can access at temperature $$T$$. Another way to think of $$Q$$ is suggested by rewriting the Helmholtz free energy definition given above as $$Q = \exp(-A/kT)$$. This identity shows that $$Q$$ can be viewed as the Boltzmann population, not of a given energy $$E$$, but of a specified amount of free energy $$A$$.

For the microcanonical ensemble, the probability of occupying each state that has the specified values of $$N$$, $$V$$, and $$E$$ is equal

$P_J = \dfrac{1}{\Omega(N,V, E)}$

where $$\Omega(N,V, E)$$ is the total number of such states. In the microcanonical ensemble case, $$\Omega(N,V, E)$$ plays the role that $$Q$$ plays in the canonical ensemble case; it gives the number of quantum states accessible to the system.

#### 2. Individual-Molecule Partition Functions

Keep in mind that the energy levels $$E_j$$ and degeneracies $$\Omega_j$$ and $$\Omega(N,V, E)$$ discussed so far are those of the full $$N$$-molecule system. In the special case for which the interactions among the molecules can be neglected (i.e., in the dilute ideal-gas limit) at least as far as expressing the state energies, each of the energies $$E_j$$ can be written as a sum of the energies of each individual molecule: $$E_j = \sum_{k=1}^N \varepsilon_j(k)$$. In such a case, the above partition function $$Q$$ reduces to a product of individual-molecule partition functions:

$Q = \frac{q_N}{N!}$

where the N! factor arises as a degeneracy factor having to do with the permutational indistinguishability of the $$N$$ molecules (e.g., one must not count both $$\varepsilon_j(3) + \varepsilon_k(7)$$ with molecule 3 in state $$j$$ and molecule 7 in state $$k$$ and $$\varepsilon_j(7) + \varepsilon_k(3)$$ with molecule 7 in state $$j$$ and molecule 3 in state $$k$$; they are the same state), and $$q$$ is the partition function of an individual molecule

$q = \sum_l \omega_l \exp\bigg(-\dfrac{\varepsilon_l}{kT}\bigg).$

Here, $$\varepsilon_l$$  is the energy of the lth level of the molecule and $$\omega_l$$ is its degeneracy.

The molecular partition functions $$q$$, in turn, can be written as products of translational, rotational, vibrational, and electronic partition functions if the molecular energies $$\varepsilon_l$$  can be approximated as sums of such energies. Of course, these approximations are most appropriate to gas-phase molecules whose vibration and rotation states are being described at the lowest level.

The following equations give explicit expressions for these individual contributions to $$q$$ in the most usual case of a non-linear polyatomic molecule:

#### Translational:

$q_t = \left(\frac{2\pi mkT}{\hbar^2}\right)^{\frac{3}{2}} V$

where $$\mu$$ is the mass of the molecule and $$V$$ is the volume to which its motion is constrained. For molecules constrained to a surface of area $$A$$, the corresponding result is $$q_t = (2\pi mkT/\hbar^2)^{2/2} A$$, and for molecules constrained to move along a single axis over a length $$L$$, the result is $$q_t = (2\pi mkT/\hbar^2)^{1/2} L$$. The magnitudes these partition functions can be computed, using $$\mu$$ in amu, $$T$$ in Kelvin, and $$L$$, $$A$$, or $$V$$ in cm, cm2 or cm3, as

$q_t = (3.28 \times10^{13} mT)^{\frac{1}{2},\frac{2}{2},\frac{3}{2}} L, A, V.$

Clearly, the magnitude of $$q_t$$ depends strongly on the number of dimensions the molecule and move around in. This is a result of the vast differences in translational state densities in 1, 2, and 3 dimensions; recall that we encountered these state-density issues in Chapter 2.

#### Rotational:

$q_{\rm rot} = \frac{\sqrt{\pi}}{\sigma} \sqrt{\frac{8\pi^2I_AkT}{\hbar^2} } \sqrt{\frac{8\pi^2I_BkT}{\hbar^2}} \sqrt{\frac{8\pi^2I_CkT}{\hbar^2}},$

where $$I_A$$, $$I_B$$, and $$I_C$$ are the three principal moments of inertia of the molecule (i.e., eigenvalues of the moment of inertia tensor). $$\sigma$$ is the symmetry number of the molecule defined as the number of ways the molecule can be rotated into a configuration that is indistinguishable from its original configuration. For example, $$\sigma$$ is 2 for $$H_2$$ or $$D_2$$, 1 for $$HD$$, 3 for $$NH_3$$, and 12 for $$CH_4$$. The magnitudes of these partition functions can be computed using bond lengths in Å and masses in amu and $$T$$ in $$K$$, using

$\sqrt{\frac{8\pi^2I_AkT}{\hbar^2} } = 9.75 \times10^6 \sqrt{I T}$

#### Vibrational

$q_{\rm vib} = \prod_{k=1}^{3N-6} \left\{\dfrac{\exp(-h\nu_j /2kT)}{1- \exp(-h\nu_j/kT)}\right\},$

where $$n_j$$ is the frequency of the $$j^{\rm th}$$ harmonic vibration of the molecule, of which there are $$3N-6$$. If one wants to treat the vibrations at a level higher than harmonic, this expression can be modified by replacing the harmonic energies $$h\nu_j$$ by higher-level expressions.

#### Electronic:

$q_e = \sum_J \omega_J\exp\bigg(-\dfrac{\varepsilon_J}{kT}\bigg),$

where $$\varepsilon_J$$ and $$\omega_J$$ are the energies and degeneracies of the $$J^{\rm th}$$ electronic state; the sum is carried out for those states for which the product $$\omega_J\exp\bigg(-\dfrac{\varepsilon_J}{kT}\bigg)$$ is numerically significant (i.e., levels that any significant thermal population). It is conventional to define the energy of a molecule or ion with respect to that of its atoms. So, the first term in the electronic partition function is usually written as we $$\exp(-D_e/kT)$$, where we is the degeneracy of the ground electronic state and $$D_e$$ is the energy required to dissociate the molecule into its constituent atoms, all in their ground electronic states.

Notice that the magnitude of the translational partition function is much larger than that of the rotational partition function, which, in turn, is larger than that of the vibrational function. Moreover, note that the 3-dimensional translational partition function is larger than the 2-dimensional, which is larger than the 1-dimensional. These orderings are simply reflections of the average number of quantum states that are accessible to the respective degrees of freedom at the temperature $$T$$ which, in turn, relates to the energy spacings and degeneracies of these states.

The above partition function and thermodynamic equations form the essence of how statistical mechanics provides the tools for connecting molecule-level properties such as energy levels and degeneracies, which ultimately determine the $$E_j$$ and the $$\Omega_j$$, to the macroscopic properties such as $$\langle E\rangle$$, $$\langle S\rangle$$, $$\langle p\rangle$$, $$\mu$$, etc.

If one has a system for which the quantum energy levels are not known, it may be possible to express all of the thermodynamic properties in terms of the classical partition function, if the system could be adequately described by classical dynamics.  This partition function is computed by evaluating the following classical phase-space integral (phase space is the collection of coordinates $$q$$ and conjugate momenta $$p$$ as we discussed in Chapter 1)

$Q = \frac{h^{-NM}}{N!} \int \exp \bigg(- \dfrac{H(q, p)}{kT}\bigg) dq dp.$

In this integral, one integrates over the internal (e.g., bond lengths and angles), orientational, and translational coordinates and momenta of the $$N$$ molecules. If each molecule has $$K$$ internal coordinates, 3 translational coordinates, and 3 orientational coordinates, the total number of such coordinates per molecule is $$M = K+6$$. One can then compute all thermodynamic properties of the system using this $$Q$$ in place of the quantum $$Q$$ in the equations given above for $$\langle E\rangle$$, $$\langle p\rangle$$, etc.

The classical partition functions discussed above are especially useful when substantial intermolecular interactions are present (and, thus, where knowing the quantum energy levels of the $$N$$-molecule system is highly unlikely). In such cases, the classical Hamiltonian is often written in terms of $$H^0$$ which contains all of the kinetic energy factors as well as all of the potential energies other than the intermolecular potentials, and the intermolecular potential $$U$$, which depends only on a subset of the coordinates: $$H = H^0 + U$$. For example, let us assume that $$U$$ depends only on the relative distances between molecules (i.e., on the $$3N$$ translational degrees of freedom which we denote $$r$$). Denoting all of the remaining coordinates as $$y$$, the classical partition function integral can be re-expressed as follows:

$Q = \frac{h^{-NM}}{N!} \int \exp \bigg(- \dfrac{H^0(y, p)}{kT}\bigg) dy dp \int \exp \bigg(-\dfrac{U(r)}{kT}\bigg) dr.$

The factor

$Q_{\rm ideal} = \frac{h^{-NM}}{N!} \int \exp \bigg(- \dfrac{H^0(y, p)}{kT}\bigg) dy dp V^N$

would be the partition function if the Hamiltonian $$H$$ contained no intermolecular interactions $$U$$. The $$V^N$$ factor arises from the integration over all of the translational coordinates if $$U(r)$$ is absent.  The other factor

$Q_{\rm inter} = \frac{1}{V^N} {\int \exp \bigg(-\dfrac{U(r)}{kT}\bigg) dr}$

contains all the effects of intermolecular interactions and reduces to unity if the potential $$U$$ vanishes. If, as the example considered here assumes, $$U$$ only depends on the positions of the centers of mass of the molecules (i.e., not on molecular orientations or internal geometries), the $$Q_{\rm ideal}$$  partition function can be written in terms of the molecular translational, rotational, and vibrational partition functions shown earlier:

$Q_{\rm ideal} = \frac{1}{N!} \bigg[\left(\frac{2\pi mkT}{\hbar^2}\right)^{\frac{3}{2}} V \frac{\sqrt{\pi}}{\sigma} \sqrt{\frac{8\pi^2I_AkT}{\hbar^2} } \sqrt{\frac{8\pi^2I_BkT}{\hbar^2}} \sqrt{\frac{8\pi^2I_CkT}{\hbar^2}}$

$\prod_{k=1}^{3N-6} \left\{\frac{\exp(-h\nu_j /2kT)}{1- \exp(-h\nu_j/kT)}\right\} \sum_J \omega_J\exp\left(\frac{-\varepsilon_J}{kT}\right)\bigg]^N .$

Because all of the equations that relate thermodynamic properties to partition functions contain $$\ln Q$$, all such properties will decompose into a sum of two parts, one coming from $$\ln Q_{\rm ideal}$$ and one coming from $$\ln Q_{\rm inter}$$. The latter contains all the effects of the intermolecular interactions. This means that, in this classical mechanics case, all the thermodynamic equations can be written as an ideal component plus a part that arises from the intermolecular forces. Again, the Statistical Mechanics text by McQuarrie is a good source for reading more details on these topics.

### 7.1.3. Equilibrium Constants in Terms of Partition Functions

One of the most important and useful applications of statistical thermodynamics arises in the relation giving the equilibrium constant of a chemical reaction or for a physical transformation (e.g., adsorption of molecules onto a metal surface or sublimation of molecules from a crystal) in terms of molecular partition functions. Specifically, for any chemical or physical equilibrium (e.g., the former could be the $$HF \rightleftharpoons H^+ + F^-$$ equilibrium; the latter could be $$H_2O(l) \rightleftharpoons H_2O(g)$$), one can relate the equilibrium constant (expressed in terms of numbers of molecules per unit volume or per unit area, depending on whether species undergo translational motion in 3 or 2 dimensions) in terms of the partition functions of these molecules. For example, in the hypothetical chemical equilibrium $$A + B \rightleftharpoons C$$, the equilibrium constant $$K$$ can be written, if the species can be treated as having negligibly weak intermolecular potentials, as:

$K = \dfrac{(N_C/V)}{(N_A/V) (N_B/V)} = \frac{(q_C/V)}{(q_A/V) (q_B/V)}.$

Here, $$q_J$$ is the partition function for molecules of type $$J$$ confined to volume $$V$$ at temperature $$T$$. As another example consider the isomerization reaction involving the normal (N) and zwitterionic (Z) forms of arginine that were discussed in Chapter 5. Here, the pertinent equilibrium constant would be:

$K = \frac{(N_Z/V)}{(N_N/V)} = \frac{(q_Z/V)}{(q_N/V)}.$

So, if one can evaluate the partition functions $$q$$ for reactant and product molecules in terms of the translational, electronic, vibrational, and rotational energy levels of these species, one can express the equilibrium constant in terms of these molecule-level properties.

Notice that the above equilibrium constant expressions equate ratios of species concentrations (in, numbers of molecules per unit volume) to ratios of corresponding partition functions per unit volume. Because partition functions are a count of the number of quantum states available to the system (i.e., the average density of quantum states), this means that we equate species number densities to quantum state densities when we use the above expressions for the equilibrium constant. In other words, statistical mechanics produces equilibrium constants related to numbers of molecules (i.e., number densities) not molar or molal concentrations.

### Contributors

Jack Simons (Henry Eyring Scientist and Professor of Chemistry, U. Utah) Telluride Schools on Theoretical Chemistry

Integrated by Tomoyuki Hayashi (UC Davis)


text:
How do you multiply (-3+5i)(-5+7i)?

Jan 11, 2017

$\left(- 3 + 5 i\right) \left(- 5 + 7 i\right) = - 20 - 46 i$

Explanation:

Multiplying out the brackets term by term gives:

$\left(- 3 + 5 i\right) \left(- 5 + 7 i\right)$
$\setminus \setminus \setminus \setminus \setminus = \left(- 3\right) \left(- 5\right) + \left(- 3\right) \left(7 i\right) + \left(5 i\right) \left(- 5\right) + \left(5 i\right) \left(7 i\right)$
$\setminus \setminus \setminus \setminus \setminus = 15 - 21 i - 25 i + 35 {i}^{2}$
$\setminus \setminus \setminus \setminus \setminus = 15 - 46 i + 35 {i}^{2}$
$\setminus \setminus \setminus \setminus \setminus = 15 - 46 i - 35 \text{ } \left(\because {i}^{2} = - 1\right)$
$\setminus \setminus \setminus \setminus \setminus = - 20 - 46 i$

format: plain


text:
# Expectation of independent normal distribution

I have a question attached below, and I really do't know how to solve it. Is there anyone can help me with this? $x,y\sim N(0,1)$, independent, what is $E(x\mid x+y=1)$, what about variance? What I am thinking is to calculate $P(x\mid x+y=1)$ first, $P(x\mid x+y=1)=1=P(x+y=1\mid x)\cdot P(x)/P(x+y=1)$, but I don't know how to express it...

-
I do not understand (nor agree) with the equation in the last line. Calculating $E[X| X+Y=1] = \int xP(x|x+y=1)\, dx$ from the definition of expected value will be sufficient (if you can carry out the integration). – Calvin Lin Jan 20 '13 at 16:25
I think $P(X+Y=1) = 0$ since $X$, $Y$ are continuous variables. – Patrick Li Jan 20 '13 at 17:07
What do you mean by what about variance? Which variance? – Did Jan 20 '13 at 19:48
Hello Calvin, but how to get P(x|x+y=1) if x,y∼N(0,1). This is what I am confused with. – Hello_World Jan 21 '13 at 21:18
It should be Var(x|x+y=1) – Hello_World Jan 21 '13 at 21:19

As is the case as soon as $x$ and $y$ are i.i.d., the symmetry $(x,y)\to(y,x)$ shows that $\mathbb E(x\mid x+y)=\mathbb E(y\mid x+y)=\frac12\mathbb E(x+y\mid x+y)=\frac12(x+y)$. In particular, $\mathbb E(x\mid x+y=1)=\frac12$.


text:
# Transforming SAT to Quadratic Programming in polynomial time

I would like to show that Quadratic Programming is NP-hard.

I am currently reading a couple of papers which state that QP is NP-Hard and prove it by transforming SAT to QP, however I am finding the diction quite tough since I am just a beginner in the field. Would anyone happen to know the answer to this question who can maybe explain it to me in simpler terms?

• Where should we start? Do you know anything about NP-completeness? Have you seen any examples of NP-completeness proof? – Yuval Filmus Nov 12 '13 at 9:22
• Yes I have a good background on NP-Completeness and how a problem is proven to be NP-complete. My question is more specifically about this particular reduction. I have a feeling that I have not understood QP 100% and I am missing some small thing somewhere. – lvella Nov 12 '13 at 9:30
• Can you give a reference to what Quadratic Programming is? – Raphael Nov 12 '13 at 16:53
• Raphael, by Quadratic Programming I was referring to optimising a quadratic function which is subject to several linear constraints. – lvella Nov 12 '13 at 22:04

Given a SAT instance on a set of variables $x_1,\ldots,x_n$, we define the following quadratic program: \begin{align*} & \min \sum_{i=1}^n x_i - \sum_{i=1}^n x_i^2 \\ \text{s.t.} & \\ & 0 \leq x_i \leq 1 & 1 \leq i \leq n \\ & x_{i_1} + \cdots + x_{i_j} + (1 - x_{k_1}) + \cdots + (1 - x_{k_\ell}) \geq 1 & \forall \text{ cl. } x_{i_1} \lor \cdots \lor x_{i_j} \lor \bar{x}_{k_1} \lor \cdots \lor \bar{x}_{k_l} \end{align*} The linear constraints have a $0,1$ solution if and only if the SAT instance is satisfiable. Since $0 \leq x_i \leq 1$, a solution is $0,1$ if and only if $\sum_{i=1}^n x_i - \sum_{i=1}^n x_i^2 = 0$, and for any other solution $\sum_{i=1}^n x_i - \sum_{i=1}^n x_i^2 > 0$. Therefore the SAT instance is satisfiable if and only if the minimum is $0$ (or at most $0$).
• They represent a clause. For example, the clause $x_7 \lor x_{18} \lor \bar{x}_9$ will result in the inequality $x_7 + x_{18} + (1-x_9) \geq 1$. – Yuval Filmus Nov 12 '13 at 21:37
• Will it work to convert $3SAT$ to MAXCUT or INDSET preserving number of solutions (standard text reductions look like they will preserve solution count) and utilize resulting quadratic objective? – T.... May 16 '18 at 10:49


text:
Kurs:Mathematik für Anwender (Osnabrück 2011-2012)/Teil I/Arbeitsblatt 25/en

Zur Navigation springen Zur Suche springen

Warm-up-exercises

Exercise

Compute the definite integral

${\displaystyle \int _{0}^{\sqrt {\pi }}x\sin x^{2}\,dx.}$

In the following exercises, which involve the determination of antiderivative functions, consider an appropriate domain of definition.

Exercise

Determine an antiderivative of the function

${\displaystyle \tan x.}$

Exercise

Determine an antiderivative of the function

${\displaystyle x^{n}\cdot \ln x.}$

Exercise

Determine an antiderivative of the function

${\displaystyle e^{\sqrt {x}}.}$

Exercise

Determine an antiderivative of the function

${\displaystyle {\frac {x^{3}}{\sqrt[{5}]{x^{4}+2}}}.}$

Exercise

Determine an antiderivative of the function

${\displaystyle {\frac {\sin ^{2}x}{\cos ^{2}x}}.}$

Exercise

Determine for which ${\displaystyle {}a\in \mathbb {R} }$ the function

${\displaystyle a\longmapsto \int _{-1}^{2}at^{2}-a^{2}t\,dt}$

has a maximum or a minimum.

Exercise

According to recent studies the student's attention skills during the day are described by the following function

${\displaystyle [8,18]\longrightarrow \mathbb {R} ,\,x\longmapsto f(x)=-x^{2}+25x-100.}$

Here ${\displaystyle {}x}$ is the time in hours and ${\displaystyle {}y=f(x)}$ is the attention measured in micro-credit points per second. When should one start a one and a half hour lecture, such that the total attention skills are optimal? How many micro-credit points will be added during this lecture?

Exercise

Let ${\displaystyle {}I}$ be a real interval and let

${\displaystyle f\colon I\longrightarrow \mathbb {R} }$

be a continuous function with antiderivative ${\displaystyle {}F}$. Let ${\displaystyle {}G}$ be an antiderivative of ${\displaystyle {}F}$ and let ${\displaystyle {}b,c\in \mathbb {R} }$. Determine an antiderivative of the function

${\displaystyle (bt+c)\cdot f(t).}$

Exercise

Let ${\displaystyle {}n\in \mathbb {N} _{+}}$. Determine an antiderivative of the function

${\displaystyle \mathbb {R} _{+}\longrightarrow \mathbb {R} _{+},\,x\longmapsto x^{1/n},}$

using the antiderivative of ${\displaystyle {}x^{n}}$ and Theorem 25.4.

Exercise

Determine an antiderivative of the natural logarithm function using the antiderivative of its inverse function.

Exercise

Let

${\displaystyle f\colon [a,b]\longrightarrow [c,d]}$

be a bijective, continuous differentiable function. Prove the formula for the antiderivative of the inverse function by the integral

${\displaystyle \int _{a}^{b}f^{-1}(y)dy}$

using the substitution ${\displaystyle {}y=f(x)}$ and then integration by parts.

Exercise

Compute by an appropriate substitution an antiderivative of

${\displaystyle {\sqrt {3x^{2}+5x-4}}.}$

Exercise

Compute the definite integral of the function

${\displaystyle f\colon \mathbb {R} \longrightarrow \mathbb {R} ,\,x\longmapsto f(x)=2x^{3}+3e^{x}-\sin x,}$

on ${\displaystyle {}[-1,0]}$.

Exercise

Compute the definite integral of the function

${\displaystyle f\colon \mathbb {R} _{+}\longrightarrow \mathbb {R} ,\,x\longmapsto f(x)={\sqrt {x}}-{\frac {1}{\sqrt {x}}}+{\frac {1}{2x+3}}-e^{-x},}$

on ${\displaystyle {}[1,4]}$.

Hand-in-exercises

Exercise (4 points)

Compute the definite integral ${\displaystyle {}\int _{0}^{8}f(t)\,dt}$, where the function ${\displaystyle {}f}$ is

${\displaystyle f(t)={\begin{cases}t+1,{\text{ if }}0\leq t\leq 2\,,\\t^{2}-6t+11,{\text{ if }}2

Exercise (3 points)

Determine an antiderivative of the function

${\displaystyle x^{3}\cdot \cos x-x^{2}\cdot \sin x.}$

Exercise (2 points)

Determine an antiderivative of the function

${\displaystyle \arcsin x.}$

Exercise (4 points)

Determine an antiderivative of the function

${\displaystyle \sin(\ln x).}$

Exercise (5 points)

Determine an antiderivative of the function

${\displaystyle e^{x}\cdot {\frac {x^{2}+1}{(x+1)^{2}}}.}$

Exercise (5 points)

Let ${\displaystyle {}I}$ be a real interval and let

${\displaystyle f\colon I\longrightarrow \mathbb {R} }$

be a continuous function with antiderivative ${\displaystyle {}F}$. Let ${\displaystyle {}G}$ be an antiderivative of ${\displaystyle {}F}$ and ${\displaystyle {}H}$ an antiderivative of ${\displaystyle {}G}$. Let ${\displaystyle {}a,b,c\in \mathbb {R} }$. Determine an antiderivative of the function

${\displaystyle (at^{2}+bt+c)\cdot f(t).}$


text:
Article Contents
Article Contents

# $C^\infty$ Local solutions of elliptical $2-$Hessian equation in $\mathbb{R}^3$

• In this work, we study the existence of $C^{\infty}$ local solutions to $2$-Hessian equation in $\mathbb{R}^{3}$. We consider the case that the right hand side function $f$ possibly vanishes, changes the sign, is positively or negatively defined. We also give the convexities of solutions which are related with the annulation or the sign of right-hand side function $f$. The associated linearized operator are uniformly elliptic.
Mathematics Subject Classification: Primary: 35J60; Secondary: 35J70.

 Citation:

•  [1] L. Caffarelli, L. Nirenberg and J. Spruck, Dirichlet problem for nonlinear second order elliptic equations I,Monge-Ampère equations, Comm. Pure Appl. Math., 37 (1984), 369-402.doi: 10.1002/cpa.3160370306. [2] B. Guan and J. Spruck, Locally convex hypersurfaces of constant curvature with boundary, Comm. Pure Appl. Math., 57 (2004), 1311-1331.doi: 10.1002/cpa.20010. [3] D. Gilbarg and N. S. Trudinger, Elliptic Partial Differential Equations of Second Order, Springer, 1983.doi: 10.1007/978-3-642-61798-0. [4] Q. Han, Local solutions to a class of Monge-Ampère equations of mixed type, Duke Math. J., 136 (2007), 421-474. [5] J. Hong and C. Zuily, Exitence of $C^{\infty}$ local solutions for the Monge-Ampère equation, Invent.Math., 89 (1987), 645-661.doi: 10.1007/BF01388988. [6] N. M. Ivochkina, A description of the stability cones generated by differential operators of Monge-Ampère type, English transl., Math. USSR Sbornik, 50 (1985), 259-268. [7] N. M. Ivochkina, S. I. Prokofeva and G. V. Yakunina, The Gårding cones in the modern theory of fully nonlinear second order differential equations, Journal of Mathematical Sciences, 184 (2012), 295-315.doi: 10.1007/s10958-012-0869-1. [8] C. S. Lin, The local isometric embedding in $\mathbbR^3$ of 2-dimensional Riemannian manifolds with non negative curvature, Journal of Diff. Equations, 21 (1985), 213-230. [9] C. S. Lin, The local isometric embedding in $\mathbbR^{3}$ of two dimensinal Riemannian manifolds with Gaussian curvature changing sign clearly, Comm. Pure Appl. Math., 39 (1986), 867-887.doi: 10.1002/cpa.3160390607. [10] Q. Wang and C.-J. Xu, $C^{1,1}$ solution of the Dirichlet problem for degenerate k-Hessian equations, Nonlinear Analysis, T. M. A., 104 (2014), 133-146.doi: 10.1016/j.na.2014.03.016. [11] X.-N. Ma and L. Xu, The convexity of solution of a class Hessian equation in bounded convex domain in $\mathbbR^3$, Journal of Funct. Anal., 255 (2008), 1713-1723.doi: 10.1016/j.jfa.2008.06.008. [12] X.-J. Wang, The $k$-Hessian equation, Geometric Analysis and PDEs, Lecture Notes in Mathematics, 1977 (2009), 177-252.doi: 10.1007/978-3-642-01674-5_5.


text:
# Pathfinding with inertia

I'm currently working for pathfinding for a game where units are moving, but they have inertia. Most typical pathfinding algorithms (A*, Djikastra, etc.) are simply designed to minimize the length of the path.

However, these techniques do not apply, as far as I know, to instances where the unit has inertia. If the unit has inertia, then there is a significant difference in the cost to leave a tile in a particular direction based on the direction you want to go.

For example, the cost of leaving a tile proceeding North is significantly higher if you entered the tile from the East than if you entered from the South. (In the former example, you would have to slow down to halt you East-West velocity, while in the latter, you could go straight through.)

The fact that the system has inertia means that in order to make a turn, you may have to slow down well in advance of making the turn. My best thought to date is that you calculate the additional time it would take to slow down, and then add it to the heuristic cost of moving. However, this would seem to imply that you could never add a tile to the closed list, as entering from another direction could fundamentally change the cost of moving.

In addition, the concept of using a grid is an abstraction anyway, because both position and velocity are floating-point concepts. Is there some algorithm that could handle pathfinding on an open plane with inertia better than A*, or what modifications could I make to a pre-existing algorithm to make it suitable to this kind of motion?

• Couldn't you try to find a way to give a value to the cost incurred by inertia and add it to your pathfinding algorithms? From what I recall, they are based on cost from traversing node graph, so inertia could serve as weight? – Vaillancourt Jun 9 '15 at 21:51

The only new constraint that inertia lays onto path-finding is continuity, which means no sudden breaks in velocity. Start by generating an A* path, but with a big twist. The reason A* by itself is not appropriate is because it violates continuity, so lets make a new one.

A* chooses the best path as the shortest path, but with inertia the shortest path is no longer the fastest path. The fastest path is going to be the one that gives the shortest path without breaking continuity.

Normal A* allows each iteration to "jump" to an adjacent tile starting with the lowest cost. Instead of allowing only adjacent tiles, we will allow any tile that is within our range of motion for the next turn. This means the only tiles we can choose next are the tiles that would require us to change momentum an amount the object physically can.

TLDR: We shift the choices of A* by our momentum and add that to our momentum.

• Wouldn't that mean that we could never stop travelling in the direction that we started out going in? For example, if you started accelerating left, and you continued that for several tiles, you couldn't stop in just 1 tile. You would have to continually slow down over the course of several tiles. – Stack Tracer Jun 9 '15 at 22:10
• @StackTracer If inertia is implemented then yes slow down must be continuous unless some other form of slowdown is added. – newton1212 Jun 9 '15 at 22:13

Pathfinding algorithms like A* can deal with inertia (or any other dimension you can throw at it) just fine. The key is to treat them as an additional dimension, and create a higher-dimensional search graph to search in.

To keep things simple, let's suppose we have only two speeds: slow and fast, and this path:

A --(sharp turn)-- B ----------- C --(ravine)-- D

To execute the sharp turn AB, we need to be slow; to jump the ravine, we need to be fast, and we can only change speeds on paths. Here's the resulting search graph:

(fast): A       B ----> C -----> D
\   ^
X
/   v
(slow): A ----> B ----> C        D

So you can see, the only path from A to D in this case is by A to B slow, B to C speeding up to fast, and C to D fast.

Path cost is also easy: it depends on the speed. So if we arbitrarily decide that the cost of fast-fast is 1, fast-slow or slow-fast as 2, and slow-slow as 3, the cost of A->D is 3 + 2 + 1 = 6.

The problem as you may have guessed, is that A* operates on graphs, and not on continuous ranges. That is, you need to come up with discrete speeds like I did with slow/fast, and each additional speed level will multiply the size of your search graph. The more physically demanding your game, the more speed levels you'll need, and the more costly pathfinding will be, and at worst it will be too expensive for games. If it is, then you have some other options:

• Make your AI cheat so it can fudge some paths, for example being able to make a turn even if it's going slightly too fast. This means you can get away with less speed levels in your A* search graph
• Similar to racing games, pre-calculate ideal path curves, and your AI simply navigates to the best node on that curve and continues along it


text:
Expand using Binomial Theorem.
Question:

Expand using Binomial Theorem $\left(1+\frac{x}{2}-\frac{2}{x}\right)^{4}, x \neq 0$

Solution:

Using Binomial Theorem, the given expression $\left(1+\frac{x}{2}-\frac{2}{x}\right)^{4}$ can be expanded as

$\left[\left(1+\frac{x}{2}\right)-\frac{2}{x}\right]^{4}$

$={ }^{4} \mathrm{C}_{0}\left(1+\frac{\mathrm{x}}{2}\right)^{4}-{ }^{4} \mathrm{C}_{1}\left(1+\frac{\mathrm{x}}{2}\right)^{3}\left(\frac{2}{\mathrm{x}}\right)+{ }^{4} \mathrm{C}_{2}\left(1+\frac{\mathrm{x}}{2}\right)^{2}\left(\frac{2}{\mathrm{x}}\right)^{2}-{ }^{4} \mathrm{C}_{3}\left(1+\frac{\mathrm{x}}{2}\right)\left(\frac{2}{\mathrm{x}}\right)^{3}+{ }^{4} \mathrm{C}_{4}\left(\frac{2}{\mathrm{x}}\right)^{4}$

$=\left(1+\frac{x}{2}\right)^{4}-4\left(1+\frac{x}{2}\right)^{3}\left(\frac{2}{x}\right)+6\left(1+x+\frac{x^{2}}{4}\right)\left(\frac{4}{x^{2}}\right)-4\left(1+\frac{x}{2}\right)\left(\frac{8}{x^{3}}\right)+\frac{16}{x^{4}}$

$=\left(1+\frac{x}{2}\right)^{4}-\frac{8}{x}\left(1+\frac{x}{2}\right)^{3}+\frac{24}{x^{2}}+\frac{24}{x}+6-\frac{32}{x^{3}}-\frac{16}{x^{2}}+\frac{16}{x^{4}}$

$=\left(1+\frac{x}{2}\right)^{4}-\frac{8}{x}\left(1+\frac{x}{2}\right)^{3}+\frac{8}{x^{2}}+\frac{24}{x}+6-\frac{32}{x^{3}}+\frac{16}{x^{4}}$ (1)

Again by using Binomial Theorem, we obtain

$\left(1+\frac{x}{2}\right)^{4}={ }^{4} C_{0}(1)^{4}+{ }^{4} C_{1}(1)^{3}\left(\frac{x}{2}\right)+{ }^{4} C_{2}(1)^{2}\left(\frac{x}{2}\right)^{2}+{ }^{4} C_{3}(1)^{1}\left(\frac{x}{2}\right)^{3}+{ }^{4} C_{4}\left(\frac{x}{2}\right)^{4}$

$=1+4 \times \frac{x}{2}+6 \times \frac{x^{2}}{4}+4 \times \frac{x^{3}}{8}+\frac{x^{4}}{16}$

$=1+2 x+\frac{3 x^{2}}{2}+\frac{x^{3}}{2}+\frac{x^{4}}{16}$ (2)

$\left(1+\frac{x}{2}\right)^{3}={ }^{3} C_{0}(1)^{3}+{ }^{3} C_{1}(1)^{2}\left(\frac{x}{2}\right)+{ }^{3} C_{2}(1)\left(\frac{x}{2}\right)^{2}+{ }^{3} C_{3}\left(\frac{x}{2}\right)^{3}$

$=1+\frac{3 x}{2}+\frac{3 x^{2}}{4}+\frac{x^{3}}{8}$ (3)

From (1), (2), and (3), we obtain

$\left[\left(1+\frac{x}{2}\right)-\frac{2}{x}\right]^{4}$

$=1+2 x+\frac{3 x^{2}}{2}+\frac{x^{3}}{2}+\frac{x^{4}}{16}-\frac{8}{x}\left(1+\frac{3 x}{2}+\frac{3 x^{2}}{4}+\frac{x^{3}}{8}\right)+\frac{8}{x^{2}}+\frac{24}{x}+6-\frac{32}{x^{3}}+\frac{16}{x^{4}}$

$=1+2 x+\frac{3}{2} x^{2}+\frac{x^{3}}{2}+\frac{x^{4}}{16}-\frac{8}{x}-12-6 x-x^{2}+\frac{8}{x^{2}}+\frac{24}{x}+6-\frac{32}{x^{3}}+\frac{16}{x^{4}}$

$=\frac{16}{x}+\frac{8}{x^{2}}-\frac{32}{x^{3}}+\frac{16}{x^{4}}-4 x+\frac{x^{2}}{2}+\frac{x^{3}}{2}+\frac{x^{4}}{16}-5$


text:
mersenneforum.org A Sierpinski/Riesel-like problem
 Register FAQ Search Today's Posts Mark Forums Read

2020-12-23, 19:13   #1178
sweety439

Nov 2016

2,819 Posts

Quote:
 Originally Posted by sweety439 (20543*108^3375+1)/107 is prime 3 k's for R108 are still remain ....
Still no prime found for these 3 k's, they are likely tested to n>=6000

Also see post #341 for the primes at n=1K=2K for S/R 108

 2020-12-23, 21:46 #1179 sweety439   Nov 2016 2,819 Posts We can use the sense of http://www.iakovlev.org/zip/riesel2.pdf to conclude that (k*b^n+c)/gcd(k+c,b-1) (k>=1, b>=2, c != 0, gcd(k,c) = 1, gcd(b,c) = 1) eventually should yield a prime, when it does not have primes for small n>=1 We should find the n's such that (k*b^n+c)/gcd(k+c,b-1) does not have small prime factors (and the znorder of b mod its prime factors are also not small), nor has algebra factors (i.e. k*b^n and -c are both rth powers for some r>1, or k*b^n*c is of the form 4*m^4) Last fiddled with by sweety439 on 2020-12-23 at 21:52
2020-12-27, 19:47   #1180
sweety439

Nov 2016

54038 Posts

Update pdf files for the Sierpinski/Riesel conjectures
Attached Files
 Sierpinski problems.pdf (365.2 KB, 25 views) Riesel problems.pdf (386.1 KB, 26 views)

Last fiddled with by sweety439 on 2021-02-15 at 16:00

2020-12-28, 02:00   #1181
sweety439

Nov 2016

2,819 Posts

Quote:
 Originally Posted by sweety439 Update current status file for R/S 40
Update newest status text file for R/S 40
Attached Files
 pfgw.log (15.8 KB, 65 views)

 2020-12-29, 12:11 #1182 sweety439   Nov 2016 54038 Posts Riesel base 2021 is proven!!! With CK=13, see https://github.com/xayahrainie4793/E...0to%202048.txt Code: k,n 1,67 2,1048 3,1773 4,3 5,140 6,2 7,117 8,2 9,1 10,269 11,14 12,1 Interestingly, the prime for k=2 and k=3 are both large.
 2020-12-29, 14:44 #1183 kar_bon     Mar 2006 Germany 1011010010102 Posts So you got your own definition of GCD? In the first post reads (for Riesel side): (k*b^n-1)/gcd(k-1, b-1) b=2021, k=1, n=67 (from table above) GCD for k=1 in the above formula is undefined and so (1*2021^67-1)/2020 is prime but do not correlates to your definiton of the problem and the definition of GCD.
2020-12-30, 01:27   #1184
sweety439

Nov 2016

281910 Posts

Quote:
 Originally Posted by kar_bon So you got your own definition of GCD? In the first post reads (for Riesel side): (k*b^n-1)/gcd(k-1, b-1) b=2021, k=1, n=67 (from table above) GCD for k=1 in the above formula is undefined and so (1*2021^67-1)/2020 is prime but do not correlates to your definiton of the problem and the definition of GCD.
See https://en.wikipedia.org/wiki/Greatest_common_divisor, gcd(a, 0) = |a|, for a ≠ 0, since any number is a divisor of 0, and the greatest divisor of a is |a|. This is usually used as the base case in the Euclidean algorithm. The GCD is 2020 for all k == 1 mod 2020, including k = 1

 2021-02-24, 18:20 #1185 sweety439   Nov 2016 2,819 Posts Update the status of Riesel problems to include the new primes for R2 and new test limits for R2, R6 (k=1597), R108 (k = 5351, 6528, 13162) Last fiddled with by sweety439 on 2021-02-24 at 18:31
 2021-02-24, 18:29 #1186 sweety439   Nov 2016 2,819 Posts Update the status of Sierpinski problems to include the new primes for S80 (all k except k=947), S81, S108 (k=20543) and the new test limits for S2, S80 (all k except k=947), S81, S97 Last fiddled with by sweety439 on 2021-02-24 at 18:32
2021-02-24, 18:36   #1187
sweety439

Nov 2016

B0316 Posts

Upload pdf files for these conjectures

Also listed for 2<=b<=128 and 1<=k<=128: Riesel Sierpinski
Attached Files
 Riesel problems.pdf (394.7 KB, 28 views) Sierpinski problems.pdf (365.1 KB, 36 views)

Last fiddled with by sweety439 on 2021-04-15 at 06:35

2021-02-24, 23:55   #1188
sweety439

Nov 2016

2,819 Posts
Riesel base 162

Quote:
 Originally Posted by sweety439 Code: 1,3 2,228 3,1 4,1 5,2 6,1 7,1 8,2 9,1 10,1 11,2 12,1 13,1 14,10 15,3 16,3 17,2 18,1 19,3 20,26 21,4 22,1 23,4 24,1 25,1 26,2 27,2 28,1 29,2 30,8 31,1 32,316 33,2 34,11 35,2 36,15 37,1 38,4 39,2 40,67 41,14 42,1 43,1 44,4 45,1 46,1 47,2 48,1 49,103 50,328 51,1 52,549 53,46 54,1 55,153 56,4 57,2 58,1 59,36 60,2 61,1 62,4 63,3 64,1 With CK=65 Conjecture proven
searched to n=2000, see the text file for the status, 0 if no (probable) prime found for this k

CK=3259

Only list k == 1 mod 7 and k == 1 mod 23 since other k are already in CRUS
Attached Files
 R162 status.txt (4.6 KB, 22 views)

 Similar Threads Thread Thread Starter Forum Replies Last Post sweety439 sweety439 14 2021-02-15 15:58 sweety439 sweety439 11 2020-09-23 01:42 sweety439 sweety439 20 2020-07-03 17:22 robert44444uk Conjectures 'R Us 139 2007-12-17 05:17 rogue Conjectures 'R Us 11 2007-12-17 05:08

All times are UTC. The time now is 02:16.

Mon May 10 02:16:16 UTC 2021 up 31 days, 20:57, 1 user, load averages: 1.57, 1.69, 1.80


text:
## Communications in Mathematical Analysis

### Method of rotations for bilinear singular integrals

#### Abstract

Suppose that $\Omega$ lies in the Hardy space $H^1$ of the unit circle $\mathbf S^{1}$ in $\mathbf R^2$. We use the Calderón-Zygmund method of rotations and the uniform boundedness of the bilinear Hilbert transforms to show that the bilinear singular operator with the rough kernel $\mathrm{p.v.} \, \Omega(x/|x|) |x|^{-2}$ is bounded from $L^p(\mathbf R)\times L^q(\mathbf R)$ to $L^r(\mathbf R)$, for a large set of indices satisfying $1/p+1/q=1/r$. We also provide an example of a function $\Omega$ in $L^q(\mathbf S^{ 1})$ with mean value zero to show that the singular integral operator given by convolution with $\mathrm{p.v.} \, \Omega(x/|x|) |x|^{-2}$ is not bounded from $L^{p_1}(\mathbf R)\times L^{p_2} (\mathbf R )$ to $L^{p}(\mathbf R )$ for $1/2<p<1$, $1<p_1,p_2<\infty$, $1/p_1+1/p_2=1/p$, $1\le q<\infty$, and $1/p+1/q>2.$

#### Article information

Source
Commun. Math. Anal., Conference 3 (2011), 99-107.

Dates
First available in Project Euclid: 25 February 2011

https://projecteuclid.org/euclid.cma/1298670006

Mathematical Reviews number (MathSciNet)
MR2772055

Zentralblatt MATH identifier
1214.42017

#### Citation

Diestel, Geoff; Grafakos, Loukas; Honzik, Peter; Si, Zengyan; Terwilleger, Erin. Method of rotations for bilinear singular integrals. Commun. Math. Anal. (2011), no. 3, 99--107. https://projecteuclid.org/euclid.cma/1298670006

#### References

• A. P. Calderón and A. Zygmund, On the existence of certain singular integrals. Acta Math. 88 (1952), pp 85-139.
• A. P. Calderón and A. Zygmund, On singular integrals. Amer. J. Math. 78 (1956), pp 289-309.
• M. Christ and J.-L. Rubio de Francia, Weak type $(1,1)$ bounds for rough operators II. Invent. Math. 93 (1988), pp 25-237.
• R. R. Coifman and Y. Meyer, Commutateurs d' intégrales singuliéres et opérateurs multilinéaires. Ann. Inst. Fourier (Grenoble) 28 (1978), pp 177-202.
• R. R. Coifman and Y. Meyer, On commutators of singular integrals and bilinear singular integrals. Trans. Amer. Math. Soc. 212 (1975), pp 315-331.
• R. R. Coifman and G. Weiss, Extensions of Hardy spaces and their use in analysis. Bull. Amer. Math. Soc. 83 (1977), pp 569-645.
• W. C. Connett, Singular integrals near $L^1$. Harmonic analysis in Euclidean spaces, Proc. Sympos. Pure Math. (Williams Coll., Williamstown, Mass., 1978), Amer. Math. Soc., Providence, RI, 1979, pp 163-165.
• G. Diestel, Factorization and Fourier multipliers, preprint.
• L. Grafakos, Classical Fourier Analysis. Second Edition, Graduate Texts in Math., 249, Springer, New York 2008.
• L. Grafakos and X. Li, Uniform bounds for the bilinear Hilbert transforms, I. Ann. of Math. 159 (2004), pp 889-933.
• L. Grafakos and A. Stefanov, Convolution Calderón-Zygmund singular integral operators with rough kernels. Analysis of Divergence: Control and Management of Divergent Processes, Birkhauser, Boston, Basel, Berlin 1999, pp 119-143.
• L. Grafakos and R. Torres, Multilinear Calderón-Zygmund theory. Adv. Math. 165 (2002), pp 124-164.
• C. E. Kenig and E. M. Stein, Multilinear estimates and fractional integration, Math. Res. Lett. 6(1999), pp 1-15.
• M. T. Lacey and C. M. Thiele, $L^p$ bounds for the bilinear Hilbert transform, $2<p<\infty.$ Ann. Math. 146 (1997), pp 693-724.
• M. T. Lacey and C. M. Thiele, On Calderón's conjecture. Ann. Math. 149 (1999), pp 475-496.
• X. Li, Uniform bounds for the bilinear Hilbert transforms, II. Rev. Mat. Iberoam. 22 (2006), pp 1069-1126.
• S. Lu, Y. Ding, and D. Yan, Singular Integrals and Related Topics. World Scientific, Hackensack, NJ 2007.
• F. Ricci and G. Weiss, A characterization of $H^1(\Sigma_{n-1})$. Harmonic analysis in Euclidean spaces, Proc. Sympos. Pure Math. (Williams Coll., Williamstown, Mass., 1978), Amer. Math. Soc., Providence, RI, 1979, pp 289-294.
• A. Seeger, Singular integral operators with rough convolution kernels. J. Amer. Math. Soc. 9 (1996), pp 95-105.
• A. Stefanov, Characterizations of $H^1$ and applications to singular integrals. Illinois J. Math. 44 (2000), pp 574-592.
• T. Tao, The weak-type $(1,1)$ of $L \log L$ homogeneous convolution operators. Indiana U. Math. J. 48 (1999), pp 1547-1584.


text:
# Tag Info

22

The volume filled is:

9

Here is the answer: $2=2$ $3=3$ $5=2+3$ $7=\frac{43-3}{2}-13$ $11=43-2\cdot(13+3)$ $13=13$ $17=43-13\cdot2$ $19=13+3\cdot2$ $23=43-2\cdot(13-3)$ $29=43-13-3+2$ $31=43-13+3-2$ $37=43-3\cdot2$ $41=\frac{43+3\cdot13}{2}$ $43=43$ $47=2\cdot43-3\cdot13$ $53=43+13-3$ $59=43+13+3$ ...

0

4

Is it this one? Found at this link:

1

I think it's unlikely that this is really the solution, since you could make up several similar ways of "solving" the puzzle, but maybe it's worth a try.

5

Using 3, 5, 7, 11 2 = 5 - 3 3 = 3 5 = 5 7 = 7 11 = 11 13 = 7 + 3! 17 = 11 + 3! 19 = 3 × 5 + 11 - 7 23 = 11 + 7 + 5 29 = 5!/3 - 11 31 = 11 × 3 + 5 - 7 37 = 7 × 3! - 5 41 = 5 × 3! + 11 43 = 7 × 5 + 11 - 3 47 = 5!/3 + 7 53 = 7!/5! + 11 59 = 11 × 5 + 7 - 3 61 = 11 × 5 + 3! 67 = (3+5) × 7 + 11 71 = 7 × 11 - 3! 73 = 11 × 3! + 7 79 = 11 × 7 + 5 - 3 83 = 11 × 7 ...

2

This was probably not the most exciting question. Anyway there are many solutions. Here are some examples: Interestingly one cannot add a single other bishop of any color.

19

Using 2,3,7,11: $2 = 2$ $3 = 3$ $5 = 11 + 3 - 7 -2$ $7 = 7$ $11 = 11$ $13 = 2 + 11$ $17 = 3! + 11$ $19 = 2^3 + 11$ $23 = 3 \cdot 7 + 2$ $29 = \frac{(7-2)!}{3} - 11$ $31 = 3 \cdot 11- 2$ $37 = (11-3!) \cdot 7 + 2$ $41 = 7^2 +3 - 11$ $43 = 2 \cdot 11 + 3 \cdot 7$ $47 = 3 \cdot 11 + 2 \... 9 83 is probably not allowed - I swear I'll find a legitimate solution soon... arrgh... Using 2,3,5,7:$2, 3, 5, 7 = 2, 3, 5, 711 = 7 + 5 + 2 - 313 = 7 + 5 + 3 - 217 = 7 \cdot 2 + 319 = 7 \cdot 2 + 523 = 7 \cdot 3 + 229 = 7 \cdot 5 - 3!31 = 7 \cdot 5 - 3! + 237 = 7 \cdot 5 + 241 = 7 \...

0

I believe I found a grid that requires 19 steps to solve, but I cannot prove it. The grid is The steps I found are Also I have found another grid, which may require even more steps to solve, but I am not sure how many exactly: It would be great if someone could confirm/verify my answers. Edit: these grids are not that hard after all. See comments below.

5

Since we are talking about multiplication (products grow really fast), and our data gathering is relatively cheap, it stands to reason that the best strategy is to I had this idea yesterday, but it took me this long to get through the final annoying special case. However, I'm pretty convinced now that This is going to be a longish read because of the ...

3

I believe Note that

1

Since Hehe knows his own number by watching the others, one can test the different factors that could lead to it (watched hats, with ascending sort -> possible hats Hehe could have): So we only keep some of these entries: And just consider: Hehe knows his number even before the other ones talk. This means: a-priori he knows, with no ambiguity, the number ...

8

The maximum is Reasoning

0

This gives quite a simple solution:

2

I took a slightly different approach to Jaap Scherphuis: The two smaller numbers are factors of the largest number, and all 3 numbers are different. This means that the largest number cannot be prime - ruling out 1,2,3,5,7, and leaving us with 4, 6, 8, and 9. There are 32 possible pairs of factors of the numbers 4, 6, 8, and 9, but only 8 of these ...

5

18:

1

I thought about something here : There is another answer I thought of first, and I wanted to share. And last but not least, the ultimate move :

6

This grid requires 18 steps: Explanation

3

Solution: Finding the Solution: This gets us: We now have: This gives us: Now, we have: Here we have: In conclusion:

3

Intuitively, it seems like

3

What combinations of numbers are possible? From this list of possibilities, we need to find one where one person can know what their number is by seeing two of the other numbers. Here are the possible numbers a person could see others having (lowest number first), and the possible numbers that the person could be. Now we have 3 possibilities for two ...

6

It is not possible to do this in 12 steps. In fact, a simple argument shows that at least 20 steps are necessary: Tiles 1 and 8 need to be swapped. They are however a distance of 3 moves apart, so each tile needs to be moved at least 3 times. Similarly, tiles 2 and 7 also each need 3 moves to reach their goal locations. So these 4 tiles together need at ...

2

2

Below I explain all the deductions I have been seeing until I reach the solution: Possibilities: Doubts and deductions: Description: Solution and vision of each:

15

This was trickier than it looked. I have a feeling that there should be a quicker way to find the answer than the list of cases I worked through. Note: I interpret "two of which are factors of the third" to mean that two of the numbers divide the third, and that either of those two factors might be 1.

7

Assuming that the walls replace a cell of a grid like in the 9x9 version and are not located between two cells. How I got there:

1

Looks like we have mazes we need to solve simultaneously: and These are the difficult cases, so all the other configurations (that are solvable in the first place) should be automatically solved if we can get all of these. So we need a move sequence that has Here's one: Which has Is it optimal? No idea. I'm going to need some more coffee if I'm to ...

13

I have a Here are the details: And the final UUL makes sure every path has touched the T.

5

Taking the basics of Jaap Scherphuis solution, I made some changes. "Once the robot reaches the target, the game will terminate immediately." If I understood this rule correctly, not all robots have to end up on the target square after the same number of moves. Once a robot reaches the target, he has completed the game and we don't have to care about him ...

24

My first attempt was done by hand. It used 28 commands: but this was not optimal. I have now done a computer search to find optimal solutions. It found 180 solutions of length No shorter solutions exist. I'll illustrate the following solution: To see how it works, start with a robot on every available square, and send the commands. The robots should all ...

6

12

7

Step 1 Step 2 Step 3 And the mutual sum is $86$, as required.

4

1

Here are some extra lines that should be enough to calculate the answer with very little math. The area of one of the shaded little triangles is and since there are two of them in the overlapping part, the total overlapping area is

1

11

Answer Attempt 1 At first I thought This can be achieved as follows, using the same technique as Daniel Mathias previously: Adjusting this a little, we can get After a lot more fiddling around with this, I realised it seems that Attempt 2 I then tried Attempt 3 Finally, the third option is The mistake was

12

Here's my go (click to enlarge): The pattern of reds is and the white and black patterns are so it's enough to count half the pieces only. :-)

2

Good to have a different way of answering. My logic is little bit easy: 8 $\hspace{2cm}$9$\hspace{2cm}$10$\hspace{2cm}$11$\hspace{2cm}$12 $\hspace{1cm}$0 $\hspace{2cm}$24$\hspace{2cm}$120$\hspace{2cm}$336$\hspace{2cm}$___? $\hspace{0.4cm}$$1^3-1$$\hspace{1cm}$ $3^3-3$ $\hspace{1.2cm}$ $5^3-5$ $\hspace{1cm}$ $7^3-7$ $\hspace{1.2cm}$ $9^3-9$ Next term ...

1

Somebody has already solved it, but here is the detail explanation again: 8 9 10 11 12 0 24 120 336 24 * 0 24 * 1 24 * 5 24 * 14 0 1 5 14 1 4 9 1^2 ...

5

I have to admit that I looked at hint 3, without which I would perhaps not be able to solve it in reasonable time. With hint 3 it's somehow an easy guess that Starting with the 5 euros and 10 euros, I can bound the value of the smallest note so without hesitation I immediately guess the rest are just try and try (reasonably fast, in several minutes). ...

4

9

Can this be improved?

11

This is a type of puzzle called a "cryptarithm" or an "alphametic". We have many examples of this type of puzzle under the alphametic tag.

3

This should be optimal, but haven’t proved it...

Top 50 recent answers are included


text:
# Hidden Markov models¶

A hidden Markov model (HMM) is a generative model for sequences of observations.

Graphical model for an HMM with $$T=4$$ timesteps.

An HMM assumes:

1. The observations, O, are generated by a process whose states, $$S$$, are hidden from the observer.
2. Each hidden state is a discrete random variable.
3. The hidden state at time t is independent of all hidden states before time $$t - 1$$.
4. The observation $$O_t$$ is independent of all previous states and observations given the current hidden state, $$S_t$$.

The parameters of an HMM model are:

• $$\pi$$, the prior specifying $$P(S_1)$$.
• $$\theta$$, the $$K \times K$$ transition matrix specifying $$P(S_t \mid S_{t-1})$$.
• $$\phi$$, the output model defining $$P(Y_t \mid S_t)$$. If the observations are discrete, this is a $$K \times L$$ emission matrix, where L is the number of unique observation symbols.

The HMM joint distribution of a sequence of states and observations is:

$P(S_{1:T}, O_{1:T}) = P(S_1) P(O_1 \mid S_1) \prod_{t=2}^T P(S_t \mid S_{t-1})P(O_t \mid S_t)$

where $$X_{1:T}$$ is shorthand for $$X_1, \ldots, X_T$$.

As with other latent-variable models, we use the expectation-maximization (EM) algorithm to learn the model parameters. The HMM-optimized version of the EM algorithm is known as the forward-backward / Baum-Welch algorithm.

Models

References

 [1] Ghahramani, Z. (2001). “An Intro to HMMs and Bayesian networks”. International Journal of Pattern Recognition and AI, 15(1): 9-42.


text:
5 views

A negative resistance $R_{\text {neg }}$ is connected to a passive network $N$ having driving point impedance $Z_{1}$ (s) as shown below. For $Z_{2}(s)$ to be positive real,

1. $\left|\text{R}_{\text {neg }}\right| \leq \operatorname{Re}_{1}(j \omega), \forall \omega$
2. $\left|\text{R}_{\text {neg }}\right| \leq\left|Z_{1}(j \omega)\right|, \forall \omega$
3. $\left|\text{R}_{\text {neg }}\right| \leq \operatorname{Im} Z_{1}(j \omega), \forall \omega$
4. $\left|\text{R}_{\text {neg }}\right| \leq \angle Z_{1}(j \omega), \forall \omega$


text:
# Calculating IIR Filter gain at given frequency

Let's consider an IIR filter with transfer function: $$H(z)$$.

Given the sampling frequency $$F_s$$ how can I calculate gain at say $$F$$ ?

When I was dealing with analog systems when I wanted to calculate gain at say $$F=0 Hz$$ (DC gain) I would simply put $$S=0$$ and I would find out what DC gain is.

Now I'm not sure if the same technique applies here.

My inital thought was to put $$z= e^{j2\pi}=1$$ into the equation but it won't work.

The problem boils down to finding $$|{H(z)}|$$ which I don't know how to do.

How can I approach this problem?

• You're on the right track... Set z = 1 In your case, the DC gain should be equal to 0.8 – Ben Jul 4 at 14:06
• Yes, I see that's right for 0Hz,but how would it be for 4000Hz? – Healow Jul 4 at 15:11
• set z = -1 as proposed in the answer below – Ben Jul 4 at 15:26
• w = 2*pi*f/fs = 2*pi*8000/4000 = 4*pi; e^j*4*pi = 1? I'm confused between 1 and -1 – Healow Jul 4 at 15:28
• Sorry I misundersootd, in that case z = 1 – Ben Jul 4 at 15:32

For continuous-time systems, you obtain the frequency response by evaluating the transfer function $$H(s)$$ on the imaginary axis $$s=j\omega$$ (assuming stability). In discrete-time, you get the $$\mathcal{Z}$$-transform instead of the Laplace transform, and the imaginary axis is replaced by the unit circle. So the frequency response is obtained by evaluating the transfer function $$H(z)$$ for $$z=e^{j\omega}$$. Note that for discrete-time systems, $$\omega$$ is a normalized frequency (in radians):

$$\omega=\frac{2\pi f}{f_s}\tag{1}$$

where $$f_s$$ is the sampling frequency.

Coming to you example, a frequency of $$8000$$ Hz with a sampling frequency of $$4000$$ Hz is the same as DC (Eq. $$(1)$$ should make that clear). Computing the frequency response at any frequency means to determine the desired $$\omega$$ from Eq. $$(1)$$, and then evaluate $$H(z)$$ with $$z=e^{j\omega}$$. In the case of DC ($$\omega=0$$) and Nyquist ($$\omega=\pi$$) this becomes especially easy: just evaluate $$H(1)$$ for DC, and $$H(-1)$$ for Nyquist.

For most other values of $$\omega$$, the frequency response is most likely complex-valued, so after computing $$H(e^{j\omega})$$ you just compute the magnitude of that complex number to obtain the gain at the given frequency. You don't need to find a general expression for $$|H(z)|$$.

• Ok, but when you say w=pi than it means e^j*pi which is -1? And you said it's like computing Z=1, but shouldn't it be -1? But when I compute with -1 i get gain of 0, is this correct? – Healow Jul 4 at 15:17
• @Healow: No, I said Nyquist ($\omega=\pi$) corresponds to $z=-1$ (and DC corresponds to $z=1$). Plugging values for $z$ into $H(z)$ should be easy enough, so I'll leave that up to you. A gain of zero is of course possible. – Matt L. Jul 4 at 15:29
• w = 2*pi*f/fs = 2*pi*8000/4000 = 4*pi; e^j*4*pi = 1? I'm confused between 1 and -1 – Healow Jul 4 at 15:30
• @Healow: If you read my answer, you'll see that I actually mention the fact that 8000 Hz with a sampling frequency of 4000 Hz is the same as DC, so $z=1$ is correct. – Matt L. Jul 4 at 15:32
• @Healow: No, you just evaluate $H(e^{j\omega})$ and then take the absolute value of the outcome. – Matt L. Jul 4 at 15:37


text:
# Evaluation Support¶

The function of evaluation module is to implement commonly used evaluation protocols for recommender systems. Since different models can be compared under the same evaluation modules, RecBole standardizes the evaluation of recommender systems.

## Evaluation Settings¶

The evaluation settings supported by RecBole is as following. Among them, the first four rows correspond to the dataset splitting methods, while the last two rows correspond to the ranking mechanism, namely a full ranking over all the items or a sampled-based ranking.

Notation

Explanation

RO_RS

Random Ordering + Ratio-based Splitting

TO_LS

Temporal Ordering + Leave-one-out Splitting

RO_LS

Random Ordering + Leave-one-out Splitting

TO_RS

Temporal Ordering + Ratio-based Splitting

full

full ranking with all item candidates

uniN

sample-based ranking: each positive item is paired with N sampled negative items

The parameters used to control the evaluation settings are as follows:

• eval_setting (str): The evaluation settings. Defaults to 'RO_RS,full'. The parameter has two parts. The first part control the splitting methods, range in ['RO_RS','TO_LS','RO_LS','TO_RS']. The second part(optional) control the ranking mechanism, range in ['full','uni100','uni1000'].

• group_by_user (bool): Whether the users are grouped. It must be True when eval_setting is in ['RO_LS', 'TO_LS']. Defaults to True.

• spilt_ratio (list): The split ratio between train data, valid data and test data. It only take effects when the first part of eval_setting is in ['RO_RS', 'TO_RS']. Defaults to [0.8, 0.1, 0.1].

• leave_one_num (int): It only take effects when the first part of eval_setting is in ['RO_LS', 'TO_LS']. Defaults to 2.

## Evaluation Metrics¶

RecBole supports both value-based and ranking-based evaluation metrics.

The value-based metrics (i.e., for rating prediction) include RMSE, MAE, AUC and LogLoss, measuring the prediction difference between the true and predicted values.

The ranking-based metrics (i.e., for top-k item recommendation) include the most common ranking-aware metrics, such as Recall, Precision, Hit, NDCG, MAP and MRR, measuring the ranking performance of the generated recommendation lists by an algorithm.

The parameters used to control the evaluation metrics are as follows:

• metrics (list or str): Evaluation metrics. Defaults to ['Recall', 'MRR', 'NDCG', 'Hit', 'Precision']. Range in ['Recall', 'MRR', 'NDCG', 'Hit', 'MAP', 'Precision', 'AUC', 'MAE', 'RMSE', 'LogLoss'].

• topk (list or int or None): The value of k for topk evaluation metrics. Defaults to 10.


text:
F. Symmetric Projections
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given a set of n points on the plane. A line containing the origin is called good, if projection of the given set to this line forms a symmetric multiset of points. Find the total number of good lines.

Multiset is a set where equal elements are allowed.

Multiset is called symmetric, if there is a point P on the plane such that the multiset is centrally symmetric in respect of point P.

Input

The first line contains a single integer n (1 ≤ n ≤ 2000) — the number of points in the set.

Each of the next n lines contains two integers xi and yi ( - 106  ≤  xi,  yi  ≤  106) — the coordinates of the points. It is guaranteed that no two points coincide.

Output

If there are infinitely many good lines, print -1.

Otherwise, print single integer — the number of good lines.

Examples
Input
31 22 13 3
Output
3
Input
24 31 2
Output
-1
Note

Picture to the first sample test:

In the second sample, any line containing the origin is good.