text:
## Synthesis Reactions

Synthesis reactions always yield one product. Reversing a synthesis reaction will give you a decomposition reaction.
The general form of a synthesis reaction is A + B → AB. Synthesis reactions "put things together".
 ${\displaystyle 2{\hbox{H}}_{2(g)}+{\hbox{O}}_{2(g)}\to 2{\hbox{H}}_{2}{\hbox{O}}_{(l)}}$ This is the most well-known example of a synthesis reaction—the formation of water via the fusion of hydrogen gas and oxygen gas. ${\displaystyle 2{\hbox{Na}}_{(s)}+{\hbox{Cl}}_{2(g)}\to 2{\hbox{NaCl}}_{(s)}}$ Another example of a synthesis reaction is the formation of sodium chloride (table salt).
Because of the very high reactivities of sodium metal and chlorine gas, this reaction releases a tremendous amount of heat and light energy. Recall that atoms release energy as they become stable, and consider the octet rule when determining why this reaction is so favorable.

## Decomposition Reactions

These are the opposite of synthesis reactions, with the format AB → A + B. Decomposition reactions "take things apart". Just as synthesis reactions can only form one product, decomposition reactions can only start with one reactant. Compounds that are unstable will decompose quickly without outside assistance.
 ${\displaystyle 2{\hbox{H}}_{2}{\hbox{O}}_{(l)}{\xrightarrow {electricity}}2{\hbox{H}}_{2(g)}+{\hbox{O}}_{2(g)}}$ One example is the electrolysis of water (passing water through electrical current) to form hydrogen gas and oxygen gas. ${\displaystyle 2{\hbox{H}}_{2}{\hbox{O}}_{2(l)}\to 2{\hbox{H}}_{2}{\hbox{O}}_{(l)}+{\hbox{O}}_{2(g)}}$ Hydrogen peroxide slowly decomposes into water and oxygen because it is somewhat unstable. The process is sped up by the energy from light, so hydrogen peroxide is stored in dark containers to slow down the decomposition. ${\displaystyle {\hbox{H}}_{2}{\hbox{CO}}_{3(aq)}\to {\hbox{H}}_{2}{\hbox{O}}_{(l)}+{\hbox{C}}{\hbox{O}}_{2(g)}}$ Carbonic acid is the carbonation that is dissolved in soda. It decomposes into carbon dioxide and water, which is why an opened drink will not lose its fizz.

## Single Replacement Reactions

Single replacement reactions, also called single displacement, swap one component with another, in the format AB + C → AC + B.
Adding hydrochloric acid to zinc will cause a gas to bubble out:
${\displaystyle {\hbox{Zn}}_{(s)}+2{\hbox{HCl}}_{(aq)}\to {\hbox{ZnCl}}_{2(aq)}+{\hbox{H}}_{2(g)}}$

## Double Replacement Reactions

For further information, see "Double Displacement Reaction"
In these reactions, also known as "double displacement reactions", two compounds swap components, in the format AB + CD → AD + CB

## Double Displacement Reaction

This is also called an "exchange". Here are the examples below:
1.) HCl + NaOH ----> NaCl + H2O

### Precipitation

A precipitation reaction occurs when an ionic substance comes out of solution and forms an insoluble (or slightly soluble) solid. The solid which comes out of solution is called a precipitate. This can occur when two soluble salts (ionic compounds) are mixed and form an insoluble one—the precipitate.
 ${\displaystyle {\hbox{2Pb}}({\hbox{NO}}_{3})_{2(aq)}+heat_{(aq)}\to {\hbox{2PbO}}_{(s)}+4{\hbox{NO}}_{2(aq)}+{O}_{2}}$ An example is lead nitrate mixed with potassium iodide, which forms a bright yellow precipitate of lead iodide. ${\displaystyle {\hbox{Pb}}_{(aq)}^{2+}+2{\hbox{NO}}_{3(aq)}^{-}+2{\hbox{K}}_{(aq)}^{+}+2{\hbox{I}}_{(aq)}^{-}\to {\hbox{PbI}}_{2(s)}+2{\hbox{K}}_{(aq)}^{+}+2{\hbox{NO}}_{3(aq)}^{-}}$ Note that the lead iodide is formed as a solid. The previous equation is written in molecular form, which is not the best way of describing the reaction. Each of the elements really exist in solution as individual ions, not bonded to each other (as in potassium iodide crystals). If we write the above as an ionic equation, we get a much better idea of what is actually happening. ${\displaystyle {\hbox{Pb}}_{(aq)}^{2+}+2{\hbox{I}}_{(aq)}^{-}\to {\hbox{PbI}}_{2(s)}}$ Notice the like terms on both sides of the equation. These are called spectator ionsbecause they do not participate in the reaction. They can be ignored, and the net ionic equation is written.
In the solution, there exists both lead and iodide ions. Because lead iodide is insoluble, they spontaneously crystallise and form the precipitate.

### Acid-Base Neutralization

In simple terms, an acid is a substance which can lose a H+ ion (i.e. a proton) and a base is a substance which can accept a proton. When equal amounts of an acid and base react, they neutralize each other, forming species which aren't as acidic or basic.
 ${\displaystyle {\hbox{HCl}}_{(aq)}+{\hbox{NaOH}}_{(aq)}\to {\hbox{H}}_{2}{\hbox{O}}_{(l)}+{\hbox{NaCl}}_{(aq)}}$ For example, when hydrochloric acid and sodium hydroxide react, they form water and sodium chloride (table salt). ${\displaystyle {\hbox{H}}_{(aq)}^{+}+{\hbox{OH}}_{(aq)}^{-}\to {\hbox{H}}_{2}{\hbox{O}}_{(l)}}$ Again, we get a clearer picture of what's happening if we write a net ionic equation.
Acid base reactions often happen in aqueous solution, but they can also occur in the gaseous state. Acids and bases will be discussed in much greater detail in the acids and bases section.

## Combustion

The combustion of methane (releasing heat and light)
Combustion, better known as burning, is the combination of a substance with oxygen. The products are carbon dioxide, water, and possible other waste products. Combustion reactions release large amounts of heat. C3H8, better known as propane, undergoes combustion. The balanced equation is:
${\displaystyle {\hbox{C}}_{3}{\hbox{H}}_{8}+5{\hbox{O}}_{2}\to 3{\hbox{CO}}_{2}+4{\hbox{H}}_{2}{\hbox{O}}}$
Combustion is similar to a decomposition reaction, except that oxygen and heat are required for it to occur. If there is not enough oxygen, the reaction may not occur. Sometimes, with limited oxygen, the reaction will occur, but it produces carbon monoxide (CO) or even soot. In that case, it is called incomplete combustion. If the substances being burned contain atoms other than hydrogen and oxygen, then waste products will also form. Coal is burned for heating and energy purposes, and it contains sulfur. As a result, sulfur dioxide is released, which is a pollutant. Coal with lower sulfur content is more desirable, but more expensive, because it will release less of the sulfur-based pollutants.

## Organic Reactions

This is carboxylic acid. All functional groups end with an "R"—a placeholder for the rest of the molecule.
Organic reactions occur between organic molecules (molecules containing carbon and hydrogen). Since there is a virtually unlimited number of organic molecules, the scope of organic reactions is very large. However, many of the characteristics of organic molecules are determined byfunctional groups—small groups of atoms that react in predictable ways.
Another key concept in organic reactions is Lewis basicity. Parts of organic molecules can be electrophillic (electron-loving) or nucleophillic (nucleus, or positive loving). Nucleophillic regions have an excess of electrons—they act as Lewis bases—whereas electrophillic areas are electron deficient and act as Lewis acids. The nucleophillic and electrophillic regions attract and react with each other (needless to say, this has inspired many terrible organic chemistry jokes).
Organic reactions are beyond the scope of this book, and are covered in more detail in Organic Chemistry. However, most organic substances can undergo replacement reactions and combustion reactions, as you have already learned.

## Redox

The formation of hydrogen fluoride causes fluoride to oxidize and hydrogen to reduce.
Redox is an abbreviation of reduction/oxidation reactions. This is exactly what happens in a redox reaction, one species is reducedand another is oxidized. Reduction involves a gain of electrons and oxidation involves a loss, so a redox reaction is one in which electrons are transferred between species. Reactions where something is "burnt" (burning means being oxidised) are examples of redox reactions, however, oxidation reactions also occur in solution, which is very useful and forms the basis of electrochemistry.
Redox reactions are often written as two half-reactions showing the reduction and oxidation processes separately. These half-reactions are balanced (by multiplying each by a coefficient) and added together to form the full equation. When magnesium is burnt in oxygen, it loses electrons (it is oxidised). Conversely, the oxygen gains electrons from the magnesium (it is reduced).
${\displaystyle {\begin{matrix}{\hbox{Mg}}&\to &{\hbox{Mg}}^{2+}+2e^{-}&\times 2\\{\hbox{O}}_{2}+4e^{-}&\to &2{\hbox{O}}^{2-}&\times 1\\2{\hbox{Mg}}+{\hbox{O}}_{2}+4e^{-}&\to &2{\hbox{MgO}}+4e^{-}&\ \\\end{matrix}}}$
Redox reactions will be discussed in greater detail in the redox section.

