Exponentiation by squaring Created 2026-10-03 Updated 2026-10-14
Exponentiation by squaring computes an integer power by reading the exponent's binary expansion. Appending a binary digit to a prefix of value replaces by , so the corresponding power changes byEach new digit requires one squaring and, only for digit one, one further multiplication. The number of digits grows with the logarithm of the exponent, making this useful for modular exponentiation, primality testing, and powers of matrices using matrix multiplication.[ref]
A Computational Introduction to Number Theory and Algebra by Victor Shoup. Section 3.4, pp. 65–66: binary-prefix recurrence and repeated-squaring algorithm; p. 67: primality-testing application
For a concrete calculation, , so . The optimized left-to-right algorithm used here instead keeps one accumulated power: initialize from the leading digit one, then process only the remaining digits :Thus , using three squarings and two further multiplications, instead of twelve successive multiplications starting at .
For a general positive integer with leading digit , set and, for , first replace by , then multiply it by if . Return . This explicitly skips the leading digit's otherwise unnecessary operations on one. A Computational Introduction to Number Theory and Algebra by Victor Shoup (Section 3.4, pp. 65–66) presents the version initialized at one and processing every digit; the optimization here makes the counting convention unambiguous.
The loop invariant is , where is the value of the digits already read. Initially and . If the next digit is , then squaring and optionally multiplying give , exactly the next prefix. At termination . This proof uses associativity of multiplication; it works in any monoid, including matrices with the identity matrix as identity element, and needs no commutativity between different bases.
For , return the identity element without performing a multiplication. This is the empty-product convention ; if , the algorithm therefore returns one for by convention, rather than resolving its meaning in every mathematical setting. Negative integer exponents require an inverse element: compute , counting the inversion separately. Over the integers, such an inverse generally leaves the integers, and a zero base has no inverse.
Fano's inequality Created 2026-09-29 Updated 2026-10-14
Fano's inequality turns remaining uncertainty into a constraint on decision errors. If an observation leaves many plausible answers, a decoder cannot usually recover the answer reliably. Its elegant idea is to separate two uncertainties: whether the guess was wrong, and which alternative was correct when it was wrong.
Let be discrete random variables, with taking values in a finite alphabet of cardinality . Choose any deterministic decoder whose output lies in , and define its average error probability . With base-two logarithms, Fano's inequality statesHere is conditional entropy and is binary entropy, with at the endpoints. Both sides are measured in bits; using natural logarithms throughout gives the same inequality in nats. No uniform source, independence of , or optimality of the decoder is assumed. Requiring its output to belong to the same alphabet is what leaves at most alternatives after an error.[ref]
For an exact toy example, give the discrete uniform distribution on . A channel reports with probability and reports each of the other three symbols with probability , where . Use the decoder . The output is uniform, and the conditional probabilities after any report areThus and direct calculation of the conditional entropy givesThis is equality in Fano's inequality for every . At , each report leaves probabilities , up to their order, and bits. The two contributions are bits for the error flag and bits for identifying the correct alternative after an error. These are theoretical probabilities, not measured data.
The identity decoder in this example minimizes error only for : its guessed symbol has the largest posterior probability exactly when . At , are independent random variables and all four guesses tie. For , guessing any one of the three other symbols has error probability . Equality in Fano's inequality therefore does not certify an optimal decoder.
For usefulness, combine with to obtain the simpler consequenceFor a uniform , , so this becomes . This connects mutual information to unavoidable decision error in channel coding or classification in statistical learning; it can rule out reliable recovery regardless of the chosen decoder.[ref]
https://web.stanford.edu/class/ee376a/files/lecture_notes.pdf. Weissman, Ochoa and Tatwawadi, EE376A course notes, Sections 5.7–5.8
The sharper right-hand side increases from zero to on , then decreases: in the interior, . When interpreting the inequality by inverting a curve, use its increasing branch to obtain a lower error threshold. A decoder that chooses a largest posterior probability, as in maximum a posteriori decoding, always has , since the largest of conditional probabilities is at least . Arbitrary decoders can have larger error. In particular, low conditional entropy does not force every decoder to work well: with a fair binary and , the rule has even though . Fano's inequality supplies a constraint, not an exact error prediction for each rule.
Finite trajectory entropy production 2026-10-14
Consider a finite-duration Markov process with discrete, time-even states coupled to one thermal reservoir at positive temperature . Let include the initial probability of the sample trajectory . Define by reversing the control protocol and initializing it with the actual forward final probability distribution . Write for the same states visited in reverse time order. Require normalized path laws with matching probability support: a path has positive forward weight exactly when its reverse has positive reverse weight. This excludes irreversible forbidden transitions and missing initial states.
Under local detailed balance, with positive heat delivered to the thermal reservoir, the full path-weight logarithm isThe endpoint term is the change in stochastic system entropy; the conditional path ratio alone accounts for the thermal reservoir. Here is the Boltzmann constant. Both terms matter even for a short observation. [ref]
Entropy production along a stochastic trajectory and an integral fluctuation theorem by Udo Seifert. Seifert, 2005, Eqs. (14)–(18) and (30): conditional and full path weights, endpoint distributions, total entropy
Define the conjugate reverse functional by , so . Summing the path identity over paths with a given value gives the exact finite fluctuation theoremfor nonzero denominator, using probability masses or corresponding probability density functions. This is defined by the paired laws: it need not be the total entropy production obtained by independently restarting the thermodynamic construction for the reverse experiment. A generic driven experiment therefore does not imply .
Floquet growth rate Created 2026-10-06 Updated 2026-10-14
The Floquet growth rate measures the exponential trend of a periodic linear differential equation over many coefficient periods. A Floquet multiplier measures the factor per period ; the corresponding rate per unit time iswhere is a Floquet exponent. Taking the real part removes the ambiguity in the complex logarithm.
For the scalar example under periodic solution, and the Floquet growth rate is , independently of . Indeed,The instantaneous logarithmic derivative keeps oscillating even though its average over complete periods is exactly . Sampling at the same phase in each period removes the modulation altogether: .
For the general finite-dimensional homogeneous linear differential equation , assume that is continuous on the real line and -periodic, with . Normalize its fundamental matrix by and set . The maximal asymptotic exponential rate, using any induced matrix norm, isHere is the spectral radius, are the Floquet multipliers, and invertibility gives . This concerns growth of the solution operator; it does not say that every initial condition attains the maximum.[ref]
To prove the formula, write with . Periodicity and uniqueness giveBoth and have uniformly bounded matrix norms on a period. Consequently differs from by at most fixed multiplicative factors. The spectral radius formula gives , proving the claimed limit without choosing a matrix logarithm.
For a particular nonzero initial condition , decompose into the generalized eigenspaces of over the complex numbers. The rate of is the largest among components that are nonzero. Generic data have a component in the dominant generalized eigenspaces and attain ; data contained in the sum of the subdominant generalized eigenspaces have a smaller rate. For example, with , the maximal rate is , while decays at rate . These invariant subspaces describe initial data at phase zero. Their transported versions can vary with time and satisfy .
A negative Floquet growth rate allows temporary amplification. For the constant non-normal matrixthe initial condition has Euclidean norm , which rises from to about at before eventually decaying. Its exponential rate is still : the Jordan block contributes a polynomial factor, whose logarithm divided by tends to zero. At a unit-modulus Floquet multiplier, such polynomial growth can even be unbounded with zero exponential rate; gives . Thus zero Floquet growth rate alone proves neither boundedness nor a periodic solution.
Formal monodromy 2026-10-14
An unramified formal fundamental matrix acquires the right factor on a positive turn of the logarithm branch. This is formal monodromy. It can be nontrivial even when the true equation has an entire fundamental matrix and trivial actual monodromy, because Stokes matrices compensate for it.
A short concentration inequality argument explains the bound. For a fixed nonzero vector , the normalized row products are independent random variables with the standard normal distribution, soUse the moment-generating function of a chi-squared distribution and the Chernoff bound to obtainFor , elementary logarithm inequalities bound their sum by . Apply the union bound to the nonzero pair differences to get failure probability at most . Independence of different pairs is unnecessary; they use the same map. This combines fixed-vector concentration with a finite-set union bound. [ref]
Lecture notes on metric embeddings by Jiří Matoušek. Lecture notes on metric embeddings, §2.1, pp. 20–21, and proof of Lemma 2.3.1, pp. 25–26: fixed-vector concentration and union bound over pair differences
Geometric mean Created 2026-10-07 Updated 2026-10-13
The geometric mean replaces a list of nonnegative real numbers by one repeated value that preserves their product of numbers. For inputs,For two positive inputs, is their positive square root. The geometric mean of and is three: replacing by retains the same product. In contrast, their arithmetic mean five retains the sum . The geometric mean is zero if any input is zero; the logarithm formula below requires every input to be positive. [ref]
https://dlmf.nist.gov/1.2.iv. NIST Digital Library of Mathematical Functions, §1.2(iv), equation 1.2.18: geometric mean
.Its usefulness becomes immediate for successive growth factors. Suppose a hypothetical positive quantity starts at , is multiplied by , then by . It goes , so the geometric mean factor is : a constant factor of one for both steps gives the same endpoint. The arithmetic mean factor is ; repeating it would give , a different endpoint. A mean of factors summarizes multiplicative change; subtracting one afterwards gives the equivalent change per step. Equal-duration steps are necessary to interpret this as change per common time interval.
For positive inputs, logarithms turn multiplication into addition, soThus the geometric mean is an arithmetic mean in logarithmic coordinates, followed by the exponential function. For positive measurements with a common unit, one can use dimensionless ratios to a fixed reference : . Changing the common unit rescales by the same factor as the inputs. As a check, doubling one input and halving another retains while usually changing the arithmetic mean.
The geometric mean preserves multiplicative endpoints and sits between the harmonic mean and arithmetic mean
. Left: the original toy factors and return a quantity to its starting value; repeating their arithmetic mean would produce a larger endpoint. Right: the dimensionless inputs and keep product one while , , and separate as the inputs become less equal. Lines joining time steps are guides, not a continuous growth model. Details.The arithmetic-geometric mean inequality gives . Apply that same inequality to the multiplicative inverses to obtain , where is the harmonic mean. Consequentlyfor positive inputs, with equality throughout exactly when all inputs agree. For and , the three values are , , and . They preserve, respectively, the sum of inverses, the product, and the sum. No one of these summaries preserves all three for unequal inputs.
Glycine speciation model 2026-10-14
In an ideal aqueous chemical solution, set , with , and approximate activity coefficients by one. Put and for the stipulated dimensionless acid dissociation constants. The Henderson-Hasselbalch equation gives the adjacent-state ratiosWith analytical concentration , normalization gives the three fractions and mean electric charge in units of the elementary charge:All three fractions are nonnegative and sum to one. At pH , the model gives about zwitterion, cation and anion; . Predominantly zwitterionic therefore need not mean exactly at the isoelectric point.
Setting requires . Taking the logarithm yieldsAt this model isoelectric point, and : about of each charged form remains. At either pKa, the relevant adjacent fractions are equal, but the third fraction is not mathematically zero. This three-state model neglects the minor uncharged form ; macroscopic pKa values alone do not determine its fraction separately from the zwitterion.
Glycine titration experiment 2026-10-14
The Amrita Virtual Lab procedure uses glycine, hydrochloric acid and sodium hydroxide, two burettes, a pH meter, beaker and stirrer. A pipette transfers of glycine into a beaker. Calibrate the meter with standard buffer solutions at pH , and , then record the starting pH. Add hydrochloric acid in increments, recording pH after each addition until . Rinse the electrode in distilled water, take a separate fresh portion, and add sodium hydroxide in increments until pH . Its observed readout is paired added volume and pH, plotted as an acid-base titration curve; it does not measure each glycine form directly. [ref]
These are two titrations from the starting glycine chemical solution, rather than the single acidified-sample protocol assumed by the solid curve in glycine titration. Retain each portion's initial volume and the signed added acid/base amount of substance; do not concatenate raw burette readings and assume the result begins at . For this procedure's of glycine, each addition supplies of acid or base, a increment relative to the glycine inventory. This calculated resolution is not a reported measurement.
Useful additional controls are a fresh repeat portion, independently checked acid/base concentrations, a water blank, and a calibration-check buffer solution after the run. Stir without striking the glass electrode, keep its sensing region immersed and wait for stable readings; record temperature and background salts. Reduce addition size near a steep pH change. These are suggested controls for testing the model, beyond the published steps. A water blank can reveal contamination but must not be subtracted directly from pH, which is a logarithm.
The standards at pH , and do not bracket either endpoint of this protocol. Extreme readings therefore require independently checked instrument performance, and alkaline samples are sensitive to atmospheric carbon dioxide uptake. Electrode drift, incomplete mixing, volume error, dilution and changing ionic strength can shift apparent pKa values. A titration constrains the acid/base model; it cannot establish chirality or separate every microscopic protonation form. The two original diagrams show calculated predictions to compare with measured points, not reconstructed experimental data.
Harmonic series Created 2026-09-24 Updated 2026-10-14
The harmonic series is the positive seriesIts partial sums are the harmonic numbers . Although the individual terms tend to zero, grows without bound, so the harmonic series is not a convergent series. This is a basic warning against using the size of one term as a bound on all the terms still to come.
The growth is slow enough to be visually deceptive. The partial sums at are approximately . Adding ten times as many terms increases the accumulated total by roughly , rather than multiplying the total by ten. The telescoping series has similarly vanishing terms but approaches the finite sum one.
A short block argument proves the divergence without trusting a finite plot. For each integer , the block from through contains terms, each at least . ThereforeEvery doubling supplies at least another half, and arbitrarily many doublings are possible. A collection of tiny terms can still have a substantial combined contribution. See Jiří Lebl, Basic Analysis I, Example 2.5.11 for this grouping proof.
Integral comparison sharpens the growth estimate. Here denotes the natural logarithm. Since is a strictly decreasing function for positive , comparison of rectangles with the integral givesThus the divergence is logarithmic. The finer difference tends to the Euler--Mascheroni constant, approximately ; the harmonic number expansion supplies higher-order corrections. This turns the counterexample into a usable quantitative estimate of accumulated reciprocal contributions.
Euler's De progressionibus harmonicis observationes, written in 1734 and published in 1740, studies these sums beyond the yes-or-no question of convergence. Sections 2–3 compare long blocks to show continued growth, and later sections compare the sums with logarithms and calculate the constant offset. The [ref]
https://scholarlycommons.pacific.edu/euler-works/43/. Euler Archive record, E43
identifies the dates and original publication; [ref]https://download.uni-mainz.de/mathematik/Algebraische%20Geometrie/Euler-Kreis%20Mainz/E43.pdf. Alexander Aycock's translation of Euler's original paper
makes the calculations accessible. This is not a claim that Euler first discovered divergence: the paper's interest includes measuring how slowly a divergent sum grows. Henderson-Hasselbalch equation 2026-10-13
The Henderson-Hasselbalch equation estimates buffer solution pH using a weak acid's acid dissociation constant and the conjugate base to weak acid concentration ratio.
Its activity form is an exact rearrangement of the chosen chemical equilibrium relation. Write the acid dissociation step as , with hydrated hydrogen ions understood in water and the solvent convention incorporated into the acid dissociation constant. For consistent standard states,Here each is a dimensionless thermodynamic activity at chemical equilibrium. Exactness refers to this specified acid dissociation constant relation and the chosen single-ion thermodynamic activity convention, not to identifying the ratio with quantities initially mixed. If water is instead written explicitly as a reactant, its thermodynamic activity must be treated consistently. See Hippler and Metcalfe, Using activities to correct the Henderson-Hasselbalch equation (2020), equations 3–4.
For a toy weak acid with stipulated pKa , use the ideal dilute concentration approximation and put . The Henderson-Hasselbalch equation becomes :More conjugate base relative to weak acid means higher pH. Each tenfold increase in the ratio contributes exactly one to the calculated pH. The stipulated pKa is not a tabulated value for an identified substance.
The distinction between thermodynamic activity and concentration is explicit when , where is an activity coefficient and is the reference concentration:Neglecting the final term gives the usual approximate Henderson-Hasselbalch equation. It is justified when the ratio of activity coefficients is sufficiently close to one, as in a suitable dilute ideal approximation. Ionic strength, including contributions from other dissolved ions, affects activity coefficients; a nominally dilute weak acid alone does not establish that all corrections are small. The ratio must use chemical equilibrium concentrations. Replacing these by prepared amounts or post-neutralization inventories is a further approximation, suitable only when subsequent redistribution is small. See Hippler and Metcalfe, concentration, activity, and analytical-concentration approximations.
The short derivation is to solve the acid dissociation constant relation for , take a negative base-ten logarithm, and use the definitions of pH and pKa. Its useful beauty is that a chemical equilibrium becomes a simple rule about a ratio: select a weak acid with pKa near the desired pH, then adjust the partner ratio. Scaling both partner concentrations equally leaves the ideal pH prediction unchanged, while changing buffer capacity. In practical buffer solutions, temperature, ionic strength, and the available inventories still matter.
Ideal-vapor Clausius-Clapeyron approximation 2026-10-14
For liquid–gas phase coexistence, make two distinct approximations: the gas obeys the ideal gas law, , and its molar volume greatly exceeds the liquid molar volume, . Here is the molar gas constant and is the saturation pressure of the pure substance. Substitution into the Clapeyron equation giveswhere is any fixed reference pressure, making the logarithm dimensionless. Constant latent heat is a further approximation, needed for the elementary Integrated Clausius-Clapeyron relation below.[ref]
Statistical Physics by David Tong. §5.1.2, “An Approximate Solution to the Clausius-Clapeyron Equation”: the three assumptions and the exponential solution
The neglected liquid molar volume has a transparent error estimate. If the gas is ideal but is retained, thenThus ignoring the liquid molar volume underestimates this slope by a relative amount . This estimate does not bound errors from treating a real gas as ideal or from freezing . Near a thermodynamic critical point, the gas and liquid molar volumes approach each other and these dilute-vapor assumptions fail.
Information entropy Created 2026-09-24 Updated 2026-10-14
For a finite discrete random variable with probability mass function , its information entropy is the expected value of its information content:Base-two logarithms give bits; choosing a different base rescales the units. The convention is justified by a limit, so outcomes of zero probability contribute nothing. The definition also applies to countable distributions, but the sum may be infinite.
A fair bit has . A certain outcome has . A Bernoulli random variable that is one with probability has bits, because most of its outcomes are predictable. A rare outcome still has large information content: the outcome of probability contributes bits of surprise when it occurs. Entropy is the average surprise, rather than the surprise of each outcome.
For possible outcomes, , with the upper bound attained exactly by the uniform distribution on a finite set. The Gibbs inequality proves this by comparing with the uniform distribution: . Thus increasing predictability reduces the required average description length. The four-symbol prefix code in information theory attains bits exactly; for general probabilities, integer codeword lengths prevent such a perfect match for every individual symbol. Shannon's source coding theorem explains how coding sufficiently long independent blocks approaches the entropy per symbol.
The logarithm is especially natural because independent outcomes have additive surprise: . Taking expected values gives additive information entropy for independent random variables; for dependent ones, the chain rule for information entropy replaces the second term by conditional entropy. This is why the same quantity can govern both a single observation and a long message.
Information entropy dominates min-entropy Created 2026-09-28 Updated 2026-10-14
For a discrete random variable with probability mass function , using base-two logarithms for both Shannon entropy and min-entropy,The first inequality says that average information content cannot be below the least information content of a possible outcome. For a finite alphabet, equality holds exactly when the probability mass function is uniform on its positive-probability outcomes. Impossible outcomes do not need to share that positive probability. In particular, has both quantities equal to bit, while has both zero. The same equality characterization holds for a countable alphabet: equality forces only finitely many positive-probability outcomes, because all must have the same positive mass. The uniform maximum of Shannon entropy is discussed in Shannon's original treatment.[ref]
A Mathematical Theory of Communication by Claude Shannon. Shannon, A Mathematical Theory of Communication, Section 6, definition of H and properties 1–2
For the proof, gives ; taking the expected value proves information entropy dominates min-entropy. More precisely, the nonnegative gap isIt vanishes precisely when every positive term vanishes, namely for every possible outcome. With such outcomes, normalization forces . If Shannon entropy is infinite, the inequality still holds and is strict, because min-entropy of a countable probability mass function is finite. No subtraction of two infinite quantities is needed.
An analytical family makes the gap visible. Give probability and each of probability , with . Then is a most likely outcome, so its probability is also the best single-guess success probability, andwhere is binary entropy. The entropy bound with one prescribed probability explains the second expression: it separates whether occurred from which of four equally likely alternatives occurred. At , all five outcomes are uniform and both quantities are bits. At , Shannon entropy is bits while min-entropy is bit, reproducing the biased example in min-entropy. At , both are zero; the four impossible alternatives contribute nothing. For every , the probability mass function is nonuniform on its possible outcomes and the gap is strictly positive.
An analytical five-outcome model separates average surprise from the surprise of the most likely outcome
. Details. For finite Shannon entropy, exponentiating the inequality gives the useful but potentially loose bound . Equality holds exactly for a discrete uniform distribution on the possible outcomes. Thus Shannon entropy alone supplies a lower bound on optimal success, not the upper bound needed to promise that every guess is unlikely. Shannon's source coding theorem concerns average compression under its hypotheses, while min-entropy answers the single-guess question directly. The two quantities serve different tasks even when both are expressed in bits.
Information projection Created 2026-09-24 Updated 2026-10-14
An information projection chooses the probability distribution that satisfies a constraint while departing least from a reference law in relative entropy. The constraint might specify an expected value, several marginal probability distributions, or another convex set of permissible laws. The reference is held fixed: the variable is the first argument of . Reversing the arguments gives a different minimization problem.
For a finite alphabet , take a positive reference probability mass function and a nonempty closed convex set in the probability simplex. ThenThe minimum exists and its minimizing probability distribution is unique. In this article, natural logarithms give nats. Using base-two logarithms rescales the objective without changing the minimizer.[ref]
Information Theory and Statistics: A Tutorial by Imre Csiszár and Paul C. Shields. §3, printed pp. 440–441: finite-alphabet information projection onto a closed convex set
If already meets the constraint, its information projection is itself by relative entropy nonnegativity. If not, a constraint can change the relative weights of outcomes without specifying every weight individually. Relative entropy minimization under a mean constraint gives an especially useful example: it tilts the reference law rather than choosing an arbitrary distribution with the right average.
Integrated Chebyshev sum Created 2026-10-06 Updated 2026-10-14
For , finite rearrangement and the Von Mangoldt divisor identity giveThe Stirling formula, or integral comparison for the logarithm, gives for real .






