Jensen's inequality 2026-10-14
Jensen's inequality says that applying a convex function to a weighted mean cannot exceed the same weighted mean of its outputs. For nonnegative weights with and inputs in a convex set,
Nonnegative weights are essential: this is a convex combination, rather than an arbitrary affine combination. For two inputs it is precisely the defining inequality for a convex function; repeatedly grouping inputs gives the finite weighted version.
Take , weights and , and inputs and . Their weighted mean is , so the two sides are
The Jensen gap is . The inequality measures the effect of replacing distinct inputs by one representative input before applying a nonlinear function.
The probabilistic form uses an integrable random variable taking values in an interval where is a convex function. If is also an integrable random variable and belongs to that interval, then
The direction reverses for a concave function. For a strictly convex function, equality in the finite weighted form requires all inputs having positive weight to be equal; in the probabilistic form it requires to be constant almost surely. An affine function gives equality for any admissible distribution. [ref].
For the quadratic function and a random variable with a finite second moment, the difference between the two sides is exactly its variance:
Consider two equally likely values and . Their expected value stays at as increases, but their variance is . Thus the expected value of the square grows from to . For the exponential function, the same two-point distribution gives , while . Both are examples of Jensen's inequality, but their Jensen gaps depend differently on the spread of the inputs.
Figure 1.
Keeping the mean fixed while spreading the inputs increases the average of these convex functions
. The random variable takes and with equal probability. The quadratic function produces a Jensen gap of , exactly the variance. The exponential function produces a Jensen gap of , involving the hyperbolic cosine. The horizontal reference in each panel applies the function directly to the unchanged expected value . Details.
Another useful choice is the concave function on positive inputs. Its version of Jensen's inequality gives . Applying the increasing exponential function shows that the weighted geometric mean cannot exceed the weighted arithmetic mean. For the equally weighted inputs and , these are and . This recovers the arithmetic-geometric mean inequality and illustrates how choosing one function can generate an entire family of bounds.
A short proof idea explains the probabilistic form. If has a subgradient at , the supporting affine function gives . Taking the expected value cancels the linear term because . This argument applies, for example, to finite convex functions on ; more general domains of a function need attention to endpoints and the existence of a subgradient.
Johan Jensen's 1906 paper “Sur les fonctions convexes et les inégalités entre les valeurs moyennes” is an early source for the connection between convex functions and inequalities for means. [ref].
Consider planar horizontal layers with positive scalar intrinsic intrinsic permeabilities , thicknesses , and fractions . Assume each layer is uniform and isotropic, fully saturated by the same Newtonian fluid of constant mass density and dynamic viscosity, with perfect hydraulic contact and steady incompressible flow. Use boundaries that impose pure flow normal to the layers or a common gradient of hydraulic head along them; additional interface resistance and finite-edge effects are excluded.
For vertical flow normal to the layers, every layer carries the same normal Darcy flux by mass conservation. The hydraulic head drops add. Writing and taking positive as the drop along the flow direction gives
This is the thickness-weighted harmonic mean. It is hydraulic head, rather than fluid pressure alone, that accounts correctly for gravity in the vertical calculation. A thin layer of very small permeability of a porous medium can control the whole discharge because all flow must pass through it.
For horizontal flow parallel to the layers, each layer experiences the same gradient of hydraulic head. For width , each area is , and the individual volume fluxes add:
This is the thickness-weighted arithmetic mean. A highly permeable layer can carry most of the horizontal flow because it supplies a continuous route from inlet to outlet. Woessner and Poeter derive both cases for hydraulic conductivity; identical fluid properties allow the common factor to cancel.[ref]
For two equally thick layers, take and , where . The values 1 and 9 are therefore permeabilities in units of , rather than dimensionless intrinsic intrinsic permeabilities. Then
Across the layers, the less permeable half takes of the total hydraulic head drop and the more permeable half only . Along the layers, the more permeable half carries of the total volume flux. At the same magnitude of imposed gradient of hydraulic head, horizontal Darcy flux is times the vertical Darcy flux.
The arrangement thus creates physical anisotropy from locally isotropic ingredients. In coordinates with along the layers and normal to them, the effective permeability of a porous medium tensor is . A driving gradient of hydraulic head with both horizontal and vertical components generally produces a discharge in a different direction. This distinction matters when deciding whether a geological bed conducts aquifer flow along itself or acts as a barrier to flow across it.
Figure 1.
The same two layers give a harmonic mean across them and an arithmetic mean along them
. Details.
Regenerate the diagram by running python ../layered-porous-permeability.py from _media; it writes its PNG into the current directory.
Lossy block averaging 2026-10-13
This toy image compression method stores one rounded arithmetic mean for each disjoint block of grayscale pixels. The quantization rule is round to the nearest integer, with exact halves rounded upward. Each stored value is an unsigned eight-bit integer. Reconstruction fills the original block with that value, a form of nearest-neighbor interpolation. Averaging already discards information; rounding can discard more.
Here is an exact source array. Index rows and columns by and define
The floor function makes constant within each block; the indicator function adds 1 only to its upper-left pixel. All values are integers from 20 to 215. Each block therefore has the exact form
For example, the upper-left block has arithmetic mean and is stored as 40. The block immediately to its right is stored as 52. The complete stored array is specified by for . Its first row is ; its last is .
This toy file format again has eight-bit width and height fields followed by a one-bit mode: 0 means raw eight-bit grayscale pixels, 1 means the rounded block arithmetic means. This profile accepts only width and height 16. The decoder knows the block size and reconstruction rule from the format, reads the 64 stored values in row order, and repeats each across its corresponding block. The original 256 pixels cost payload bits; the 64 stored values cost payload bits. The reduction is . These payload counts exclude the common 17-bit file header; complete sizes are 2065 and 529 bits, or 2072 and 536 bits after final zero padding to eight-bit units. There is no stored codebook or additional prediction rule.
The empirical mean squared error averages squared differences over the 256 original pixel positions:
Every block has the same four errors, so this value is exact in squared stored shade units. If the unrounded arithmetic mean could be reconstructed, the error would instead be ; eight-bit quantization adds . That hypothetical comparison does not count fractional means as free eight-bit values.
The broad shade pattern survives, while the alternating bright and dark pixels vanish. Indeed, a second source with every block constant at produces the identical stored array : exact decoding of both sources is impossible. This makes the storage benefit and the lost detail visible at once. Block averaging is useful for a coarse preview when the individual pixels are dispensable; choosing an acceptable mean squared error or visual result is part of the application, not a guarantee supplied by the encoder.
Figure 1.
Rounded 2 by 2 block means reduce the payload by 75 percent while destroying fine detail
. Details.
Lossy compression 2026-10-13
Lossy compression reduces a representation while permitting irreversible changes to the original. The encoder can map distinct inputs to the same output, so its decoder cannot recover both originals exactly. The useful question becomes how much storage is saved for an acceptable amount of distortion: mean squared error is one numerical criterion, but it does not by itself measure how noticeable a visual change is.
For example, storing the arithmetic mean of four grayscale pixels retains their average shade while discarding their arrangement. Blocks and both produce 50. The former has detail and the latter is uniform, yet the decoder receives the same value. Lossy block averaging makes this ambiguity, its bit saving and its mean squared error exact.
Normal distribution Created 2026-09-24 Updated 2026-10-14
The normal distribution is a probability distribution on the real line with mean and positive standard deviation . Its probability density function is
In the notation , the second parameter is the variance , not the standard deviation . The probability density function is symmetric about , highest there, and integrates to one. These formulas and the parameter convention are given in MIT 18.05, Reading 5c, §5: normal distributions.
The normal distribution is a location-scale family: if is a standard normal random variable, then . Changing moves the center; changing stretches the horizontal distances from it. The reciprocal factor lowers the probability density function as the curve widens, preserving total area. This is why one standard normal distribution suffices to calculate probabilities for the whole family. [ref].
Figure 1.
Normal location and scale change the center and width while preserving total area
. Left: normal distributions with mean zero and standard deviations have respective peak heights approximately , but each has total area one on the whole real line. Right: changing the mean with standard deviation one translates the curve. Both panels show a finite viewing window. Details.
The height is a probability density function value, not . For , the probability is an area, and for every individual . If is measured in some unit, and use that unit, uses its square, and uses its reciprocal; the integral is a dimensionless quantity. A change of measurement unit therefore changes the height without changing the probability. The area interpretation is developed in MIT 18.05, Reading 5b: continuous random variables.
The usefulness of the normal distribution goes beyond its simple shape. Under the central limit theorem, sums of independent and identically distributed random variables with finite positive variance, after centering and scaling, approach the standard normal distribution. Thus approximations by a normal distribution can arise even when the individual random variables have quite different probability distributions. The hypotheses matter: a model of measurement error still needs evidence that this approximation is appropriate. [ref]. Exact closure under a linear combination of independent normal random variables provides another reason the family is convenient.
Historically, the curve appeared in a different problem from fitting measurements. In the 1756 edition of The Doctrine of Chances, Abraham de Moivre reproduces work he dates to 12 November 1733 on approximating sums of binomial distribution probabilities for equally likely success and failure; page 245 already gives the one-sided central area as . [ref]. In his 1809 Theoria motus, Carl Friedrich Gauss derived a normal distribution for measurement error from a condition on the arithmetic mean, then connected maximizing its likelihood to minimizing the sum of squared errors under that model, the principle behind ordinary least squares. These are distinct contributions: approximating binomial distribution probabilities and justifying an estimation rule. [ref].
For a short normalization check, substitute in the integral of . The Gaussian integral gives , so the total area is one. The standard normal density is an even function, giving ; integration by parts gives . Then linearity of expectation and the variance scaling rule applied to yield mean and variance .
True. Suppose a dual feasible solution exists. For every primal feasible , weak duality gives , a finite upper bound independent of . This contradicts primal unboundedness. Therefore an unbounded primal has an infeasible dual. Here “unbounded” arithmetic means a nonempty feasible set with objective values unbounded above, rather than merely an unbounded feasible region.
For a connected undirected weighted graph, a spanning tree connects all vertices without a graph cycle. A minimum spanning tree minimizes the sum of its edge weights. Disconnected input has no spanning tree, although the same methods produce a minimum spanning forest. Negative edge weights and ties cause no difficulty; a tree always contains exactly edges.
The central exchange argument is the minimum spanning tree cut property. Suppose a forest is contained in some minimum spanning tree , and consider a cut with no edge of crossing it. Let be a lightest crossing edge. If , adding it creates a graph cycle; the graph path in between its endpoints contains a crossing edge . That is not in , and . Thus is another spanning tree with no larger weight and still contains . It is also minimum and contains . This proves that the chosen edge is safe, rather than merely asserting a greedy choice.
Kruskal's algorithm sorts all edges by increasing weight, starts with the empty forest, and adds an edge precisely when its endpoints are in different components. Each added edge is lightest across a component cut respected by the current forest. The exchange proof inductively keeps the forest inside a minimum spanning tree; connectedness makes the final forest a spanning tree, hence an optimum. Sorting takes comparisons, and even a simple component-merging implementation takes only polynomial additional work. Efficient component tracking improves that overhead further.
Prim's algorithm instead grows a single tree, repeatedly adding a lightest edge from its vertex set to the outside. The same cut argument proves correctness. A dense implementation using an array runs in comparisons. The dual minimum spanning tree cycle property says a uniquely heaviest edge of a graph cycle belongs to no minimum spanning tree: exchanging it for a lighter crossing edge strictly improves any tree containing it. Ties must be handled carefully; a merely nonunique heaviest edge can occur in an optimum.
Complexity classes are formally classes of decision problems, so use the version asking whether a graph has a spanning tree of total weight at most a supplied threshold . Assume integer or rational weights and threshold are encoded in binary. The input length includes all these bits, not only the numbers of vertices and edges. P consists of decision problems decidable by a deterministic algorithm in time polynomial in that input length. NP consists of those with polynomial-size complexity certificates verified in deterministic polynomial time, equivalently decidable in polynomial time by a nondeterministic machine.
Kruskal's algorithm constructs the optimum and compares its weight with . Binary integer comparisons and sums are polynomial-time operations. Rational comparisons can be made by cross multiplication, and their summed numerator and denominator have polynomially bounded bit length: a product of input denominators has bit length no greater than the sum of their bit lengths. The combinatorial algorithm makes polynomially many such operations. Hence the minimum-spanning-tree decision problem is in P; the optimization version likewise has a polynomial-time algorithm.
For membership in NP, the complexity certificate is a list of selected edges. Check that every edge is present, that the edges connect all vertices and contain no graph cycle, and that their total weight is at most . A graph search and binary arithmetic do this in polynomial time. A successful complexity certificate need not establish that its tree is minimum: it proves the threshold question's yes-answer. Conversely, a yes-instance has such a tree as a complexity certificate. Therefore
Membership in NP does not arithmetic mean NP-hardness; here the explicit greedy algorithm provides the stronger tractability result.
For pure strategy sets and utility functions , a Nash equilibrium is a strategy profile such that
For mixed strategies, replace payoffs by their expectations under independent randomization and allow each player to choose any probability distribution. Since expected utility is linear in a player's own distribution, checking all pure deviations suffices.
Pure equilibria need not exist. In matching pennies, player 1 receives for equal choices and for different choices, while player 2 receives the negative. At an equal pair, player 2 improves by switching; at a different pair, player 1 improves by switching. Thus no pure profile is a Nash equilibrium.
In the ranked university application game, every student must be admitted at a pure equilibrium. If someone were rejected, fewer than the total 50000 seats would be filled, so another university would have a vacancy. Moving there gives positive benefit instead of zero. Consequently all 50 universities have exactly 1000 applicants and admit all of them.
Choose a university with largest arithmetic mean admitted rank and let be its lowest rank. If an outside student of rank moved there, that student would be admitted in place of ; the new arithmetic mean would exceed the university's previous arithmetic mean, which was at least the student's current payoff. This is a profitable deviation. Therefore no higher rank is outside: that university consists of the highest 1000 ranks. Remove that block and repeat with the remaining university of largest arithmetic mean. At each step the same argument excludes omitted higher ranks from the remaining set. The admitted cohorts are necessarily the consecutive blocks
Conversely, assigning these blocks to labelled universities is an equilibrium. A student moving to a higher block is rejected. A student moving to a lower block displaces its lowest rank; all the other admitted ranks there are below every rank in the student's original block. Comparing the two arithmetic means with that student's own rank held fixed shows a strict loss. Thus every block assignment is an equilibrium, and the preceding argument excludes all other pure ones:
There is more than one further mixed equilibrium. We give two genuinely mixed profiles, rather than count the pure equilibria as degenerate mixed ones. First, let every student apply independently and uniformly to all 50 universities. For each fixed student the other players' distribution is invariant under every permutation of university labels. All 50 pure applications therefore give the same expected utility. Uniform mixing is a best response, so this is a Nash equilibrium.
For a distinct mixed equilibrium, assign each of the 48 highest consecutive rank blocks deterministically to a different university. Let each of the lowest 2000 students independently choose either of the two remaining universities with probability . For a low-ranked student these two universities have identical expected utility by label symmetry, and that payoff is positive: there is a positive-probability event on which the student is admitted. Applying to one of the 48 full higher-ranked blocks would guarantee rejection. Hence the specified mixture is a best response.
For a student in a deterministic higher block, moving to another deterministic block loses by the pure-equilibrium comparison above. It remains to rule out a move to a mixed university. Let the student's own block start at , and let their rank be . Their present payoff is . The number of low-ranked applicants at a specified mixed university has a binomial distribution with parameters , and the higher-ranked deviator is always admitted. If , all other admitted ranks are at most 2000, so the new arithmetic mean is at most , and thus at most . If , it is . Therefore the expected deviation payoff is at most
because the gap without the last term is . No such deviation improves the payoff. This proves a second mixed equilibrium, with only the lowest 2000 students randomizing. It is visibly different from the fully uniform profile. In particular,
Take and . Write in phase and . Here is the positive conductivity flux; physical heat flux is . Continuity of temperature on a planar interface implies continuity of its tangential derivatives, while conservation gives continuity of normal heat flux. With interface normal , these conditions are
The mean gradient is . Therefore
By the definition of effective conductivity, . Thus
The laminate conductivity is a weighted harmonic mean across the layers and a weighted arithmetic mean along them. This also explains why isotropic constituents can yield an anisotropic thermal conductivity tensor: flux must cross each resistance in sequence in the normal direction, whereas tangential transport occurs in parallel.
For disjoint nonempty vertex sets , write . A regular pair of vertex sets is -regular if every with , satisfies .
The Szemerédi regularity lemma states that, for every and integer , there are such that every finite simple graph on vertices has a set partition
with , , , and at most irregular unordered pairs among the nonexceptional classes. Prove it for ; larger parameters follow by using a smaller one.
For the energy-increment proof of Szemerédi regularity, keep every exceptional vertex as a singleton cell in the set partition used to measure regularity energy. Define the equitable regularity energy
The sum is ordered, and on diagonal cells subset density means the average of the adjacency indicator, with zero on loops. Thus . If are refined into , expanding squares gives
The cross term vanishes because the weighted arithmetic mean of the refined subset densities is the original subset density. Consequently every refinement of a set partition increases or preserves regularity energy.
Suppose the current nonexceptional classes have common size and there are of them. For each irregular pair , choose witnesses of sizes at least and discrepancy greater than . Refine each class by all its incident witness subsets. There are at most cuts in each class and at most resulting atoms. The witness rectangle is a union of refined rectangles. By the Cauchy-Schwarz inequality, its contribution to the variance identity is at least
Indeed, the sum of squared deviations on the witness rectangle is at least its total weight times the square of their weighted arithmetic mean. If more than unordered pairs are irregular, summing even just one orientation of each gives
provided the exceptional set has at most vertices. This is the strictly positive regularity energy increment.
Restore equal class sizes without losing that increment. Divide every witness atom into blocks of size and make every leftover vertex an exceptional singleton. This is a further refinement of a set partition, so it cannot decrease . There are at most atoms, hence fewer than newly exceptional vertices. If , then , so the number of full blocks is at most . Each original class produces at least one full block: its leftovers occupy less than , whereas . Thus the new class count is at least .
Choose , and choose an initial integer large enough that . Initially partition into equal classes and fewer than exceptional vertices. Take large enough that this initial exception is at most . During at most rounds, the additional exception is at most , so it never exceeds .
A bound on class counts is obtained by iterating at most times starting at ; call the resulting bound . Increasing further to satisfy guarantees at every round, so all full-block constructions are valid. If the desired regularity had not been reached after refinements, the regularity energy increments would total more than one, impossible. Therefore the process terminates with the required partition and bounds. The singleton treatment of discarded vertices is what preserves regularity energy monotonicity during equalization.
The arithmetic-geometric mean inequality gives
By induction these inequalities hold at every step, so is increasing and bounded above by , while is decreasing and bounded below by . The bounded monotone sequence theorem gives limits with . Taking limits in the arithmetic mean recurrence gives , whence . Thus both sequences converge to the same positive limit, the arithmetic-geometric mean iteration's limit. No elementary closed formula for that limit is needed.