## Equations

As seen from the equation CH
4
+ 2 O
2
→ CO
2
+ 2 H
2
O
, a coefficient of 2 must be placed before the oxygen gas on the reactants side and before the water on the products side in order for, as per the law of conservation of mass, the quantity of each element does not change during the reaction
Main article: Chemical equation
Chemical equations are used to graphically illustrate chemical reactions. They consist of chemicalor structural formulas of the reactants on the left and those of the products on the right. They are separated by an arrow (→) which indicates the direction and type of the reaction; the arrow is read as the word "yields".[7] The tip of the arrow points in the direction in which the reaction proceeds. A double arrow (⇌) pointing in opposite directions is used for equilibrium reactions. Equations should be balanced according to the stoichiometry, the number of atoms of each species should be the same on both sides of the equation. This is achieved by scaling the number of involved molecules (${\displaystyle {\ce {A,B,C}}}$ and ${\displaystyle {\ce {D}}}$ in a schematic example below) by the appropriate integers a, b, c and d.[8]
${\displaystyle {\ce {{{\mathit {a}}A}+{\mathit {b}}B->{{\mathit {c}}C}+{\mathit {d}}D}}}$
More elaborate reactions are represented by reaction schemes, which in addition to starting materials and products show important intermediates or transition states. Also, some relatively minor additions to the reaction can be indicated above the reaction arrow; examples of such additions are water, heat, illumination, a catalyst, etc. Similarly, some minor products can be placed below the arrow, often with a minus sign.
Retrosynthetic analysis can be applied to design a complex synthesis reaction. Here the analysis starts from the products, for example by splitting selected chemical bonds, to arrive at plausible initial reagents. A special arrow (⇒) is used in retro reactions.[9]

## Elementary reactions

The elementary reaction is the smallest division into which a chemical reaction can be decomposed, it has no intermediate products.[10] Most experimentally observed reactions are built up from many elementary reactions that occur in parallel or sequentially. The actual sequence of the individual elementary reactions is known as reaction mechanism. An elementary reaction involves a few molecules, usually one or two, because of the low probability for several molecules to meet at a certain time.[11]

Isomerization of azobenzene, induced by light (hν) or heat (Δ)
The most important elementary reactions are unimolecular and bimolecular reactions. Only one molecule is involved in a unimolecular reaction; it is transformed by an isomerization or a dissociation into one or more other molecules. Such reactions require the addition of energy in the form of heat or light. A typical example of a unimolecular reaction is the cis–trans isomerization, in which the cis-form of a compound converts to the trans-form or vice versa.[12]
In a typical dissociation reaction, a bond in a molecule splits (ruptures) resulting in two molecular fragments. The splitting can be homolytic or heterolytic. In the first case, the bond is divided so that each product retains an electron and becomes a neutral radical. In the second case, both electrons of the chemical bond remain with one of the products, resulting in charged ions. Dissociation plays an important role in triggering chain reactions, such as hydrogen–oxygen orpolymerization reactions.
${\displaystyle {\ce {AB->{A}+{B}}}}$
Dissociation of a molecule AB into fragments A and B
For bimolecular reactions, two molecules collide and react with each other. Their merger is called chemical synthesis or an addition reaction.
${\displaystyle {\ce {{A}+{B}->AB}}}$
Another possibility is that only a portion of one molecule is transferred to the other molecule. This type of reaction occurs, for example, in redox and acid-base reactions. In redox reactions, the transferred particle is an electron, whereas in acid-base reactions it is a proton. This type of reaction is also called metathesis.
${\displaystyle {\ce {{HA}+{B}->{A}+{HB}}}}$
for example
${\displaystyle {\ce {{NaCl}+{AgNO3}->{NaNO3}+{AgCl(v)}}}}$

## Chemical equilibrium

Main article: Chemical equilibrium
Most chemical reactions are reversible, that is they can and do run in both directions. The forward and reverse reactions are competing with each other and differ in reaction rates. These rates depend on the concentration and therefore change with time of the reaction: the reverse rate gradually increases and becomes equal to the rate of the forward reaction, establishing the so-called chemical equilibrium. The time to reach equilibrium depends on such parameters as temperature, pressure and the materials involved, and is determined by the minimum free energy. In equilibrium, the Gibbs free energy must be zero. The pressure dependence can be explained with the Le Chatelier's principle. For example, an increase in pressure due to decreasing volume causes the reaction to shift to the side with the fewer moles of gas.[13]
The reaction yield stabilizes at equilibrium, but can be increased by removing the product from the reaction mixture or changed by increasing the temperature or pressure. A change in the concentrations of the reactants does not affect the equilibrium constant, but does affect the equilibrium position.

## Thermodynamics

Chemical reactions are determined by the laws of thermodynamics. Reactions can proceed by themselves if they are exergonic, that is if they release energy. The associated free energy of the reaction is composed of two different thermodynamic quantities, enthalpy and entropy:[14]
${\displaystyle \Delta G=\Delta H-T\cdot \Delta S}$.
G: free energy, H: enthalpy, T: temperature, S: entropy, Δ: difference(change between original and product)
Reactions can be exothermic, where ΔH is negative and energy is released. Typical examples of exothermic reactions are precipitation and crystallization, in which ordered solids are formed from disordered gaseous or liquid phases. In contrast, in endothermic reactions, heat is consumed from the environment. This can occur by increasing the entropy of the system, often through the formation of gaseous reaction products, which have high entropy. Since the entropy increases with temperature, many endothermic reactions preferably take place at high temperatures. On the contrary, many exothermic reactions such as crystallization occur at low temperatures. Changes in temperature can sometimes reverse the sign of the enthalpy of a reaction, as for the carbon monoxide reduction of molybdenum dioxide:
${\displaystyle {\ce {{2CO(g)}+{MoO2(s)}->{2CO2(g)}+{Mo(s)}}}}$${\displaystyle \Delta H^{o}=+21.86\ {\text{kJ at 298 K}}}$
This reaction to form carbon dioxide and molybdenum is endothermic at low temperatures, becoming less so with increasing temperature.[15] ΔH° is zero at 1855 K, and the reaction becomes exothermic above that temperature.
Changes in temperature can also reverse the direction tendency of a reaction. For example, the water gas shift reaction
${\displaystyle {\ce {{CO(g)}+{H2O({v})}<=>{CO2(g)}+{H2(g)}}}}$
is favored by low temperatures, but its reverse is favored by high temperature. The shift in reaction direction tendency occurs at 1100 K.[15]
Reactions can also be characterized by the internal energy which takes into account changes in the entropy, volume and chemical potential. The latter depends, among other things, on the activities of the involved substances.[16]
${\displaystyle {d}U=T\cdot {d}S-p\cdot {d}V+\mu \cdot {d}n}$
U: internal energy, S: entropy, p: pressure, μ: chemical potential, n: number of molecules, dsmall change sign

## Kinetics

The speed at which reactions takes place is studied by reaction kinetics. The rate depends on various parameters, such as:
• Reactant concentrations, which usually make the reaction happen at a faster rate if raised through increased collisions per unit time. Some reactions, however, have rates that are independent of reactant concentrations. These are called zero order reactions.
• Surface area available for contact between the reactants, in particular solid ones in heterogeneous systems. Larger surface areas lead to higher reaction rates.
• Pressure – increasing the pressure decreases the volume between molecules and therefore increases the frequency of collisions between the molecules.
• Activation energy, which is defined as the amount of energy required to make the reaction start and carry on spontaneously. Higher activation energy implies that the reactants need more energy to start than a reaction with a lower activation energy.
• Temperature, which hastens reactions if raised, since higher temperature increases the energy of the molecules, creating more collisions per unit time,
• The presence or absence of a catalyst. Catalysts are substances which change the pathway (mechanism) of a reaction which in turn increases the speed of a reaction by lowering the activation energy needed for the reaction to take place. A catalyst is not destroyed or changed during a reaction, so it can be used again.
• For some reactions, the presence of electromagnetic radiation, most notably ultraviolet light, is needed to promote the breaking of bonds to start the reaction. This is particularly true for reactions involving radicals.
Several theories allow calculating the reaction rates at the molecular level. This field is referred to as reaction dynamics. The rate v of a first-order reaction, which could be disintegration of a substance A, is given by:
${\displaystyle v=-{\frac {d[{\ce {A}}]}{dt}}=k\cdot [{\ce {A}}].}$
Its integration yields:
${\displaystyle {\ce {[A]}}(t)={\ce {[A]}}_{0}\cdot e^{-k\cdot t}.}$
Here k is first-order rate constant having dimension 1/time, [A](t) is concentration at a time t and [A]0 is the initial concentration. The rate of a first-order reaction depends only on the concentration and the properties of the involved substance, and the reaction itself can be described with the characteristic half-life. More than one time constant is needed when describing reactions of higher order. The temperature dependence of the rate constant usually follows the Arrhenius equation:
${\displaystyle k=k_{0}e^{{-E_{a}}/{k_{B}T}}}$
where Ea is the activation energy and kB is the Boltzmann constant. One of the simplest models of reaction rate is the collision theory. More realistic models are tailored to a specific problem and include the transition state theory, the calculation of the potential energy surface, the Marcus theory and the Rice–Ramsperger–Kassel–Marcus (RRKM) theory.[17]

