Euler evaluation of even zeta values Created 2026-10-13 Updated 2026-10-14
The Euler evaluation of even zeta values turns a family of series into exact expressions using Bernoulli numbers, factorials and powers of . For every positive integer ,
Here is the Riemann zeta function, defined by its convergent series at these arguments, and the Bernoulli number convention is . The alternating sign combines with the sign of to give a positive sum.[ref]
Substituting , and gives
The first identity answers the Basel problem. It is surprising because the original series only mentions reciprocal squares of integers, while its exact sum involves the circle constant . The cotangent partial-fraction expansion supplies a connection between the two: trigonometric functions encode equally spaced integer poles, whose expansion brings the reciprocal powers into view.
For an original numerical comparison, the first ten terms give , while . The omitted positive terms still contribute approximately . For fourth powers, the ten-term partial sum is approximately , only below . Both are convergent series, but the second approaches its limit much faster.
Figure 1.
Reciprocal-square and reciprocal-fourth-power partial sums approach exact zeta values
. Original computed partial sums for the first thirty terms. Each panel has its own vertical scale. Dashed horizontal lines mark and ; neither finite partial sum equals its limiting value. Details.
Exact evaluation is useful beyond obtaining more digits. It supplies an independent check on a numerical summation, exposes how Bernoulli numbers organize infinitely many identities, and makes the remaining series truncation error measurable without knowing any omitted terms individually. The even integer condition is essential to this formula: putting into it is not a way to evaluate , since the required Bernoulli number index and factorial expression here are indexed by positive integers.
Historically, Leonhard Euler announced reciprocal-square and reciprocal-fourth-power evaluations in §2 of On the sums of series of reciprocals by Leonhard Euler. That paper was presented on 5 December 1735 and published in 1740, as the English translation's first-page note records. His §§3–8 develop a route through the sine power series and relationships between roots and coefficients. The cotangent calculation below is a concise modern presentation of the connection.[ref]
In independent trials with category probabilities , let count the distinct categories observed. Write it as the sum of indicator random variables for the categories' appearances. Category is absent with probability , so linearity of expectation gives the displayed formula. The appearance indicators need not be independent. For equally likely categories the expression becomes ; uneven probabilities can substantially delay observation of rare categories.
Exponential sum 2026-10-06
A finite sum of complex exponentials, such as with , is an exponential sum. Cancellation in an exponential sum between its terms can make it much smaller than the sum of their absolute values.
Finite geometric series Created 2026-09-24 Updated 2026-10-14
A finite geometric series is a sum of consecutive terms of a geometric progression. With first term and terms, including for the empty sum,
Unlike an infinite geometric series, this identity does not need . For example, . The number of terms is five; the largest exponent is four.
The cancellation behind the formula is especially useful to remember: multiplying by the common ratio shifts all terms one place. In , every interior term cancels, leaving . Division by gives the identity when ; at the sum is directly . The same argument works for complex numbers.
For integers and , the shifted version is
There are terms. All powers must be defined; if a negative exponent is present, must be nonzero. At this sum is simply . The finite trigonometric sum uses this identity with a complex exponential as the common ratio.
Finite sums of positive integers in a geometric progression already appear in Euclid's Elements, Book IX, Proposition 35. The argument there compares differences of proportional numbers; Joyce's guide rewrites its conclusion as the modern finite-sum formula. This historical result concerns finite sums, without asserting an infinite limit. [ref]
Take , , and vectors and . Their coordinate products are , so
Their Lp norms give the larger bound
Thus cancellation explains , and Hölder's inequality explains the remaining gap between and the norm product. Small signed sums need not imply small individual coordinate products.
Now keep and choose . The coordinate products are , with no cancellation, and
The matching powers are , namely .
Figure 1.
Cancellation and Hölder's inequality account for two different gaps
. Two original finite-vector calculations with , . The first pair has signed sum , absolute-product sum and norm-product bound approximately . The second pair attains equality at . The diagrams show calculated values, with no simulated data. Details.
Floating-point arithmetic Created 2026-10-14 Updated 2026-10-14
Floating-point arithmetic represents a real number by a sign, a fixed number of significant digits, and a scale. It trades exactness for a compact representation spanning many orders of magnitude. The picture shows the essential compromise: with the same precision, large numbers have wider gaps between representable neighbors. Thus accuracy is naturally relative to magnitude, rather than a fixed distance along the number line.
Figure 1.
Eight normalized four-bit binary values in each of three intervals, with gaps doubling from one eighth to one half
. Details.
In radix , an integer at least two, a nonzero normalized value has the positional notation
where the digits and exponent are integers. The parenthesized factor is the significand; counts all its significant digits, including the leading digit. Normalization means , so the same value has one such representation. The allowed exponents satisfy . Finite precision restricts the available digits, while the exponent bounds restrict the range. Zero needs a separate representation. This scales a digit string in positional notation by a power of its base.[ref]
For positive normalized values in , increasing the last digit by one gives the constant neighbor spacing
At the next scale, the spacing is multiplied by . In the binary numeral system with , the values in are ; those in are ; those in are . The respective gaps are , , and . Although absolute resolution deteriorates with magnitude, stays between and . This scale invariance is why floating-point arithmetic suits both microscopic and astronomical calculations.
The IEEE 754 binary64 format uses the binary numeral system with , including an implicit leading one for normalized values, and normal exponents . Its 64 stored binary digits comprise one sign digit, 11 exponent digits and 52 trailing significand digits. Subnormal numbers extend the range toward zero with a different leading-digit rule. In rounding to nearest, an operation returns the representable value closest to its exact result; a tie goes to the value whose last significant binary digit is even. Machine epsilon describes the gap just above one, whereas unit roundoff bounds a single relative rounding error in the normal range. These format and rounding rules are presented in MIT's floating-point lecture.[ref]
Even an ordinary terminating decimal can require rounding in the binary numeral system. The rational number has the repeating positional notation . Every finite binary fraction has a reduced denominator that is a power of two, so the factor five in prevents an exact finite binary representation. In binary64, the exact stored values of three decimal literals and their computed sum are
The exact sum of the first two stored rational numbers is , halfway between two binary64 values. The even-last-digit tie rule rounds it upward. The printed result is 0.30000000000000004, one step above stored 0.3, so 0.1 + 0.2 == 0.3 is false. Both conversion of the inputs and rounding of the addition matter here.
To reproduce the table on a Python installation using binary64, inspect exact fractions rather than only their printed decimal representations:
import sys
assert (sys.float_info.radix, sys.float_info.mant_dig) == (2, 53)
for value in (0.1, 0.2, 0.3, 0.1 + 0.2):
    print(repr(value), value.as_integer_ratio())
