Section 9.21 documents the arithmetic mean computed by AVG, ignored null inputs, and the result for an empty input.
Amplitude amplification Created 2026-09-24 Updated 2026-10-13
Amplitude amplification increases the probability of obtaining an answer accepted by a specified Boolean function. It requires a coherent preparation , its inverse, and a marked-state phase oracle that negates accepted components. Alternating that sign change with a reflection operator about the prepared state directs interference toward the accepted subspace. Brassard, Høyer, Mosca, and Tapp developed the general framework, extending Grover's algorithm beyond a uniform quantum superposition. [ref].
If a normalized quantum state has good amplitude , the product of the reflection in the bad axis and the reflection in the state line rotates its good-bad plane by . After iterations the good probability is
so iterations raise a small good amplitude close to one. Success subsequently oscillates, making the stopping time part of the algorithm.
Compute the exact Grover search on four entries directly. Order the computational basis as and mark . The Hadamard transform prepares amplitudes . The marked-state phase oracle changes these to , whose arithmetic mean is . The Grover diffusion operator performs inversion about the mean:
The three unmarked amplitudes become , while the marked amplitude becomes . All three stages have squared norm one. Here , so and one iteration gives , agreeing with the explicit calculation.
Figure 1.
One Grover iteration on four states: a phase flip followed by reflection about the mean concentrates all amplitude on the marked state
. Details.
Grover's original search paper was submitted on 29 May 1996; its algorithm combines selective sign changes with inversion about the mean. The example exposes the beauty of that construction: a change initially invisible to computational-basis measurement becomes complete cancellation of every wrong answer. [ref].
The marked-state phase oracle is an assumed operation, whose implementation cost must be counted. Computational-basis measurement yields a candidate label, here ; using it to retrieve a record requires the relevant data access. Preparing a quantum superposition does not make all its entries available as classical outputs. The improvement concerns the number of oracle queries needed to obtain an accepted label.
Arithmetic-geometric mean iteration Created 2026-10-07 Updated 2026-10-14
Starting from , replace the lower endpoint by the geometric mean and the upper endpoint by the arithmetic mean. The arithmetic-geometric mean inequality gives . The bounded monotone sequence theorem gives limits, and the arithmetic recurrence forces them to coincide. The limiting value is the arithmetic-geometric mean of the initial pair.
Arithmetic mean Created 2026-09-24 Updated 2026-10-14
For a nonempty finite list of real numbers , the arithmetic mean is
It is the weighted mean with equal weights, giving each observation equal influence. For , the sum is and the arithmetic mean is . Replacing every value by retains the same total. The residuals sum to zero, so the mean is also the balancing point of these equally weighted observations.
The arithmetic mean minimizes the sum of squared deviations by the weighted mean minimizes squared deviations identity with all weights one. A large input can consequently have a substantial effect: replacing by changes the mean to , while the median remains . The choice of summary depends on what aspect of the data matters.
Arithmetic progression Created 2026-09-24 Updated 2026-10-18
An arithmetic progression is a sequence with a constant common difference between consecutive sequence terms. It has the form and is nonconstant when . Using for the common difference and numbering the first sequence term as , its explicit and recursive descriptions are
The explicit formula reaches any position directly; the recurrence reaches the next position from the current one. The factor counts the steps after the first entry. For real , a positive common difference makes the sequence increase, a negative one makes it decrease, and zero makes it constant.[ref]
For an original example, start at seven and add three each time:
The eighth entry is : eight sequence terms require seven increments. This counting principle makes arithmetic progressions useful for regularly spaced positions, repeated equal additions, and iteration over evenly spaced integers. The values need not be integers; starting at with common difference gives .
A geometric progression instead holds a ratio constant. In the displayed arithmetic progression, and differ even though . Multiplying each entry by two would give a different kind of repeated update from adding three. Distinguishing the two rules matters before predicting later entries or adding the sequence terms.
Equal differences also appear in Nicomachus's treatment of arithmetic proportion. He describes successions of at least three numbers whose neighboring differences agree, then explains how regularly omitting counting numbers changes the common gap. This connects the progression to the arithmetic mean: a middle entry is equally far from its two neighbors.[ref]
Arithmetic series 2026-10-18
An arithmetic series adds the sequence terms of an arithmetic progression. Its -th partial sum is , with the empty sum convention . For ,
Thus the total is the number of sequence terms multiplied by the arithmetic mean of the two endpoints. The formula also covers decreasing and constant arithmetic progressions.[ref]
For the eight-entry example, the sum is , and the arithmetic mean of all eight entries is . A decreasing example gives . Negative values cause no algebraic difficulty: has sum .
The triangular number is the special case , giving . More generally, an equal increase in each successive allocation makes the total grow as a quadratic function of the number of allocations. The eight-entry example has
Its first four entries add to , its first eight to , and its first twelve to . The sequence terms lie on a straight line when plotted against their sequence indices, while the partial sums follow a quadratic function.
Figure 1.
Constant common differences produce linear sequence terms and quadratic partial sums
. Original example . Dots represent integer sequence indices; connecting lines and the smooth quadratic function show the formulas between sample positions. The right panel includes the empty sum . Details.
The arithmetic mean of memory access latencies. Suppose each read completes before the next begins, every cache hit costs , and every cache miss costs , with the same additional cache miss penalty . If is cache hit rate and is cache miss rate, the weighted arithmetic mean is
The common lookup cost is paid on both outcomes. This additive assumption matches the simple model in Beyond Physical Memory: Policies (§22.1, equation 22.1, pp. 1–2), where main computer memory acts as a memory cache for memory pages backed by disk; here the same accounting is applied to a toy data memory cache.
Assign synthetic values and . The twelve-read, two-slot fully associative cache example has five cache hits and seven cache misses, giving
With four cache slots, its four compulsory misses instead give . This comparison holds the timing costs fixed as capacity changes, which is a model assumption rather than a hardware promise.
If a problem supplies a total miss time , use ; adding to again would count lookup twice. Variable cache miss penalties, multiple consulted levels, or overlapping requests require a richer timing model. Real CPU work can overlap a pending read, so this arithmetic mean cannot by itself predict program speed or stall time. [ref]
Average value of a function Created 2026-10-14 Updated 2026-10-18
For an integrable function on an interval of positive finite length, its average value is the integral divided by that length:
If is constant on equal-length subintervals, this is their values' arithmetic mean; unequal lengths require a weighted mean. For example, values and on two equal halves give average value , whereas value on the first quarter and on the remaining three quarters give . The integral measures total contribution; the average value of a function divides out the interval length.
For the function on , the average value of a function is . Replacing it by the constant preserves its integral on this interval. This is why the Haar projection uses cell averages to obtain a coarser description while retaining each cell's total contribution.
Binary selection mask 2026-11-05
A binary selection mask records which pixels belong to a chosen subset of an image. On a finite pixel grid , it is the indicator function
It can represent an area region of interest, the result of image thresholding or a combination of selection rules. The mask describes membership; its entries need not equal the underlying image intensities.
For a selected pixel count , the count and selected arithmetic mean are
Consider the original arrays
The selected values are 0, 20 and 40, so and . The selected zero-valued pixel still contributes to the denominator. Replacing excluded pixels by zeros and averaging all six entries would instead give : that asks a different question. An empty mask has , so this selected-mean formula is undefined.
For rectangular pixels with calibrated dimensions and , the complete-pixel area from a calibrated pixel count is . These are stipulated array values and cell dimensions, not a measurement of an object.
A stored mask can use another two-value encoding. ImageJ's Create Mask command stores 255 inside an area selection and 0 outside, corresponding to in this model.[ref] Summing gives 765 in the example, rather than the selected count 3. Convert the encoding or count selected entries before interpreting a sum as an area.
Two normalized masks and combine by set intersection through . Their complement within the specified grid is . Record the foreground-background polarity, coordinate alignment and grid extent when transferring a mask between images.
The bundle material area fraction is the fraction of a stated bundle envelope occupied by strand material in a specified transverse section:
Here includes spaces between material fibres, while excludes them. Count each strand area once and state how the envelope is drawn. A tighter envelope can increase without adding material. For parallel prismatic strands and a constant envelope over common length , the corresponding volumes are and , so the volume fraction equals under those assumptions.
An original two-strand example shows why an average diameter is insufficient. Take circular strand radii and , inside a stipulated envelope of area . Then
Replacing both radii by their arithmetic mean would give and , underestimating the material area by twenty percent. Area depends on the mean squared radius, not merely the square of the mean radius.
For straight, equally strained strands of a common Young's modulus , the axial stiffness is . Dividing the measured rigidity by instead gives the envelope-based effective modulus , rather than the strand material's . This uses the uniform-bar relation applied to parallel strands.[ref]
A physical estimate can image a transverse section, establish measurement calibration for image lengths, identify the strand boundaries and calculate both areas from the same section. State section orientation: an oblique image is not automatically a perpendicular-area measurement. Distinguish spaces between strands from internal voids within a strand if the intended quantity is solid material area. Changes of envelope convention or classification must not be mistaken for changes in material quantity.
Categorical distribution Created 2026-09-24 Updated 2026-10-14
A categorical distribution describes one trial with one of labelled outcomes and probabilities summing to one. The labels need not be numbers or have an order. It is the single-trial building block of the multinomial distribution: independent draws with the same categorical distribution produce multinomial category counts.
For a trial choosing labels with probabilities , the category-indicator random vector is , , or . Its expected value is ; its components are dependent because exactly one is one. A numerical encoding of is a separate modelling choice: the category labels themselves do not define an arithmetic mean.
Centering matrix 2026-11-05
The centering matrix subtracts the arithmetic mean from every component of a real vector. For a positive integer , let have every component equal to one and define
For , write . Then , so . The output lies in the subspace of vectors whose components sum to zero.
Its orthogonal projection properties follow directly. Set . Since , we have and hence
Thus is a symmetric idempotent matrix, the orthogonal projector onto . It kills constant vectors and leaves zero-sum vectors unchanged. Its kernel of a linear map is and its rank is ; for it is the zero matrix. The eigenvalues are zero on the constant direction and one on its orthogonal complement.
For an original example, has mean , giving . The centered sum of squares is
For these four observations, the usual sample variance is . Centering removes the mean; it does not itself divide by a standard deviation.
For a data matrix with observations in its rows, centers each column. When , its sample covariance matrix is . Also for any scalar , which proves invariance to adding the same offset to every observation. These identities make the centering matrix useful in least squares and principal component analysis.
Centroid Created 2026-10-14 Updated 2026-11-05
The centroid of a region with finite positive volume is the average of position with respect to uniform volume:
provided the component integrals exist. For a planar region use area in place of volume; for finitely many equally weighted points use their arithmetic mean. The centroid of a uniform triangle is in terms of its vertex position vectors, the intersection of its medians of a triangle. For nonuniform mass density, weighting the same integral by density instead gives the center of mass. The vertex centroid of a general polygon need not equal the centroid of its filled interior.
Cesàro mean Created 2026-09-24 Updated 2026-10-14
The Cesàro mean of the first terms of a sequence is their arithmetic mean. It is a cumulative average: increasing includes the whole initial segment, rather than a fixed-length sliding window. For , the even-length averages are zero and the odd-length averages are , so they tend to zero even though the sequence does not converge.
For a periodic sequence with period and one-cycle arithmetic mean , split an initial segment into full cycles and a remainder of fewer than terms. The full cycles contribute exactly per term; the remainder contributes a fixed bounded error divided by . Thus the Cesàro means tend to . The cycle in the bounded partial sums need not be Cesàro summable illustration has arithmetic mean one. Treating it as a sequence of partial sums gives a series with first-order Cesàro sum one; averaging a sequence and summing its terms remain different operations.
Cesàro summation 2026-10-14
Cesàro summation assigns a value to a series when the arithmetic means of its partial sums approach a finite limit of a sequence. Here we use the first-order method, often written . For a real or complex series beginning at index zero, define
It is Cesàro summable to when . The averaging is applied to the partial sums , rather than to the original terms . This distinction is essential: the terms can average to zero while their accumulated sum keeps growing. [ref]
For Grandi's series , the partial sums alternate between one and zero. The series is not a convergent series, but the two values occupy asymptotically equal proportions of the averaging window. In the declared index convention,
so its first-order Cesàro sum is . This names a particular summation method; it does not turn the oscillating partial sums into an ordinarily convergent sequence.
Figure 1.
Cesàro summation succeeds for Grandi's series, but first-order averaging fails for
. Original exact partial sums and Cesàro means, with the first term indexed by zero. In the second row, the even and odd subsequences of the averages have different limits. Details.
Why is this useful? An oscillating approximation can retain stable information when its cumulative average settles. Because the Cesàro theorem for convergent sequences preserves an existing limit of a sequence, this adds some new cases without changing the sum of any ordinarily convergent series. For Fourier series, averaging the Fourier partial sums gives a Fejér sum; the existing Fejér kernel and approximation articles explain its effect on reconstruction. Averaging does not guarantee success for every oscillating sequence, as the bounded partial sums need not be Cesàro summable example shows.
One historical motivation was the multiplication of series. In 1918, A. F. Andersen recalled Ernesto Cesàro's product theorem and cited his 1890 publication at the start of a study of products involving Cesàro summable series. This connects the theory with preserving useful operations on sums, as well as with assigning a value to an isolated example. His paper treats several orders of summability; the examples here use only .[ref]
Let be the Bernoulli distribution with success probability and the Bernoulli distribution with success probability . For ,
The two summands have product . Their arithmetic mean is at least their geometric mean, with equality at . Thus
The same argument gives for complementary parameters . At the laws agree and .
Figure 1.
Chernoff affinity and Chernoff information for two complementary coin laws
. Original computed example, with success probabilities and . The affinity is minimized at ; the best negative-log affinity is . Details.
With equal prior probabilities, count the successes among observations. The likelihood ratio is , so choose when and when . If is even, either decision or a fair tie randomization gives the same average error at . Under , has the binomial distribution with parameters . Symmetry therefore gives the exact optimal average error
The last term applies only for even ; it represents half the tie probability. Direct finite sums give , and . Twenty observations reduce the optimal average error to about 0.158%. The finite-sample Chernoff error bound at is , a guarantee rather than the exact error.
Figure 2.
Exact repeated-coin error, the finite-sample Chernoff error bound, and the limiting error exponent
. Original finite-binomial calculations under two fixed independent coin laws with equal priors. The first panel uses a logarithmic scale. The normalized negative log error approaches ; finite-sample error need not equal the simple exponential. Details.
Reducing the exact error from to illustrates the value of repeated evidence. The example assumes a single fixed coin law throughout the experiment. If repeated sensor readings share an unmodelled common error, increasing their number need not supply this much independent information.
The continuous angular geometric mean of the positive boundary complex modulus is
Here the empty product is one. This differs from the angular arithmetic mean . In general by the concavity of the logarithm; equality requires constant boundary complex modulus. For a holomorphic function with no zeros of a function in the closed disk, Jensen's formula gives , even when the boundary complex modulus varies with angle. Thus replacing the mean of a logarithm by the logarithm of an arithmetic mean loses the exact zero identity.
Combining means of groups Created 2026-10-14 Updated 2026-10-25
Suppose disjoint nonempty groups have sizes and arithmetic means . The arithmetic mean of all observations is
Each group contributes the sum ; add those totals before dividing by the overall count. This is exactly a weighted mean of group means with weights equal to group sizes. [ref]
Take a synthetic example with two observations equal to and eight equal to . The two group means are and , and the combined mean is . Giving the two groups equal weights instead produces , which summarizes the two group means with equal influence. To summarize all ten individuals with equal influence, use their group counts.
Figure 1.
Group size determines each group mean's influence on the combined individual mean
. Two synthetic observations are and eight are . Their combined arithmetic mean is ; the equal-weight average of the two group means is . Details.
The group means and counts determine the combined arithmetic mean, but do not generally determine the combined variance. Variation within the groups is additional information.
Computer programming 2026-11-05
Computer programming constructs, tests and revises programs that express computations in an executable or interpretable form. It connects a problem specification to data representations, algorithms, interfaces and error handling. Writing syntax is one part; deciding what results and failures should mean is also part of the task.
For example, computing an arithmetic mean requires representing the observations, accumulating their sum and dividing by the count. The computer program must also define what happens for an empty input, unavailable data or a number representation that cannot hold an intermediate result. Choosing an algorithm and testing ordinary examples does not automatically settle those boundary cases. A useful implementation makes its assumptions visible and supplies evidence through tests, analysis or proofs appropriate to the claim.
Convex function Created 2026-09-24 Updated 2026-10-14
A function on a convex set is a convex function if, for every and ,
Geometrically, a line segment joining two points of its graph of a function lies on or above that graph of a function. The convex set condition ensures that the intermediate input stays in the domain of a function. An affine function satisfies the defining inequality with equality.
For the quadratic function , the inputs and have equally weighted arithmetic mean . Evaluating at the arithmetic mean gives , whereas averaging the outputs gives . Averaging first saves one unit in this example. More generally, direct expansion gives
This identity proves convexity and also shows exactly when its defining inequality is strict.
Figure 1.
The graph of a convex quadratic lies below its endpoint interpolation and above its supporting tangent
. For , the line segment through and has height at , while the graph of a function has height . The tangent line is an affine minorant: everywhere. Details.
For a differentiable convex function, the tangent line in one dimension, or the corresponding supporting affine function in several dimensions, lies below the entire graph of a function. This is the subgradient inequality. The equivalent geometric statement is that the epigraph, consisting of points on or above the graph of a function, is a convex set. These characterizations are developed in Boyd and Vandenberghe's convex-function slides, sections 3.1–3.4.
Convexity does not require differentiability: the absolute value function is a convex function with a corner at . When a function is twice continuously differentiable on an open interval, it is a convex function exactly when its second derivative is nonnegative throughout that interval. In several dimensions, the corresponding criterion on an open convex set is that its Hessian matrix is positive semidefinite everywhere. The domain of a function matters: is a convex function on , but not on all of . A strictly positive second derivative is sufficient for strict convexity, but is not necessary: is a strictly convex function although its second derivative vanishes at .
The usefulness of convexity is that local information can certify a global conclusion. Every local minimum of a convex function on a convex set is a global minimum: if a lower value existed elsewhere, the defining inequality would produce lower values arbitrarily close to the proposed local minimum. For a differentiable convex function on an open convex set, a zero gradient therefore certifies a global minimum. Strict convexity gives uniqueness when a global minimum exists; it does not supply existence by itself. These facts explain the role of convex functions in convex optimization.