## Reaction types

### Four basic types

Representation of four basic chemical reactions types: synthesis, decomposition, single replacement and double replacement.

#### Synthesis

Main article: Synthesis reaction
In a synthesis reaction, two or more simple substances combine to form a more complex substance. These reactions are in the general form:
${\displaystyle {\ce {{A}+{B}->AB}}}$
Two or more reactants yielding one product is another way to identify a synthesis reaction. One example of a synthesis reaction is the combination of iron and sulfur to form iron(II) sulfide:
${\displaystyle {\ce {{8Fe}+S8->8FeS}}}$
Another example is simple hydrogen gas combined with simple oxygen gas to produce a more complex substance, such as water.[18]

#### Decomposition

Main article: Decomposition reaction
A decomposition reaction is when a more complex substance breaks down into its more simple parts. It is thus the opposite of a synthesis reaction, and can be written as[18][19]
${\displaystyle {\ce {AB->{A}+{B}}}}$
One example of a decomposition reaction is the electrolysis of water to make oxygen and hydrogen gas:
${\displaystyle {\ce {2H2O->{2H2}+{O2}}}}$

#### Single replacement

In a single replacement reaction, a single uncombined element replaces another in a compound; in other words, one element trades places with another element in a compound[18] These reactions come in the general form of:
${\displaystyle {\ce {{A}+{BC}->{AC}+{B}}}}$
One example of a single displacement reaction is when magnesium replaces hydrogen in water to make magnesium hydroxide and hydrogen gas:
${\displaystyle {\ce {{Mg}+{2H2O}->{Mg(OH)2}+{H2\uparrow }}}}$

#### Double replacement

In a double replacement reaction, the anions and cations of two compounds switch places and form two entirely different compounds.[18] These reactions are in the general form:[19]
${\displaystyle {\ce {{AB}+{CD}->{AD}+{CB}}}}$
For example, when barium chloride (BaCl2) and magnesium sulfate (MgSO4) react, the SO42− anion switches places with the 2Cl anion, giving the compounds BaSO4 and MgCl2.
Another example of a double displacement reaction is the reaction of lead(II) nitrate with potassium iodide to form lead(II) iodide and potassium nitrate:
${\displaystyle {\ce {{Pb(NO3)2}+2KI->PbI2(v)+2KNO3}}}$

### Oxidation and reduction

Illustration of a redox reaction

Sodium chloride is formed through the redox reaction of sodium metal and chlorine gas
Redox reactions can be understood in terms of transfer of electrons from one involved species (reducing agent) to another (oxidizing agent). In this process, the former species is oxidized and the latter is reduced. Though sufficient for many purposes, these descriptions are not precisely correct. Oxidation is better defined as an increase in oxidation state, and reduction as a decrease in oxidation state. In practice, the transfer of electrons will always change the oxidation state, but there are many reactions that are classed as "redox" even though no electron transfer occurs (such as those involving covalent bonds).[20][21]
In the following redox reaction, hazardous sodium metal reacts with toxic chlorine gas to form the ionic compound sodium chloride, or common table salt:
${\displaystyle {\ce {{2Na(s)}+{Cl2(g)}->2NaCl(s)}}}$
In the reaction, sodium metal goes from an oxidation state of 0 (as it is a pure element) to +1: in other words, the sodium lost one electron and is said to have been oxidized. On the other hand, the chlorine gas goes from an oxidation of 0 (it is also a pure element) to −1: the chlorine gains one electron and is said to have been reduced. Because the chlorine is the one reduced, it is considered the electron acceptor, or in other words, induces oxidation in the sodium – thus the chlorine gas is considered the oxidizing agent. Conversely, the sodium is oxidized or is the electron donor, and thus induces reduction in the other species and is considered the reducing agent.
Which of the involved reactants would be reducing or oxidizing agent can be predicted from the electronegativity of their elements. Elements with low electronegativity, such as most metals, easily donate electrons and oxidize – they are reducing agents. On the contrary, many ions with high oxidation numbers, such as H
2
O
2
MnO
4
CrO
3
Cr
2
O2−
7
OsO
4
can gain one or two extra electrons and are strong oxidizing agents.
The number of electrons donated or accepted in a redox reaction can be predicted from the electron configuration of the reactant element. Elements try to reach the low-energy noble gas configuration, and therefore alkali metals and halogens will donate and accept one electron respectively. Noble gases themselves are chemically inactive.[22]
An important class of redox reactions are the electrochemical reactions, where electrons from the power supply are used as the reducing agent. These reactions are particularly important for the production of chemical elements, such as chlorine[23] or aluminium. The reverse process in which electrons are released in redox reactions and can be used as electrical energy is possible and used in batteries.

### Complexation

Ferrocene – an iron atom sandwiched between two C5H5 ligands
In complexation reactions, several ligands react with a metal atom to form a coordination complex. This is achieved by providing lone pairs of the ligand into empty orbitals of the metal atom and forming dipolar bonds. The ligands are Lewis bases, they can be both ions and neutral molecules, such as carbon monoxide, ammonia or water. The number of ligands that react with a central metal atom can be found using the 18-electron rule, saying that the valence shells of a transition metal will collectively accommodate 18 electrons, whereas the symmetry of the resulting complex can be predicted with the crystal field theory and ligand field theory. Complexation reactions also include ligand exchange, in which one or more ligands are replaced by another, and redox processes which change the oxidation state of the central metal atom.[24]

### Acid-base reactions

In the Brønsted–Lowry acid–base theory, an acid-base reaction involves a transfer of protons (H+) from one species (the acid) to another (thebase). When a proton is removed from an acid, the resulting species is termed that acid's conjugate base. When the proton is accepted by a base, the resulting species is termed that base's conjugate acid.[25] In other words, acids act as proton donors and bases act as proton acceptors according to the following equation:
${\displaystyle {\ce {\underbrace {HA} _{acid}+\underbrace {B} _{base}<=>\underbrace {A^{-}} _{conjugated\ base}+\underbrace {HB+} _{conjugated\ acid}}}}$
The reverse reaction is possible, and thus the acid/base and conjugated base/acid are always in equilibrium. The equilibrium is determined by the acid and base dissociation constants (Ka and Kb) of the involved substances. A special case of the acid-base reaction is the neutralization where an acid and a base, taken at exactly same amounts, form a neutral salt.
Acid-base reactions can have different definitions depending on the acid-base concept employed. Some of the most common are:
• Arrhenius definition: Acids dissociate in water releasing H3O+ ions; bases dissociate in water releasing OH ions.
• Brønsted-Lowry definition: Acids are proton (H+) donors, bases are proton acceptors; this includes the Arrhenius definition.
• Lewis definition: Acids are electron-pair acceptors, bases are electron-pair donors; this includes the Brønsted-Lowry definition.

### Precipitation

Precipitation
Precipitation is the formation of a solid in a solution or inside another solid during a chemical reaction. It usually takes place when the concentration of dissolved ions exceeds the solubility limit[26] and forms an insoluble salt. This process can be assisted by adding a precipitating agent or by removal of the solvent. Rapid precipitation results in an amorphous or microcrystalline residue and slow process can yield single crystals. The latter can also be obtained by recrystallization from microcrystalline salts.[27]

### Solid-state reactions

Reactions can take place between two solids. However, because of the relatively small diffusion rates in solids, the corresponding chemical reactions are very slow in comparison to liquid and gas phase reactions. They are accelerated by increasing the reaction temperature and finely dividing the reactant to increase the contacting surface area.[28]

### Reactions at the solid|gas interface

Reaction can take place at the solid|gas interface, surfaces at very low pressure such as ultra-high vacuum. Via scanning tunneling microscopy, it is possible to observe reactions at the solid|gas interface in real space, if the time scale of the reaction is in the correct range.[29][30] Reactions at the solid|gas interface are in some cases related to catalysis.

### Photochemical reactions

In this Paterno–Büchi reaction, a photoexcited carbonyl group is added to an unexcited olefin, yielding anoxetane.
In photochemical reactions, atoms and molecules absorb energy (photons) of the illumination light and convert into an excited state. They can then release this energy by breaking chemical bonds, thereby producing radicals. Photochemical reactions include hydrogen–oxygen reactions, radical polymerizationchain reactions and rearrangement reactions.[31]
Many important processes involve photochemistry. The premier example is photosynthesis, in which most plants use solar energy to convert carbon dioxide and water into glucose, disposing of oxygen as a side-product. Humans rely on photochemistry for the formation of vitamin D, and vision is initiated by a photochemical reaction of rhodopsin.[12] In fireflies, an enzyme in the abdomen catalyzes a reaction that results in bioluminescence.[32] Many significant photochemical reactions, such as ozone formation, occur in the Earth atmosphere and constitute atmospheric chemistry.

## Catalysis

Main article: Catalysis
Further information: Reaction Progress Kinetic Analysis

Schematic potential energy diagram showing the effect of a catalyst in an endothermic chemical reaction. The presence of a catalyst opens a different reaction pathway (in red) with a lower activation energy. The final result and the overall thermodynamics are the same.