print(0.1 + 0.2 == 0.3)  # False
Python's as_integer_ratio() returns a pair of integers whose quotient equals the stored finite value exactly.[ref] Exact rational numbers are also useful for checking floating-point arithmetic: a short decimal printout can hide the approximation being made.
Historically, David Goldberg's March 1991 ACM Computing Surveys paper explained representation, rounding and catastrophic cancellation together with the IEEE standard's design choices. Oracle provides an authorized edited reprint. Its enduring lesson is practical: use the spacing to understand roundoff error, and inspect intermediate values when mathematically equivalent algorithms behave differently.[ref]
Forward substitution 2026-10-14
Forward substitution solves a linear system with a lower triangular matrix and nonzero diagonal, from the first row downward:
The first sum is empty, so . Each subsequent row uses only components already found. For a unit triangular matrix , omit the division because . The complementary procedure, back substitution, solves an upper triangular matrix system from the last row upward.[ref]
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].
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, so
Thus 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.
Figure 1.
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. Consequently
for 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.
For a positive proper residual fraction , with , choose , append the unit fraction , and replace the residual by in lowest terms. This is a greedy algorithm: the chosen unit fraction is the largest one not exceeding the residual.
The inequalities imply . Thus the numerator of the reduced residual strictly decreases while positive, proving algorithm termination by a nonnegative-integer loop variant. The loop invariant is that the accumulated sum plus the residual is the original rational number. Since and , the new residual is less than . If it remains positive, its next chosen denominator is therefore strictly greater than ; this expansion also satisfies the distinct-denominator convention. The proof does not bound the denominators by the input's fixed-width range. Arbitrary-precision arithmetic, checked conversion, or a different representable expansion can therefore be necessary in code.
Group homomorphism Created 2026-09-24 Updated 2026-10-14
A group homomorphism is a map preserving the group operation: . It also preserves the identity element and inverse elements. In an additive group, the same requirement reads . A group homomorphism preserves a way of combining inputs, even when several inputs have the same output.
Reduction modulo three from to is a group homomorphism: reducing a sum agrees with adding the reduced residues. For example, modulo six, and both sides reduce to one modulo three; the outputs and also add to one modulo three. This map is surjective but not injective, since zero and three both map to zero.
The sign of a permutation gives another example, from the symmetric group to the multiplicative group . A product of two odd permutations is even, matching . Its group kernel is , the alternating group of even permutations. This shows how a group homomorphism can retain a useful feature while forgetting other details.
Harmonic mean Created 2026-10-06 Updated 2026-10-14
The harmonic mean of a nonempty finite list of positive real numbers is the multiplicative inverse of the arithmetic mean of their inverses:
For two inputs, . Replacing each input by preserves the sum of inverses, making it useful when a fixed amount divided by a rate determines a cost or duration. This positive-input definition avoids division by zero; negative inputs need not retain the usual averaging or ordering properties. [ref].
Travel two legs of equal length at positive speeds , with no stops. Their travel times are and , so the average speed is
For two legs at and , the times are two hours and one hour. The average speed is . The same speeds maintained for one hour each instead cover in two hours, giving the arithmetic mean . A slower equal-distance leg occupies more time, so the data being averaged must include what is held equal. This is total distance traveled divided by elapsed time; a return journey can have zero average velocity while keeping a positive average speed. [ref].
Figure 1. . Two original idealized journeys use the same speeds, and . On the left each leg has length , taking a total of three hours. On the right each leg lasts one hour, taking two hours and covering . Dashed straight lines show the corresponding average speeds. The diagrams omit stops and transition duration and show cumulative distance traveled rather than signed displacement. Details.
The arithmetic-geometric mean inequality applied to the inverses gives ; together with it yields the comparison in geometric mean. For two inputs the arithmetic–harmonic gap has the exact form
For and the gap is five. With one positive input held fixed and another approaching zero, the harmonic mean approaches zero too: a very slow fixed-distance leg dominates the travel time. Unequal leg lengths instead require a weighted harmonic mean.
Hoeffding inequality Created 2026-09-24 Updated 2026-10-14
The Hoeffding inequality turns finite interval bounds and independence into exponentially small tail probabilities for a sum. It requires neither a normal distribution nor identical probability distributions. Let be independent essentially bounded real random variables, with deterministic finite bounds almost surely. Define the centered sum and its squared-width budget by
For and ,
The union bound therefore gives . If , every is constant almost surely, so and both positive-threshold tail probabilities vanish. The equal-width version is stated in the authored Stanford notes.[ref]
The quantity is a sum of squared interval widths, not the variance of . Centering changes the endpoints to and , leaving each width unchanged. For example, independent random variables in and have , whatever their expected values or probability distributions. A deviation at least three above their total expected value has probability at most . If all widths equal , the sample mean satisfies
Independence is essential to this general guarantee. Take one Bernoulli random variable with success probability and set every . Each lies in , but for every the sample mean is either zero or one. Thus , whereas incorrectly inserting these dependent observations into the formula would give , less than one for . Some special dependent models have their own valid concentration inequalities; arbitrary statistical dependence cannot be ignored.
For the short proof, apply Markov's inequality to with , factor the expectation using independence, and apply the Hoeffding lemma to each factor:
Minimizing this quadratic polynomial at gives the upper tail probability; applying it to gives the lower one. This is the Chernoff bound method. The original 1963 article is Probability Inequalities for Sums of Bounded Random Variables by Wassily Hoeffding; its publisher record identifies the article, but its full text was unavailable during this source check. The argument above is a direct derivation rather than a claim to have inspected that article's proof.
Hoeffding lemma Created 2026-09-24 Updated 2026-10-14
The Hoeffding lemma controls the entire centered moment-generating function using only an interval width. For an essentially bounded real random variable with finite deterministic bounds almost surely, every real satisfies
Equivalently, . This single-random variable statement needs no independence assumption; independence enters when applying it to the factors for a sum in the Hoeffding inequality. Both signs of are allowed, and equality holds at or when .[ref]
In the convention for a centered sub-Gaussian random variable , the Hoeffding lemma supplies . This upper parameter need not equal the actual variance. For a Bernoulli random variable of success probability ,
The actual variance is , whereas the supplied parameter is for every . This explains part of the conservatism visible in Hoeffding sample size for Bernoulli frequencies.
Figure 1.
Exponential tilting changes the weights but preserves the bounded interval
. The original three-point model has with probabilities and mean zero. Left: tilted masses proportional to for stay within . Right: its cumulant-generating function stays below the Hoeffding lemma bound . Its tilted variance is , smaller than the general width-only ceiling four. Details.
A short proof exposes why the constant is . Put and define exponential tilting by
The tilted probability measure has the same interval of possible values, and differentiating the cumulant-generating function gives . Boundedness justifies these derivatives for every finite . Under any such tilted law, Popoviciu's inequality on variances gives : the variance is no larger than the expected value of the squared distance from the interval midpoint, itself at most . Since , the integral form of Taylor's theorem yields
This expression handles either sign of without changing the argument.
The constant cannot be reduced uniformly over all essentially bounded real random variables. Equal endpoint probabilities at and give , a scaled Rademacher random variable, and
Thus the sharpness is already forced near zero by the variance; the bound need not be equality at nonzero parameters for a particular probability distribution.
Hölder's inequality Created 2026-09-24 Updated 2026-10-18
Hölder's inequality controls a product using separate information about its two factors. If one factor is large on part of a domain, the other factor's complementary Lp norm limits how much their product can accumulate there. The same statement bounds finite sums, integrals and expected values; no independence is required in the probabilistic version.
Let be conjugate exponents, meaning
On a measure space, if and , then and
Here the Lp norms are finite; at exponent the norm uses the essential supremum. For a finite vector, integration with counting measure gives
The first step is the triangle inequality; the second is Hölder's inequality.[ref]
For finite vectors, the endpoint case , is : bound every by its maximum, then sum the . Swapping the factors gives the other endpoint. The choice gives the Cauchy-Schwarz inequality.
If outputs are conditionally independent given , then . Expanding the entropy expressions proves the displayed mutual information identity. The chain rule also gives , while the identity and nonnegativity give the upper bound by their sum. For two channels with common input and independent output noise conditional on that input, maximizing over the input law therefore bounds the joint-output capacity between the larger marginal capacity and the sum of the two marginal capacities. Their unconditional output dependence need not vanish: the subtracted measures information shared through the common input.
Integer partition Created 2026-09-28 Updated 2026-10-14
An integer partition of a nonnegative integer is a multiset of positive integers whose sum is : repetitions matter, but the order of the summands does not. Equivalently, write its parts in decreasing order, allowing equality:
The notation says that is an integer partition of . The partition count counts all integer partitions of , with any number of parts. Zero has one empty integer partition, so . The partition of an integer article develops the same objects in representation theory of the symmetric group.[ref]
Computed example. The seven integer partitions of five are exactly
Thus . Sorting each list of positive summands into decreasing order prevents repetitions in this enumeration. Grouping by largest part verifies completeness: largest parts contribute respectively possibilities. For largest part , the remaining is either or ; for largest part , the remaining uses only and , giving or .
Figure 1.
All seven integer partitions of five, drawn as Ferrers diagrams: each row has as many dots as its part
. Details.
An integer partition keeps sizes without named positions. The compositions of an integer and are different tuples, but sorting either gives the same integer partition . A weak composition of an integer also retains its empty first position; dropping its zero and sorting gives that same integer partition. Conversely, a set partition records which distinct elements belong to each block. For example, the set partitions and differ even though both have the same integer partition of block sizes.
The Ferrers diagram makes an integer partition into a shape. For , the column lengths are : exchanging rows and columns gives its conjugate partition . Exchanging again recovers , so this operation is a bijection. In particular, the three integer partitions of five with at most two parts are , , and ; their conjugate partitions , , and are precisely the three with largest part at most two. This visible symmetry explains the equal counts for these two restrictions. The square-cell version is the existing Young diagram.
Counting by a generating function. An integer partition is determined by its multiplicities , the number of parts equal to . Its size condition is . Consequently its ordinary generating function is
Proof outline. Choose the term from the th geometric series. The product contributes exactly when those multiplicities describe an integer partition of , once for each such integer partition. As a formal power series, each coefficient is determined by finitely many factors: factors with contribute only their constant term to the coefficient of . For , multiplication through gives up to degree five, independently recovering . Restricting the factors gives the generating function for partitions with bounded parts. This is useful because restrictions on summands become choices of factors, while conjugate partitions turn restrictions on numbers of rows into restrictions on row lengths.[ref]
Knight attack graph 2026-10-25
The knight attack graph has one vertex per chessboard square and an edge between squares linked by a knight move. A nonattacking placement is an independent set. Colouring squares by the parity of the coordinate sum makes this a bipartite graph, because every knight move changes that parity. Every vertex has degree at most eight, with fewer attacks near the boundary.
Kullback-Leibler divergence Created 2026-09-24 Updated 2026-10-14
The Kullback-Leibler divergence, also called relative entropy, compares two probability distributions in a specified order. In , observations follow and the comparison probability distribution is : the first argument supplies the averaging weights. For probability mass functions on a finite alphabet,
Here is a random variable with probability distribution . For probability density functions relative to the same measure , replace the sum by . These formulas use natural logarithms unless stated otherwise. The expected value is under , even though appears in the denominator. [ref]
Take and on two outcomes. Direct calculation gives
The second outcome contributes negatively to the first sum: assigning it more probability than does makes its individual contribution negative. Nevertheless, relative entropy nonnegativity guarantees a nonnegative total. Reversing the arguments changes both the likelihood ratio and the averaging probabilities; taking an absolute value inside the logarithm would define a different quantity.
Figure 1.
Direction changes the averaging weights; a missing outcome can make relative entropy infinite
. Details.
The units depend on the logarithm: natural logarithms give nats, whereas base-two logarithms give bits. Divide a value in nats by to obtain bits; the forward example is approximately bits. Changing the base rescales every Kullback-Leibler divergence by the same positive factor. Since the two calculated directions differ, Kullback-Leibler divergence is asymmetric and cannot be a metric. It also need not satisfy the triangle inequality. [ref]
The operational meaning is an expected penalty for using the wrong probability distribution. A prediction incurs log-loss when outcome occurs, the negative of the logarithmic scoring rule. Under , its expected value is the cross-entropy . Predicting with itself incurs information entropy , so
Thus Kullback-Leibler divergence is exactly excess expected log-loss, whenever these separate quantities are finite. [ref]
For lossless source coding, ideal codeword lengths similarly give excess expected length in bits per symbol. Actual prefix codes require integer codeword lengths; Shannon's source coding theorem explains how long blocks approach ideal per-symbol lengths. The interpretation concerns an average, not a fractional physical bit attached to every outcome. In our example, ideal coding with costs one bit per symbol, while bits; the difference is exactly the computed bits. [ref]
Zeros require explicit conventions. An outcome with contributes zero, including when ; the convention agrees with the relevant limit. If but , the Kullback-Leibler divergence is infinite: the predictor has declared impossible an outcome that can occur. On a finite alphabet, the probability support of must therefore be contained in the probability support of for a finite answer. For example, and give , but . For general probability measures, failure of absolute continuity of measures likewise gives infinity. Even does not guarantee a finite integral. [ref]
To see how confidently wrong predictions are punished, hold the true Bernoulli distribution parameter at and vary the predicted parameter . Its binary relative entropy is
It vanishes at , equals approximately nats at , and equals nats at . Both endpoints give infinity because both outcomes remain possible under . Predicting almost no successes is especially costly because successes actually occur three quarters of the time. The reversed binary relative entropy stays finite at the endpoints: its averaging probability distribution concentrates on just one outcome, and assigns positive probability to both.
Figure 2.
Bernoulli relative entropy with true success probability 0.75 and varying predicted probability
. Details.
For model selection, minimizing expected log-loss ranks candidate statistical models by , since is common to them. The true probability distribution is usually unknown, so one estimates predictive performance using fresh observations or cross-validation. Fitting and assessing on the same data can reward overfitting; a small fitted Kullback-Leibler divergence alone does not establish useful prediction.
In variational inference, a tractable trial probability distribution commonly minimizes against a target posterior distribution . Maximizing the evidence lower bound accomplishes this without evaluating the target's normalization constant. The averaging now follows : placing trial probability where the posterior distribution assigns almost none is strongly penalized. The chosen direction and trial family therefore matter. [ref]
These comparisons do not by themselves establish causal inference. Two statistical models can reproduce the same observed probability distribution while predicting different responses to an intervention. Choosing the smaller Kullback-Leibler divergence therefore needs additional assumptions or experimental evidence before supporting a causal claim. [ref]
The original reference is S. Kullback and R. A. Leibler's 1951 paper [ref], published in The Annals of Mathematical Statistics 22(1), pages 79–86. Its title connects this comparison with sufficient statistics: the historical setting was statistical information, before today's widespread applications in prediction and variational inference.
Use lattice paths with north steps and east steps, beginning at . Let be the sum of the horizontal coordinates of its north steps, equivalently the number of unit cells to their left inside the -by- rectangle. A north step in zero-based word position has earlier north steps, so its horizontal coordinate is . The Gaussian binomial coefficient recurrence therefore counts these lattice paths with weight .
For , the words NNEE, NENE, NEEN, ENNE, ENEN, EENN have respective areas . The word NEEN contributes because the two north steps occur at horizontal coordinates zero and two. These paths never move south or west; allowing such extra steps would change the collection being counted.
Machine epsilon Created 2026-10-14 Updated 2026-10-20
Here machine epsilon means the gap from one to the next larger value in normalized floating-point arithmetic:
It is a relative resolution scale near one, not the smallest positive representable value and not a fixed absolute error for all magnitudes. In binary64, gives
where is unit roundoff for rounding to nearest. Some authors instead call their machine epsilon; MIT 18.335J uses this half-gap convention. Always check which definition an error bound uses.[ref]
The gap below one is smaller: the preceding binary64 value is , whereas the next value above one is . Under nearest-even rounding, 1.0 + 2.0**-53 is exactly 1.0: the exact sum is a tie and one has the even final binary digit. By contrast, 1.0 + 2.0**-52 is the next value. Thus searching for the smallest increment that changes one by trial addition also depends on the rounding convention. At the next larger binary64 value is , illustrating why a small absolute increment can disappear at large magnitude.