Solid heterogeneous catalysts are plated on meshes in ceramic catalytic converters in order to maximize their surface area. This exhaust converter is from a Peugeot 106 S2 1100
In catalysis, the reaction does not proceed directly, but through reaction with a third substance known as catalyst. Although the catalyst takes part in the reaction, it is returned to its original state by the end of the reaction and so is not consumed. However, it can be inhibited, deactivated or destroyed by secondary processes. Catalysts can be used in a different phase (heterogeneous) or in the same phase (homogeneous) as the reactants. In heterogeneous catalysis, typical secondary processes include coking where the catalyst becomes covered by polymeric side products. Additionally, heterogeneous catalysts can dissolve into the solution in a solid–liquid system or evaporate in a solid–gas system. Catalysts can only speed up the reaction – chemicals that slow down the reaction are called inhibitors.[33][34] Substances that increase the activity of catalysts are called promoters, and substances that deactivate catalysts are called catalytic poisons. With a catalyst, a reaction which is kinetically inhibited by a high activation energy can take place in circumvention of this activation energy.
Heterogeneous catalysts are usually solids, powdered in order to maximize their surface area. Of particular importance in heterogeneous catalysis are the platinum group metals and other transition metals, which are used in hydrogenationscatalytic reforming and in the synthesis of commodity chemicals such as nitric acid and ammonia. Acids are an example of a homogeneous catalyst, they increase the nucleophilicity of carbonyls, allowing a reaction that would not otherwise proceed with electrophiles. The advantage of homogeneous catalysts is the ease of mixing them with the reactants, but they may also be difficult to separate from the products. Therefore, heterogeneous catalysts are preferred in many industrial processes.[35]

## Reactions in organic chemistry

Main article: Organic reaction
In organic chemistry, in addition to oxidation, reduction or acid-base reactions, a number of other reactions can take place which involvecovalent bonds between carbon atoms or carbon and heteroatoms (such as oxygen, nitrogen, halogens, etc.). Many specific reactions in organic chemistry are name reactions designated after their discoverers.

### Substitution

In a substitution reaction, a functional group in a particular chemical compound is replaced by another group.[36] These reactions can be distinguished by the type of substituting species into a nucleophilicelectrophilic or radical substitution.
SN1 mechanism
SN2 mechanism
In the first type, a nucleophile, an atom or molecule with an excess of electrons and thus a negative charge or partial charge, replaces another atom or part of the "substrate" molecule. The electron pair from the nucleophile attacks the substrate forming a new bond, while the leaving group departs with an electron pair. The nucleophile may be electrically neutral or negatively charged, whereas the substrate is typically neutral or positively charged. Examples of nucleophiles are hydroxide ion,alkoxidesamines and halides. This type of reaction is found mainly in aliphatic hydrocarbons, and rarely in aromatic hydrocarbon. The latter have high electron density and enter nucleophilic aromatic substitution only with very strongelectron withdrawing groups. Nucleophilic substitution can take place by two different mechanisms, SN1 and SN2. In their names, S stands for substitution, N for nucleophilic, and the number represents the kinetic order of the reaction, unimolecular or bimolecular.[37]
The three steps of anSN2 reaction. The nucleophile is green and the leaving group is red
SN2 reaction causes stereo inversion (Walden inversion)
The SN1 reaction proceeds in two steps. First, the leaving group is eliminated creating a carbocation. This is followed by a rapid reaction with the nucleophile.[38]
In the SN2 mechanism, the nucleophile forms a transition state with the attacked molecule, and only then the leaving group is cleaved. These two mechanisms differ in the stereochemistry of the products. SN1 leads to the non-stereospecific addition and does not result in a chiral center, but rather in a set of geometric isomers (cis/trans). In contrast, a reversal (Walden inversion) of the previously existing stereochemistry is observed in the SN2 mechanism.[39]
Electrophilic substitution is the counterpart of the nucleophilic substitution in that the attacking atom or molecule, an electrophile, has low electron density and thus a positive charge. Typical electrophiles are the carbon atom of carbonyl groups, carbocations or sulfur or nitronium cations. This reaction takes place almost exclusively in aromatic hydrocarbons, where it is called electrophilic aromatic substitution. The electrophile attack results in the so-called σ-complex, a transition state in which the aromatic system is abolished. Then, the leaving group, usually a proton, is split off and the aromaticity is restored. An alternative to aromatic substitution is electrophilic aliphatic substitution. It is similar to the nucleophilic aliphatic substitution and also has two major types, SE1 and SE2[40]
Mechanism of electrophilic aromatic substitution
In the third type of substitution reaction, radical substitution, the attacking particle is a radical.[36] This process usually takes the form of a chain reaction, for example in the reaction of alkanes with halogens. In the first step, light or heat disintegrates the halogen-containing molecules producing the radicals. Then the reaction proceeds as an avalanche until two radicals meet and recombine.[41]
${\displaystyle {\ce {{X.}+{R-H}->{X-H}+{R.}}}}$
${\displaystyle {\ce {{R.}+{X2}->{R{-}X}+{X.}}}}$
Reactions during the chain reaction of radical substitution

The addition and its counterpart, the elimination, are reactions which change the number of substitutents on the carbon atom, and form or cleave multiple bondsDouble andtriple bonds can be produced by eliminating a suitable leaving group. Similar to the nucleophilic substitution, there are several possible reaction mechanisms which are named after the respective reaction order. In the E1 mechanism, the leaving group is ejected first, forming a carbocation. The next step, formation of the double bond, takes place with elimination of a proton (deprotonation). The leaving order is reversed in the E1cb mechanism, that is the proton is split off first. This mechanism requires participation of a base.[42] Because of the similar conditions, both reactions in the E1 or E1cb elimination always compete with the SN1 substitution.[43]
E1 elimination
E1cb elimination

E2 elimination
The E2 mechanism also requires a base, but there the attack of the base and the elimination of the leaving group proceed simultaneously and produce no ionic intermediate. In contrast to the E1 eliminations, different stereochemical configurations are possible for the reaction product in the E2 mechanism, because the attack of the base preferentially occurs in the anti-position with respect to the leaving group. Because of the similar conditions and reagents, the E2 elimination is always in competition with the SN2-substitution.[44]

The counterpart of elimination is the addition where double or triple bonds are converted into single bonds. Similar to the substitution reactions, there are several types of additions distinguished by the type of the attacking particle. For example, in the electrophilic addition of hydrogen bromide, an electrophile (proton) attacks the double bond forming a carbocation, which then reacts with the nucleophile (bromine). The carbocation can be formed on either side of the double bond depending on the groups attached to its ends, and the preferred configuration can be predicted with the Markovnikov's rule.[45] This rule states that "In the heterolytic addition of a polar molecule to an alkene or alkyne, the more electronegative (nucleophilic) atom (or part) of the polar molecule becomes attached to the carbon atom bearing the smaller number of hydrogen atoms."[46]
If the addition of a functional group takes place at the less substituted carbon atom of the double bond, then the electrophilic substitution with acids is not possible. In this case, one has to use the hydroboration–oxidation reaction, where in the first step, the boron atom acts as electrophile and adds to the less substituted carbon atom. At the second step, the nucleophilic hydroperoxide or halogen anion attacks the boron atom.[47]
While the addition to the electron-rich alkenes and alkynes is mainly electrophilic, the nucleophilic addition plays an important role for the carbon-heteroatom multiple bonds, and especially its most important representative, the carbonyl group. This process is often associated with an elimination, so that after the reaction the carbonyl group is present again. It is therefore called addition-elimination reaction and may occur in carboxylic acid derivatives such as chlorides, esters or anhydrides. This reaction is often catalyzed by acids or bases, where the acids increase by the electrophilicity of the carbonyl group by binding to the oxygen atom, whereas the bases enhance the nucleophilicity of the attacking nucleophile.[48]

Nucleophilic addition of a carbanion or another nucleophile to the double bond of an alpha, beta unsaturated carbonyl compound can proceed via the Michael reaction, which belongs to the larger class of conjugate additions. This is one of the most useful methods for the mild formation of C–C bonds.[49][50][51]
Some additions which can not be executed with nucleophiles and electrophiles, can be succeeded with free radicals. As with the free-radical substitution, the radical additionproceeds as a chain reaction, and such reactions are the basis of the free-radical polymerization.[52]

### Other organic reaction mechanisms

Mechanism of a Diels-Alder reaction
Orbital overlap in a Diels-Alder reaction
In a rearrangement reaction, the carbon skeleton of a molecule is rearranged to give astructural isomer of the original molecule. These include hydride shift reactions such as theWagner-Meerwein rearrangement, where a hydrogenalkyl or aryl group migrates from one carbon to a neighboring carbon. Most rearrangements are associated with the breaking and formation of new carbon-carbon bonds. Other examples are sigmatropic reaction such as theCope rearrangement.[53]
Cyclic rearrangements include cycloadditions and, more generally, pericyclic reactions, wherein two or more double bond-containing molecules form a cyclic molecule. An important example of cycloaddition reaction is the Diels–Alder reaction (the so-called [4+2] cycloaddition) between a conjugated diene and a substituted alkene to form a substituted cyclohexene system.[54]
Whether a certain cycloaddition would proceed depends on the electronic orbitals of the participating species, as only orbitals with the same sign of wave function will overlap and interact constructively to form new bonds. Cycloaddition is usually assisted by light or heat. These perturbations result in different arrangement of electrons in the excited state of the involved molecules and therefore in different effects. For example, the [4+2] Diels-Alder reactions can be assisted by heat whereas the [2+2] cycloaddition is selectively induced by light.[55] Because of the orbital character, the potential for developing stereoisomeric products upon cycloaddition is limited, as described by the Woodward–Hoffmann rules.[56]

## Biochemical reactions

Illustration of the induced fit model of enzyme activity
Biochemical reactions are mainly controlled by enzymes. These proteins can specifically catalyze a single reaction, so that reactions can be controlled very precisely. The reaction takes place in the active site, a small part of the enzyme which is usually found in a cleft or pocket lined by amino acid residues, and the rest of the enzyme is used mainly for stabilization. The catalytic action of enzymes relies on several mechanisms including the molecular shape ("induced fit"), bond strain, proximity and orientation of molecules relative to the enzyme, proton donation or withdrawal (acid/base catalysis), electrostatic interactions and many others.[57]
The biochemical reactions that occur in living organisms are collectively known as metabolism. Among the most important of its mechanisms is the anabolism, in which different DNA and enzyme-controlled processes result in the production of large molecules such as proteins and carbohydrates from smaller units.[58]Bioenergetics studies the sources of energy for such reactions. An important energy source is glucose, which can be produced by plants via photosynthesis or assimilated from food. All organisms use this energy to produce adenosine triphosphate (ATP), which can then be used to energize other reactions.

## Applications

Thermite reaction proceeding in railway welding. Shortly after this, the liquid iron flows into the mould around the rail gap
Chemical reactions are central to chemical engineering where they are used for the synthesis of new compounds from natural raw materials such as petroleum and mineral ores. It is essential to make the reaction as efficient as possible, maximizing the yield and minimizing the amount of reagents, energy inputs and waste. Catalysts are especially helpful for reducing the energy required for the reaction and increasing its reaction rate.[59][60]
Some specific reactions have their niche applications. For example, the thermite reaction is used to generate light and heat inpyrotechnics and welding. Although it is less controllable than the more conventional oxy-fuel weldingarc welding and flash welding, it requires much less equipment and is still used to mend rails, especially in remote areas.[61]

## Monitoring

Mechanisms of monitoring chemical reactions depend strongly on the reaction rate. Relatively slow processes can be analyzed in situ for the concentrations and identities of the individual ingredients. Important tools of real time analysis are the measurement of pH and analysis of optical absorption (color) and emission spectra. A less accessible but rather efficient method is introduction of a radioactive isotope into the reaction and monitoring how it changes over time and where it moves to; this method is often used to analyze redistribution of substances in the human body. Faster reactions are usually studied with ultrafast laser spectroscopy where utilization of femtosecond lasers allows short-lived transition states to be monitored at time scaled down to a few femtoseconds.[62]


text:
Volume 396 - The 38th International Symposium on Lattice Field Theory (LATTICE2021) - Oral presentation
Gluon Parton Distribution of the Pion and Nucleon from Lattice QCD
Z. Fan
Full text: Not available
Abstract
We present the $x$-dependent nucleon and pion gluon distribution from lattice QCD using the pseudo-PDF approach, on lattice ensembles with $2+1+1$ flavors of highly improved staggered quarks (HISQ), generated by MILC Collaboration. We use clover fermions for the valence action and momentum smearing to achieve pion boost momentum up to 2.56~GeV on three lattice spacings $a\approx 0.9, 0.12$ and 0.15~fm and three pion masses $M_{\pi}\approx 220$, 310 and 690~MeV.
We compare our pion and preliminary nucleon gluon results with the determination by global fits.
How to cite

Metadata are provided both in "article" format (very similar to INSPIRE) as this helps creating very compact bibliographies which can be beneficial to authors and readers, and in "proceeding" format which is more detailed and complete.

Open Access

format: plain


text:
# Networking – Does tcpdump bypass iptables

iptablesnetworkingtcpdump

I mistakenly setup open resolver DNS server, which was soon used for a bunch of DDoS attacks originating somewhere from / to Russia. For that reason I completely blocked port 53 on both DNS servers for everyone except for trusted IP's. It does work, in that I am not able to connect to them anymore, but what seems weird to me is that when I run tcpdump on eth1 (which is interface on server with public Internet) I see lots of incoming packets from attacker to port 53.

Is it normal that tcpdump displays these packets even if iptables drops them? Or did I configure iptables wrongly?

On other hand I don't see any outgoing packets from my server, which I did before, so I suppose that the firewall is kind of working. It just surprises me that the kernel doesn't drop packets entirely? Or is tcpdump hooked to the kernel in a way that it sees the packets even before they get to iptables?

This is a nice question.

As a matter of fact, tcpdump is the first software found after the wire (and the NIC, if you will) on the way IN, and the last one on the way OUT.

Wire -> NIC -> tcpdump -> netfilter/iptables

iptables -> tcpdump -> NIC -> Wire

Thus it sees all packets reaching your interface, and all packets leaving your interface. Since packets to port 53 do not get a reply, as seen by tcpdump, you have successfully verified that your iptables rules have been correctly configured.

EDIT

Perhaps I should add a few details. tcpdump is based on libpcap, a library which creates a packet socket. When a regular packet is received in the network stack, the kernel first checks to see whether there is a packet socket interested in the newly arrived packet and, if there is one, it forwards the packet to that packet socket. If the option ETH_P_ALL is chosen, then all protocols go thru the packet socket.

libpcap implements one such packet socket with the option activated, keeps a copy for its own use, and duplicates the packet back onto the network stack, where it is processed by the kernel in the usual way, including passing it first to netfilter, the kernel-space counterpart of iptables. Same thing, in reverse order (i.e., first netfilter then last the passage thru the packet socket), on the way out.

Is this prone to hacking? But of course. There are certainly proof-of-concept rootkits using libpcap to intercept communications destined to the rootkit before the firewall can lay its hand on them. But even this pales in comparison with the fact that a simple Google query unearths working code hiding traffic even from libpcap. Still, most professionals think the advantages vastly outweigh the disadvantages, in debugging network packet filters.


text:
8.22. Multiple Choice Problem¶

In multiple choice problems, students select one option from a list of answer options. Unlike with dropdown problems, whose answer choices don’t appear until the student clicks the drop-down arrow, answer choices for multiple choice problems are always visible directly below the question.

Multiple choice problems also have several advanced options, such as presenting a random set of choices to each student. For more information about these options, see Advanced Options for Multiple Choice Problems.

8.22.1. Create a Multiple Choice Problem¶

You can create multiple choice problems in the Simple Editor or in the Advanced Editor.

Note

All problems must include labels for accessibility. The label generally includes the text of the main question in your problem. To add a label for a common problem, surround the text of the label with angle brackets pointed toward the text (>>label text<<).

8.22.1.1. Simple Editor¶

1. Under Add New Component, click Problem.

2. In the Select Problem Component Type screen, click Multiple Choice on the Common Problem Types tab.

3. When the new Problem component appears, click Edit.

4. In the component editor, replace the sample problem text with the text of your problem. Enter each answer option on its own line.

5. Determine the text of the problem to use as a label, and then surround that text with two sets of angle brackets (>><<).

6. Select all the answer options, and then click the multiple choice button.

When you do this, the component editor adds a pair of parentheses next to each possible answer.

7. Add an “x” between the parentheses next to the correct answer.

8. In the component editor, select the text of the explanation, and then click the explanation button to add explanation tags around the text.

9. On the Settings tab, specify the settings that you want.

10. Click Save.

For the example problem above, the text in the Problem component is the following.

>>Lateral inhibition, as was first discovered in the horsehoe crab:<<

( ) is a property of touch sensation, referring to the ability of crabs to
detect nearby predators.
( ) is a property of hearing, referring to the ability of crabs to detect
low frequency noises.
(x) is a property of vision, referring to the ability of crabs eyes to
enhance contrasts.
( ) has to do with the ability of crabs to use sonar to detect fellow horseshoe
crabs nearby.
( ) has to do with a weighting system in the crabs skeleton that allows it to
balance in turbulent water.

[Explanation]
Horseshoe crabs were essential to the discovery of lateral inhibition, a property of
vision present in horseshoe crabs as well as humans, that enables enhancement of
contrast at edges of objects as was demonstrated in class. In 1967, Haldan Hartline
received the Nobel prize for his research on vision and in particular his research
investigating lateral inhibition using horseshoe crabs.
[Explanation]

To create this problem in the Advanced Editor, click the Advanced tab in the Problem component editor, and then replace the existing code with the following code.

<problem>

Lateral inhibition, as was first discovered in the horsehoe crab...

<multiplechoiceresponse>
<choicegroup type="MultipleChoice" label="Lateral inhibition, as was first discovered in the horsehoe crab">
<choice correct="false">is a property of touch sensation, referring to the ability of crabs to detect nearby predators.</choice>
<choice correct="false">is a property of hearing, referring to the ability of crabs to detect low frequency noises.</choice>
<choice correct="false">is a property of vision, referring to the ability of crabs eyes to enhance contrasts.</choice>
<choice correct="true">has to do with the ability of crabs to use sonar to detect fellow horseshoe crabs nearby.</choice>
<choice correct="false">has to do with a weighting system in the crabs skeleton that allows it to balance in turbulent water.</choice>
</choicegroup>
</multiplechoiceresponse>
<solution>

Explanation

Horseshoe crabs were essential to the discovery of lateral inhibition, a property of vision present in horseshoe crabs as well as humans, that enables enhancement of contrast at edges of objects as was demonstrated in class. In 1967, Haldan Hartline received the Nobel prize for his research on vision and in particular his research investigating lateral inhibition using horseshoe crabs.

</solution>
</problem>

8.22.2. Advanced Options for Multiple Choice Problems¶

Multiple choice problems have several advanced options. You can change the order of answers in the problem, include explanations that appear when a student selects a specific incorrect answer, or present a random set of choices to each student. For more information, see the following:

8.22.2.1. Shuffle Answers in a Multiple Choice Problem¶

Optionally, you can configure a multiple choice problem so that it shuffles the order of possible answers.

For example, one view of the problem could be:

And another view of the same problem, for another student or for the same student of a subsequent view of the unit, could be:

You can also have some answers shuffled, but not others. For example, you may want to have the answer “All of the Above” fixed at the end of the list, but shuffle other answers.

You can configure the problem to shuffle answers through The Simple Editor or The Advanced Editor.

8.22.2.1.1. Use the Simple Editor to Shuffle Answers¶

You can configure the problem to shuffle answers in The Simple Editor.

For example, the following text defines a multiple choice problem, before shuffling is enabled. The (x) indicates the correct answer:

>>What Apple device competed with the portable CD player?<<
( ) Napster
(x) The iPod
( ) The vegetable peeler

To add shuffling to this problem, add ! in the parenthesis of the first answer:

>>What Apple device competed with the portable CD player?<<
( ) Napster
(x) The iPod
( ) The vegetable peeler

To fix an answer’s location in the list, add @ in the parenthesis of that answer:

>>What Apple device competed with the portable CD player?<<
( ) Napster
(x) The iPod
( ) The vegetable peeler
(@) All of the above

You can combine symbols within parenthesis as necessary. For example, to show the correct answer in a fixed location, you could use:

(x@) The iPod

You can configure the problem to shuffle answers through XML in The Advanced Editor.

For example, the following XML defines a multiple choice problem, before shuffling is enabled:

What Apple device competed with the portable CD player?

<multiplechoiceresponse>
<choicegroup type="MultipleChoice">
<choice correct="false">Napster</choice>
<choice correct="true">The iPod</choice>
<choice correct="false">The vegetable peeler</choice>
</choicegroup>
</multiplechoiceresponse>

To add shuffling to this problem, add shuffle="true" to the <choicegroup> element:

What Apple device competed with the portable CD player?

<multiplechoiceresponse>
<choicegroup type="MultipleChoice" shuffle="true">
<choice correct="false">Napster</choice>
<choice correct="true">The iPod</choice>
<choice correct="false">The vegetable peeler</choice>
</choicegroup>
</multiplechoiceresponse>

To fix an answer’s location in the list, add fixed="true" to the choice element for the answer:

What Apple device competed with the portable CD player?

<multiplechoiceresponse>
<choicegroup type="MultipleChoice" shuffle="true">
<choice correct="false">Napster</choice>
<choice correct="true">The iPod</choice>
<choice correct="false">The vegetable peeler</choice>
<choice correct="false" fixed="true">All of the above</choice>
</choicegroup>
</multiplechoiceresponse>

8.22.2.2. Targeted Feedback in a Multiple Choice Problem¶

You can configure a multiple choice problem so that explanations for incorrect answers are automatically shown to students. You can use these explanations to guide students towards the right answer. Therefore, targeted feedback is most useful for multiple choice problems for which students are allowed multiple attempts.

8.22.2.2.1. Use the Advanced Editor to Configure Targeted Feedback¶

You configure the problem to provide targeted feedback through XML in The Advanced Editor.

• Add a targeted-feedback attribute to the <multiplechoiceresponse> element, with no value: <multiplechoiceresponse targeted-feedback="">
• Add a <targetedfeedbackset> element before the <solution> element.
• Within <targetedfeedbackset>, add one or more <targetedfeedback> elements.
• Within each <targetedfeedback> element, enter your explanation for the incorrect answer in HTML as markup described below.
• Connect the <targetedfeedback> element with a specific incorrect answer by using the same explanation-id attribute value for each.
• Use the <solution> element for the correct answer, with the same explanation-id attribute value as the correct <choice> element.

For example, the XML for the multiple choice problem is:

What Apple device competed with the portable CD player?

<multiplechoiceresponse targeted-feedback="">
<choicegroup type="MultipleChoice">
<choice correct="false" explanation-id="feedback2">Napster</choice>
<choice correct="true" explanation-id="correct">The iPod</choice>
<choice correct="false" explanation-id="feedback3">The vegetable peeler</choice>
</choicegroup>
</multiplechoiceresponse>

This is followed by XML that defines the targeted feedback:

<targetedfeedbackset>
<targetedfeedback explanation-id="feedback1">

Targeted Feedback

The iPad came out later and did not directly compete with portable CD players.

</targetedfeedback>
<targetedfeedback explanation-id="feedback2">

Targeted Feedback

Napster was not an Apple product.

</targetedfeedback>
<targetedfeedback explanation-id="feedback3">

Targeted Feedback

Vegetable peelers don't play music.

</targetedfeedback>
</targetedfeedbackset>

<solution explanation-id="correct">

The iPod directly competed with portable CD players.

</solution>

8.22.2.3. Answer Pools in a Multiple Choice Problem¶

You can configure a multiple choice problem so that a random subset of choices are shown to each student. For example, you can add 10 possible choices to the problem, and each student views a set of five choices.

The answer pool must have at least one correct answer, and can have more than one. In each set of choices shown to a student, one correct answer is included. For example, you may configure two correct answers in the set of 10. One of the two correct answers is included in each set a student views.

You configure the problem to provide answer pools through XML in The Advanced Editor.

• In the <choicegroup> element, add the answer-pool attribute, with the numerical value indicating the number of possible answers in the set. For example, <choicegroup answer-pool="4">.
• For each correct answer, to the <choice> element, add an explanation-id attribute and value that maps to a solution. For example, <choice correct="true" explanation-id="iPod">The iPod</choice>.
• For each <solution> element, add an explanation-id attribute and value that maps back to a correct answer. For example, <solution explanation-id="iPod">.

Note

If the choices include only one correct answer, you do not have to use the explanation-id in either the choice or <solution> element. You do still use the <solutionset> element to wrap the <solution> element.

For example, for the following multiple choice problem, a student will see four choices, and in each set one of the choices will be one of the two correct ones. The explanation shown for the correct answer is the one with the same explanation ID.

<problem>

What Apple devices let you carry your digital music library in your pocket?

<multiplechoiceresponse>
<choice correct="false">Napster</choice>
<choice correct="true" explanation-id="iPod">The iPod</choice>
<choice correct="false">The vegetable peeler</choice>
<choice correct="false">The iMac</choice>
<choice correct="true" explanation-id="iPhone">The iPhone</choice>
</choicegroup>
</multiplechoiceresponse>

<solutionset>
<solution explanation-id="iPod">

Explanation

Yes, the iPod is Apple's portable digital music player.

</solution>
<solution explanation-id="iPhone">

Explanation

In addition to being a cell phone, the iPhone can store and play your digital music.

</solution>
</solutionset>
</problem>

8.22.3. Multiple Choice Problem XML¶

8.22.3.1. Template¶

<problem>

Question text

<multiplechoiceresponse>
<choicegroup type="MultipleChoice" label="label text">
<choice correct="false" name="a">Incorrect choice</choice>
<choice correct="true" name="b">Correct choice</choice>
</choicegroup>
</multiplechoiceresponse>

<solution>

Explanation or solution text

</solution>
</problem>

8.22.3.2. Tags¶

• <multiplechoiceresponse> (required): Indicates that the problem is a multiple choice problem.
• <choicegroup> (required): Indicates the beginning of the list of options.
• <choice> (required): Lists an answer option.

Tag: <multiplechoiceresponse>

Indicates that the problem is a multiple choice problem.

Attributes

(none)

Children

• <choicegroup>
• All standard HTML tags (can be used to format text)

Tag: <choicegroup>

Indicates the beginning of the list of options.

Attributes

 Attribute Description label (required) Specifies the name of the response field. type (required) Must be set to “MultipleChoice”.

Children

• <choice>

Tag: <choice>


text:
# Nonabelian group of order $75$ cannot have a cyclic subgroup of order $25$

I am working through the following problem, and would like to know if my proof is mostly correct:

Let $$G$$ be a nonabelian group of order $$75$$ and $$H$$ a $$5$$-Sylow subgroup of $$G$$. Show that $$H$$ is not cyclic. (Hint: Show that the conjugation action of $$G$$ on $$H$$ is not trivial).

Here is my proof:

Let $$\mu:G\times H\to H$$ be the group action of conjugation on $$H$$, i.e. $$\mu(g,h)=ghg^{-1}$$ for $$g\in G$$ and $$h\in H$$. We have that $$\ker\mu\unlhd G$$, so if $$\mu$$ is trivial, then this implies that $$\ker\mu=G$$ and so $$G\unlhd G$$, which contradicts the fact that $$G$$ is nonabelian. Note that from $$\mu$$ we have the associated homomorphism $$\phi:G\to\operatorname{Aut}(H)$$ and we just showed that $$\operatorname{ker}\phi\neq G$$.

Let $$I$$ be a $$3$$-Sylow subgroup of $$G$$, and we have the associated homomorphism $$\psi:I\to \operatorname{Aut}(H)$$ when we let $$I$$ act on $$H$$ via conjugation. If $$H$$ were cyclic, then $$H\cong\mathbb Z/25\mathbb Z$$ and so $$|\operatorname{Aut}(H)|=20$$. $$|I|$$ and $$|\operatorname{Aut}(H)|$$ are coprime, so $$\psi$$ must be trivial, implying that $$I$$ commutes with $$H$$.

Let $$J$$ denote the subgroup consisting of $$g\in G$$ such that $$g$$ commutes with elements in $$H$$. Then, $$I\leq J$$ and so $$3$$ divides $$|J|$$ and also $$H\leq J$$ and so 25 divides $$|J|$$. $$J\leq G$$ also, so we get that $$|J|=75$$ and so $$J=C_G(H)=G$$. But, from above, we showed that $$\operatorname{ker}\phi=C_G(H)\neq G$$, so we have a contradiction.

It was not obvious to me how the result followed from the hint, so this is the best thing I could come up with. Thank you for any help or feedback!

• Why is $\ker(\mu)$ a normal subgroup of $G$? I understand what you mean, but it is wrong written like this. Also $G \lhd G$ is always true, even for nonabelian groups. Dec 8 '19 at 15:57

There are some errors in your proof (which I honestly didn't entirely follow), for example the kernel of $$\mu$$ is not a subgroup of $$G$$, but there's one part that solves the whole problem.
Note that if $$A$$ is a Sylow $$3$$-subgroup then $$AH=G$$. Since $$H$$ is normal, $$G$$ is a semidirect product $$H\rtimes A$$. If $$A$$ acted trivially on $$H$$ by automorphisms, then $$G$$ would be abelian because it would be the direct product. As you correctly deduced, if $$H$$ were cyclic then $$A$$ would act trivially by order considerations. Thus $$H$$ is not cyclic.
• Thank you so much! I think I got stuck on trying to make the hint work, but your answer helped guide me to a correct (and less convoluted) proof. I have one question still: could you please explain why does $A$ being a Sylow $3$-subgroup imply that $AH=G$? Thanks again. Dec 9 '19 at 13:51
• @himan $3$ divides the order of $AH$ as does $25$. Dec 9 '19 at 13:57
Observe from Sylow's theorems that $$n_5=1$$, so that there is only one Sylow $$5$$-subgroup and thus it is normal. Let $$P$$ be that Sylow subgroup. From the $$N/C$$ theorem, it follows that $$N_G(P)/C_G(P) = G/C_G(P)$$ is isomorphic to a subgroup of $$\mathrm{Aut}(P)$$. If $$P$$ is cyclic then $$\mathrm{Aut}(P) \cong C_{20}$$. But $$P$$ is abelian, so $$C_G(P) \geq P$$, thus the index of $$C_G(P)$$ in $$G$$ is either $$1$$ or $$3$$. Therefore, if $$P$$ is cyclic then $$P$$ is central in $$G$$.


text:
# How to compute the number of weights of a CNN?

How can we theoretically compute the number of weights considering a convolutional neural network that is used to classify images into two classes:

• INPUT: 100x100 gray-scale images.
• LAYER 1: Convolutional layer with 60 7x7 convolutional filters (stride=1, valid padding).
• LAYER 2: Convolutional layer with 100 5x5 convolutional filters (stride=1, valid padding).
• LAYER 3: A max pooling layer that down-samples Layer 2 by a factor of 4 (e.g., from 500x500 to 250x250)
• LAYER 4: Dense layer with 250 units
• LAYER 5: Dense layer with 200 units
• LAYER 6: Single output unit

Assume the existence of biases in each layer. Moreover, the pooling layer has a weight (similar to AlexNet)

How many weights does this network have?

Here would be the corresponding model in Keras, but note that I am asking for how to calculate this with a formula, not in Keras.

import keras
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Conv2D, MaxPooling2D

model = Sequential()
model.add(Conv2D(60, (7, 7), input_shape = (100, 100, 1), padding="same", activation="relu")) # Layer 1

model.summary()

• Here is a related (if not duplicate) question.
– nbro
Dec 28, 2021 at 22:37

A CNN is composed of different filters, which are essentially 3d tensors. CNN weights are shared, meaning they are used multiple times and reused in different locations. Each layer has $$n$$ tensors, each with dimension $$w \times h \times c$$, where $$w$$ = width, $$h$$ = height, $$c$$ = channels (the input channel size). Therefore, the number of parameters of a convolutional layer is $$w * h * c * n$$. There is also a bias for each output channel, so the number of biases is $$n$$. At the end the parameter number is calculated with: $$n * w * h * c + n$$. See more about this in hear: Article


text:
# Making prettier (and more impactful) plots¶

Making prettier plots is part matter-of-taste, part an appreciation for optical perception. These days, there are a number of things you can do to make prettier plots. The guiding philosophy for these bits of advice is that it's better to start with little, and add more elements to the plot only if they actually add information (see the work of Edward Tufte).

In [1]:
# we'll use the pythonic pyplot interface
import matplotlib.pyplot as plt

# necessary for the notebook to render the plots inline
%matplotlib inline

In [2]:
import numpy as np
np.random.seed(42)

In [3]:
x = np.linspace(0, 40, 1000)
y = np.sin(np.linspace(0, 10*np.pi, 1000))
y += np.random.randn(len(x))

In [4]:
plt.plot(x, y)

Out[4]:
[<matplotlib.lines.Line2D at 0x7f3da78f4290>]

The default plots created with matplotlib aren't bad, but they do have elements that are, at best, unnecessary. At worst, these elements detract from the display of quantitative information. We want to change this. First, let's change matplotlib's style with a built-in style sheet.

In [5]:
# this gives us a style and color palette similar to ggplot2
plt.style.use('ggplot')

In [6]:
plt.plot(x, y)

Out[6]:
[<matplotlib.lines.Line2D at 0x7f3da7801090>]

This produces something a bit more pleasing to the eye, with what probably amounts to better coloration. It replaced the box with a grid, however. Although this is useful for some plots, in particular panels of plots in which one needs to compare across different plots, it is often just unnecessary noise.

Using seaborn can help with this. We'll import seaborn's helper functions without importing its style:

In [7]:
# import seaborn's helpful functions without applying its style
import seaborn.apionly as sns

In [11]:
# importing seaborn can sometimes reset matplotlib's style to default
plt.style.use('ggplot')

In [13]:
# this will remove the noisy grids the 'ggplot' style gives
sns.set_style('ticks')

In [14]:
plt.plot(x, y)

Out[14]:
[<matplotlib.lines.Line2D at 0x7f3d996614d0>]

It almost looks like we took two steps forward and one step back: now we have a box again. But seaborn provides a useful function for removing axis lines: despine.

In [15]:
plt.plot(x, y)
sns.despine()

We can also go further, moving the axes a bit so they distract even less from the data, which should be front-and-center.

In [16]:
plt.plot(x, y)
sns.despine(offset=10)

Now let's do some refining. Figures for exploratory work can be any size that's convenient, but when making figures for a publication, you must consider the real size of the figure in the final printed form. Considering a page in the U.S. is typically 8.5 x 11 inches, a typical figure should be no more than 4 inches wide to fit in a single column of the page. We can adjust figure sizes by giving matplotlib a bit more detail:

In [19]:
fig = plt.figure(figsize=(4, 2))

ax.plot(x, y)
sns.despine(offset=10, ax=ax)

# let's add some axes labels to boot
ax.set_ylabel(r'displacement ($\AA$)')
ax.set_xlabel('time (ns)')

Out[19]:
<matplotlib.text.Text at 0x7f3d9936bed0>

We added some axes labels, too. Because this is a timeseries, we deliberately made the height of the figure less than the width. This is because timeseries are difficult to interpret when the variations with time are smashed together. Tufte's general rule is that no line in the timeseries be greater than 45$^\circ$; we would have a hard time doing that here with such noisy data, but going wider than tall is a step in the right direction.

## Plotting to files¶

We can save figures in a variety of formats. It's useful to save a version as a PDF so that it can be postprocessed using vector graphics tools like Inkscape and Adobe Illustrator, but because vector graphics must be rendered by the viewer on load, it's useful to also write out a PNG.

PNGs are raster graphics: they are just a matrix of pixels with four components (red, green, blue, and alpha (transparency)). This means they are quick to render with your favorite viewer, even if the plot originally had hundreds of thousands of points. However, they are not so great for making posters and final publication-quality figures, since they cannot be scaled to any size like vector graphics.

In [39]:
fig = plt.figure(figsize=(4, 2))

ax.plot(x, y)
sns.despine(offset=10, ax=ax)

# let's add some axes labels to boot
ax.set_ylabel(r'displacement ($\AA$)')
ax.set_xlabel('time (ns)')

fig.savefig('testfigure.pdf')
fig.savefig('testfigure.png', dpi=300)

We can view the resulting PNG directly:

In [40]:
from IPython.display import Image

In [41]:
Image(filename='testfigure.png')

Out[41]:

Woah...something's wrong. The figure doesn't fit in the frame! This is because the figure elements were adjusted after the figure object was created, and so some of these elements, including the axis labels, are beyond the figure's edges. We can usually fix this with a call to plt.tight_layout to ensure everything fits in the plots we write out.

In [42]:
fig = plt.figure(figsize=(4, 2))

ax.plot(x, y)
sns.despine(offset=10, ax=ax)

# let's add some axes labels to boot
ax.set_ylabel(r'displacement ($\AA$)')
ax.set_xlabel('time (ns)')

# and now we'll also refine the y-axis ticks a bit
ax.set_ylim(-4.5, 4.5)
ax.set_yticks(np.linspace(-4, 4, 5))
ax.set_yticks(np.linspace(-3, 3, 4), minor=True)

plt.tight_layout()

fig.savefig('testfigure.pdf')
fig.savefig('testfigure.png', dpi=300)

In [43]:
Image(filename='testfigure.png')

Out[43]:

Okay...better. But it looks like the labels are a bit too big to make these dimensions work well. We can adjust these directly by changing matplotlib's settings. These are the same settings you might have set defaults for in your matplotlibrc file.

In [45]:
# we can override matplotlib's settings; for example, changing the font size
plt.rcParams['font.size'] = 8

In [46]:
fig = plt.figure(figsize=(4, 2))

ax.plot(x, y)
sns.despine(offset=10, ax=ax)

# let's add some axes labels to boot
ax.set_ylabel(r'displacement ($\AA$)')
ax.set_xlabel('time (ns)')

# and now we'll also refine the y-axis ticks a bit
ax.set_ylim(-4.5, 4.5)
ax.set_yticks(np.linspace(-4, 4, 5))
ax.set_yticks(np.linspace(-3, 3, 4), minor=True)

plt.tight_layout()

fig.savefig('testfigure.pdf')
fig.savefig('testfigure.png', dpi=300)

In [47]:
Image(filename='testfigure.png')

Out[47]:

Much better!

## Going further¶

Because we know this is an oscillating function, it might make sense to also plot a histogram of its values to get a sense of their distribution. We can accomplish this in one figure using subplots defined with a GridSpec object. There are many ways of defining the spatial extent of axes within a figure, but for this case this is probably the easiest.

In [62]:
from matplotlib import gridspec

fig = plt.figure(figsize=(7, 3))
gs = gridspec.GridSpec(1, 2, width_ratios=[3,1] )

# plot the timeseries
ax0 = plt.subplot(gs[0])
ax0.plot(x, y)

# let's add some axes labels to boot
ax0.set_ylabel(r'displacement ($\AA$)')
ax0.set_xlabel('time (ns)')

# and now we'll also refine the y-axis ticks a bit
ax0.set_ylim(-4.5, 4.5)
ax0.set_yticks(np.linspace(-4, 4, 5))
ax0.set_yticks(np.linspace(-3, 3, 4), minor=True)

# plot the distribution
ax1 = plt.subplot(gs[1])
ax1.hist(y, histtype='step', bins=40, normed=True, orientation='horizontal')

# this will remove the grid and the ticks on the x-axis
ax1.set_xticks([])
ax1.grid(False)

ax1.set_xlim((0,.5))
ax1.set_ylim(-4.5, 4.5)
ax1.set_yticks(np.linspace(-3, 3, 4), minor=True)

sns.despine(ax=fig.axes[0], offset=10)
sns.despine(ax=fig.axes[1], bottom=True)

plt.tight_layout()

Don't like the color? We can use seaborn to get at different colors in the color palette:

In [63]:
sns.palplot(sns.color_palette())

In [66]:
from matplotlib import gridspec

fig = plt.figure(figsize=(7, 3))
gs = gridspec.GridSpec(1, 2, width_ratios=[3,1] )

# plot the timeseries
ax0 = plt.subplot(gs[0])
ax0.plot(x, y, color=sns.color_palette()[1])

# let's add some axes labels to boot
ax0.set_ylabel(r'displacement ($\AA$)')
ax0.set_xlabel('time (ns)')

# and now we'll also refine the y-axis ticks a bit
ax0.set_ylim(-4.5, 4.5)
ax0.set_yticks(np.linspace(-4, 4, 5))
ax0.set_yticks(np.linspace(-3, 3, 4), minor=True)

# plot the distribution
ax1 = plt.subplot(gs[1])
ax1.hist(y, histtype='step', bins=40, normed=True, orientation='horizontal', color=sns.color_palette()[1])

# this will remove the grid and the ticks on the x-axis
ax1.set_xticks([])
ax1.grid(False)

ax1.set_xlim((0,.5))
ax1.set_ylim(-4.5, 4.5)
ax1.set_yticks(np.linspace(-3, 3, 4), minor=True)

sns.despine(ax=fig.axes[0], offset=10)
sns.despine(ax=fig.axes[1], bottom=True)

plt.tight_layout()


text:
# Diagram Of A Woman

• Title : Diagram Of A Woman
• Category : Wiring Diagram
• Post Date : August 06, 2021

### Recent Searches:

#### Diagram Of A Woman

Female anatomy: Body parts, their functions, and diagram ; Nov 05, 2019 · Female anatomy includes the external genitals, or the vulva, and the internal reproductive organs. This article looks at female body parts and their functions, and it provides an interactive diagram. Lighting Diagrams made easy by Sylights ; Never draw a lighting diagram again! Sylights brings you the tools to create and share lighting diagrams to document your photos. diodes - E-K diagram in case of semiconductors ... ; Sep 28, 2013 · This diagram indicates (diagramatically) how the actual electron states are equally spaced in k-space. Which means that the density of states in E (\$\rho(E)\$) depends on the slope of the E-k curve. There is a more complex form of E-k diagram that shows the relationship for different directions of k relative to the crystal lattice: Diagramming Clauses: Independent & Dependent Clauses ; The woman who looked happy danced. ... indirect object, predicate noun, object of the preposition). This diagram shows a noun clause acting as the subject of the independent clause. This diagram shows a noun clause acting as the direct object of the verb knows. My mother knows I love the library. Back to Sentence Diagramming Index. Diaphragm: Anatomy, Function, Diagram, Conditions, and ... ; Jul 30, 2018 · Diaphragm diagram. Explore the interactive 3-D diagram below to learn more about the diaphragm. Diaphragm conditions. A range of health conditions can affect or involve the diaphragm. Fill Out a Wedding RSVP | Invitations by Dawn ; Miss refers to an unmarried woman but Ms. can refer to a married or unmarried woman: M_ iss Marissa Porte and Mr. Henry Satre. If you need to add children, you may write their first names, if there’s room. You can also indicate that you’re bringing children on the space that asks you to … What Is the Plot of a Story? The 5 Parts of the Narrative ; The diagram begins with a flat, horizontal line for the exposition, showing a lack of tension as well as what is normal for the characters in the story. This elevation changes, however, with the rising action , or immediately after the conflict has been introduced. 2018 RACE RESULTS - Formula 1 ; googletag.cmd.push(function() { googletag.display('div-gpt-ad-1570701821262-0');}); Loading...


text:
# Overlapping material

In another question, Harald showed how to make vertical leaders. Armed with this knowledge, I set sail to answer another question, but as I've tried to put such leaders into a page with other material as well, the leaderfill always takes up the whole page.

Is there a general way to typeset something onto a page, which then would be handled by TeX as if nothing had been typeset at all (i.e., it wouldn't take any kind of space away from other material)?

Example:

\newbox\needlebox\setbox\needlebox=\vbox{\hsize=2em$\cdot$}
\def\needlefill{\cleaders\copy\needlebox\vskip0pt plus 1fill}
\llap{\hbox to 2em{\vbox to\vsize{\hsize=2em\needlefill}}} Blah
\bye

(The "Blah" goes to second page)

-

## 2 Answers

\llap is the right direction, but you still need a vertical version of it:

\newbox\needlebox\setbox\needlebox=\vbox{\hsize=2em$\cdot$}
\def\needlefill{\cleaders\copy\needlebox\vskip0pt plus 1fill}
\llap{\vbox to 0pt{\hbox to 2em{\vbox to\vsize{\hsize=2em\needlefill}}\vss}} Blah
\bye

See also this discussion on c.t.t I started about \blap and \tlap macros.

-

(not tested)

a box in vertical mode gets set and stays in vertical mode. you need to get out of vertical mode.

precede the \llap by \leavevmode to put you into horizontal mode.

you may also want to give \vbox the height of a line of text to avoid having it line up at the bottom. \vbox to Npt{...} where N = the height of the first line; the height of \mathstrut is probably a good value.

-


text:
# Quotients with Fractions and Decimal Fractions

In this quotients with fractions and decimal fractions, students use their problem solving skills to solve the problems in 3 division tables.