For an integrable periodic function of period , its integral over an interval of length is independent of the starting point. Write with an integer and . By a change of variables and the defining identity of a periodic function,
No differentiability is required. This also allows the Fourier coefficients of a periodic function to be computed on any interval of one full period.
Trial division 2026-10-14
Trial division searches for divisors of an integer by testing candidate divisions. For primality testing of an integer , testing the prime numbers up to suffices: any composite number has a prime factor in that range. After finding a prime factor, repeated division removes its prime power, and testing the remaining quotient gives an elementary integer factorization method. This is useful for small inputs, but the number of candidates can grow rapidly with the input's digit count.
Factor a positive integer while multiplying the exponent-plus-one contributions to its divisor count. After removing all prime factors below the current trial factor, a trial factor that divides the remainder must itself be prime. Remove its full power and advance. Once the trial factor's square exceeds the remainder, any remainder greater than one is prime and contributes a factor two. The invariant separates the original integer into removed prime powers and the remaining coprime factor; no factor array is necessary.
Truncation toward zero 2026-10-14
Truncation toward zero removes the fractional magnitude of a real number, giving the integer obtained by applying the floor function to its absolute value and restoring the original sign; a magnitude below one gives zero. More precisely,
The result is zero for . For example, and , whereas . Python's math.trunc uses this towards-zero convention, so replacing it by math.floor changes calculations with negative noninteger inputs. [ref].
Figure 1.
Truncation toward zero is symmetric in sign, while the fractional part defined by the floor function is always nonnegative
. Left: exact integer endpoint values distinguish the two sign-dependent truncation rules; a whole neighborhood of zero maps to zero. Right: takes the sign of a noninteger input, while lies in on both sides of zero. Open endpoints show excluded limiting values. Details.
For every real number ,
The discarded difference has the sign of when is noninteger. In contrast, the fractional part is always in . At , these two differences are and . Thus specifying a signed fractional remainder requires specifying which integer-valued operation is used.
Unlike the floor function and ceiling function, truncation toward zero need not commute with adding an integer. At and , , whereas . This matters if negative coordinates are assigned to equal-width bins by converting a quotient to an integer: belongs to the bin under the floor function, but truncation gives zero. The appropriate operation follows from the declared bin intervals.
Truncation toward zero is a nondecreasing function with a discontinuity of a function at each nonzero integer. It has no discontinuity of a function at zero, because it is identically zero on . Its agreement with the floor function on the positive side and the ceiling function on the negative side explains the different closed endpoints in the diagram.
Turán graph Created 2026-09-29 Updated 2026-10-14
The Turán graph is a complete multipartite graph with independent sets of sizes differing by at most one, with every cross edge present. Empty parts are allowed when .[ref]
Figure 1.
The Turán graph has three independent sets of sizes , giving edges and no four-vertex clique
. Details.
In this example, the independent sets are , and . Count the edges between each pair of parts:
Any four vertices put at least two in the same independent set, by the pigeonhole principle, so they cannot form . Conversely, every choice of one vertex from each part is a triangle in a graph, giving triangles in a graph. Clique exclusion here does not mean triangle-free.
For the exact count, Euclidean division writes , where uses the floor function and is the remainder, with . There are parts of size and of size . For any part sizes summing to , count cross edges by expanding the square:
Therefore
For , we have , giving . The Quadratic Turan edge bound gives instead: the exact correction subtracts .
Balancing is an integer optimization with a simple reason. If two part sizes satisfy , moving one vertex from the larger part to the smaller decreases their contribution to the sum of squares by
so it increases the edge count by . For eight vertices, parts give edges; moving one vertex produces and edges. The most symmetric permitted sizes pack the most cross edges, which explains the sharp construction in Turán's theorem.
Turán's theorem Created 2026-10-14 Updated 2026-10-14
How many edges can we retain while excluding a prescribed clique? For integers and , every simple graph on vertices containing no complete subgraph satisfies
Equality holds exactly for the Turán graph , up to graph isomorphism. Thus the extremal number is .[ref]
For example, has independent sets of sizes and edges, as counted in Turán graph. It contains triangles in a graph, but no four-vertex clique. Consequently any simple graph on eight vertices with edges contains , while edges alone do not force one. Excluding larger cliques permits denser graphs; Mantel theorem is precisely the first nontrivial case.
A short proof outline uses Zykov symmetrization. If an extremizer is not a complete multipartite graph, it has vertices with absent and present. If either or has larger vertex degree than , clone that vertex in place of . Otherwise replace both by nonadjacent clones of , gaining edges. Both contradict extremality; balancing the resulting at most parts gives .[ref]
The vertex cloning in a graph step preserves clique exclusion because any clique using a clone can substitute its original vertex; nonadjacent clones cannot occur together in a clique. At most parts can be nonempty, since selecting one vertex from each gives a clique. If fewer than parts are nonempty and one has at least two vertices, splitting it creates more edges, so it cannot be extremal. For the bound is zero. For , the Turán graph is , and the bound is the total possible edges.
For coprime integers , the Frobenius number is . Every larger integer is a nonnegative integer linear combination of .
For , , the two-isogeny formula companion is . With the positive-sign standard isogenies, the two preimages of under the dual are and . The two-torsion square-class homomorphism on detects membership in the image of the forward isogeny of elliptic curves by the class of . Thus either preimage lifts precisely when its first coordinate is a rational square. Their being integers turns rational squareness into integer squareness.
Type class Created 2026-09-28 Updated 2026-10-25
The type class contains all length- strings with empirical distribution . Each must be a nonnegative integer and the counts must sum to ; otherwise the class is empty. Distinct type classes partition : every string belongs to exactly one class.
For four binary symbols there are five type classes, indexed by the number of ones. Their cardinalities are , which sum to . The balanced class contains exactly . These are six different strings, not six different empirical distributions.
Figure 1.
Sixteen binary strings form five type classes
. An exact enumeration of all four-symbol strings. Each column fixes the number of ones; the central column has six orderings of the same empirical distribution. Details.
Type system 2026-10-13
A type system assigns types to program expressions and supplies rules governing their use. A type constrains permitted operations: in our teaching programming language, int admits integer addition, bool supplies true and false for conditions, and a function type specifies an argument type and a result type. Storage as bits alone does not explain these distinctions; the type system determines whether an expression can serve as an argument, a condition or an operand.
A typing judgment says that expression has type under the assumptions in the typing context . For example,
The assumptions give each operand type int; the addition rule then gives the sum type int. Changing to type bool prevents this derivation. Our teaching programming language has distinct int and bool types and no implicit conversions between them.
The conditional rule requires a Boolean condition and the same type for both branches:
Thus if true then 1 else 2 has type int, while if true then 1 else false is rejected: its branches would require and simultaneously. Even a branch that will not execute is checked by this rule. This is a rule of this particular type system; a different programming language can choose different rules. [ref]
The useful feature is compositional reasoning: after checking the parts, a rule explains how to check the whole. The function type diagram shows this for a call. Type inference can discover the required types automatically, and type variables let one express relationships that recur across many concrete types. The result is both a practical early error detector and a small, readable derivation explaining why an expression fits its intended use.
The guarantee depends on the rules and execution model. Type safety can exclude specified failures such as adding a Boolean or calling an integer as a function. It does not by itself establish every desired runtime property or guarantee that execution terminates. A type system that permits unrestricted recursion can accept a computation that runs forever; exception handling also needs its own account of permitted outcomes.
Ulam sequence 2026-10-20
Starting with two distinct positive integers , repeatedly append the smallest integer larger than the previous term that is expressible in exactly one way as the sum of two distinct earlier terms. Requiring distinct summands and counting unordered pairs are both essential parts of the definition.
Ultrametric space Created 2026-09-24 Updated 2026-10-14
An ultrametric space is a metric space whose metric satisfies the ultrametric inequality. The rational numbers with , and their P-adic number completion, are examples. Their geometry organizes points into nested clusters rather than measuring separation along a number line.
For integers and , the definition of the P-adic valuation gives
Thus a closed ball of radius in the integers is a congruence class modulo . In the p-adic integers the same closed ball is . More shared low-order digits mean a smaller p-adic absolute value of the difference.
Figure 1.
The integers from zero to fifteen form nested congruence classes modulo powers of two in the 2-adic absolute value
. Details.
The binary tree first splits the sixteen integers into even and odd congruence classes, then refines modulo , , and . Each node fixes one more low-order digit. The leaves and share the class modulo , then separate modulo , so their distance is exactly . The leaves are deliberately ordered by their low-order digits; horizontal spacing and edge lengths are layout choices, not the metric. The singleton leaves describe this finite sample; a congruence class modulo in all p-adic integers remains infinite.
The ultrametric inequality also explains the unusual behavior of balls. Every point of an open ball can serve as its center: if , then if and only if . Two open balls that intersect are nested, since a point of their intersection serves as a common center and their radii can be compared. The same nesting rule holds for closed balls and for a pair consisting of one open ball and one closed ball.
Every open ball is a clopen set. For a point outside , the open ball stays outside : if , the ultrametric inequality forces . Hence the complement is an open set. Also every closed ball of positive radius is an open set, because lies in the closed ball of radius around whenever . A radius-zero closed ball is a singleton and need not be an open set. Distinct points can therefore be separated by a clopen set, proving that an ultrametric space is totally disconnected. These ball properties turn distance thresholds into a hierarchy of compatible clusters. [ref]
Unary numeral system 2026-10-31
Represent a nonnegative integer by , using delimiters when several quantities are encoded. The length is , rather than the length of a binary numeral system representation. Despite the parent category for numerical notation, this is not a positional base-one place-value system.
Unbounded element orders in imaginary quadratic ideal class groups Created 2026-10-25 Updated 2026-10-31
For every positive integer , some imaginary quadratic field has an ideal class of order of a group element greater than . Specifically, take a prime number with . In , the Dedekind factorization theorem gives , with distinct prime ideals and of ideal norm five. If for , the field norm equation forces . Then is even and , contradicting unique factorization of ideals in a number field. Thus has order of a group element greater than . The existence of suitable follows from Dirichlet's theorem on arithmetic progressions.
Uniform convergence Created 2026-09-24 Updated 2026-10-14
A sequence of functions converges uniformly to , where is a metric space with metric , precisely when
For real numbers, use the absolute value . Compare the universal quantification and existential quantification:
The decisive change is whether can depend on . Uniform convergence implies pointwise convergence.[ref]
For functions taking values in real numbers on a nonempty domain of a function, the supremum error is , allowing . Then uniform convergence is equivalent to . The supremum need not be a maximum: pointwise strict bounds below only give , so use tolerance when proving this equivalence. This single error bound controls every possible input, including one chosen after seeing the index.
For and its pointwise limit on , the error is zero at one but approaches one as from below. Consequently
for every positive integer . This supremum is never attained: below one the error is , and at one it is zero. Deleting the endpoint leaves the same supremum error on . To disprove uniform convergence directly, choose : for any proposed , take and . The error equals , violating the strict tolerance. Thus a moving input defeats every proposed common threshold.
On the smaller interval , for a fixed , the pointwise limit is zero and
For and , the exact first successful common threshold is
The logarithm and floor function turn an infinite approximation statement into a finite stopping rule. At , fails tolerance , while succeeds. At and , the ratio is exactly three: is necessary because equality is insufficient. For , every error is zero. The domain of a function determines whether one threshold can certify every input.
Figure 1.
Supremum error and common thresholds distinguish uniform convergence from pointwise convergence
. Left: the error of remains one on and , but falls below from onward on . Right: the first successful threshold at a fixed input grows without bound near one. A common threshold covers all inputs at most . Both vertical axes use a logarithmic scale. Details.
For another explicit stopping rule, let on . Its uniform limit is zero and its supremum error is . For every , works, using the ceiling function. Unlike on , it controls even the endpoint.
The practical beauty of uniform convergence is that one quantitative bound can survive further operations: the uniform limit theorem preserves continuity, and uniform convergence preserves integrals on a compact interval controls accumulated error. Differentiation needs additional hypotheses, such as uniform derivative convergence with an anchored value. These results distinguish an approximation that looks accurate at selected inputs from one that justifies replacing a whole function in a calculation.
Uniformly continuous function Created 2026-09-24 Updated 2026-10-18
A uniformly continuous function has one input tolerance valid throughout its domain of a function. For , with , uniform continuity means
Choose the output tolerance first, then a positive valid for every pair of function inputs. It may depend on , the function and its domain of a function, but not on the pair’s location. The absolute values measure input and output distance.[ref]
Compare the quantifier order with the epsilon-delta definition of continuity:
Both lines end with . In the first, can depend on the point ; in the second, it is chosen before . Thus uniform continuity implies continuity at every point. Each requested gets its own shared tolerance.
For an exact example, take the polynomial function on the closed interval . For every pair of function inputs in that interval, polynomial factorization gives
Consequently works everywhere on this domain of a function. With , the common tolerance is . Near the right endpoint, for example, and have input distance and output distance . The bound is sufficient; it does not claim the largest admissible input window at each point.
On the whole real line, the same polynomial function is a continuous function but fails uniform continuity. Take the sequences and , for positive integers . Then
For any proposed , choose an integer . The inputs are closer than , yet their outputs violate the fixed tolerance . The sequences need not themselves have a finite limit: their mutual distance is what tends to zero. This is the obstruction captured by the sequential criterion for uniform continuity. Restricting the domain of a function to removes these escaping pairs.
Figure 1.
The square function: local input windows shrink, but a bounded interval admits one shared tolerance
. The left panel computes sufficient windows from the continuity bounds for the square function; shrinking these particular windows alone does not prove failure of uniform continuity. The middle panel displays the exact bound on the interval . The right panel gives the decisive sequence pairs on the real line. All plotted values are calculated from the displayed formulas. Details.
A uniformly continuous function need not be a bounded function. The identity function on the real line has , so always works, although its image of a function is the unbounded real line. Uniform continuity controls changes between nearby inputs, not the overall size of outputs. Likewise, an unbounded domain of a function does not by itself prevent uniform continuity.
The square root supplies a different common tolerance on the interval . Assuming , put and . Since ,
Interchanging the inputs when necessary proves
Thus guarantees uniform continuity on the entire domain of a function, including zero. For , any input distance below suffices. The pairs and both have input distance ; their output distances are respectively and . The common guarantee accommodates quite different local sensitivities.
This Hölder continuity bound allows a curved tolerance rule. It is weaker than a Lipschitz bound: at zero the output change divided by the input change is
No finite Lipschitz constant works near zero, even though uniform continuity does. A Lipschitz function does have uniform continuity, choosing when its Lipschitz bound is positive; when it is a constant function.[ref]
Figure 2.
Square-root input changes share an output tolerance even though amplification near zero is unbounded
. At left, the exact output changes for base points stay inside whenever and . The right panel computes the amplification for inputs : it grows without bound as decreases. These are calculated function graphs, with no experimental measurements. Details.
For general metric spaces, replace the absolute values by the respective distance functions. The Heine-Cantor theorem gives an existence guarantee: every continuous function on a compact metric space is uniformly continuous. In particular, continuity on a finite closed interval provides a common tolerance, even when no simple formula for it is known.[ref]
For a short proof outline, fix . Continuity gives each point an open ball of radius within which outputs differ from by less than . The open balls of half these radii still cover the domain of a function. Compactness supplies a finite subcover. Take to be the smallest half-radius in this finite set. Two inputs closer than lie together in one of the original open balls, so the triangle inequality bounds their output distance by . The beautiful step is that the compact set turns local choices into finitely many choices, whose minimum stays positive.
A shared tolerance also makes uniformly continuous functions preserve Cauchy sequences: after choosing for , all sufficiently late input pairs are closer than , so all corresponding output pairs are closer than . Unlike a convergent sequence argument, this does not require an input limit inside the domain of a function. It is why uniform continuity is useful for extending a function toward missing endpoints and for the decay argument below.
For each positive integer , put on . Its supremum norm is exactly , so this sequence of functions converges to zero by uniform convergence. Nevertheless,
Each of its complete sine oscillations contributes : rise from zero to , fall through zero to , then return to zero. Taking a partition of an interval through all extrema attains . Every further partition refinement merely subdivides monotone function segments, so the same reasoning as in partition example of total variation proves the upper bound too.
Figure 1.
The functions sin(2πnt)/n converge uniformly to zero while their total variation remains 4; all three function plots use the same vertical scale
. Details.
For a continuously differentiable function on a closed bounded interval, total variation also satisfies
Applied here, the derivative is , and integrating its absolute value over periods gives . The differentiability hypothesis matters: the partition definition applies much more widely than this derivative formula.[ref] Small pointwise size and small accumulated movement are different approximation goals.
For fixed nonnegative integer , the row increases to its middle and then decreases. Indeed, for , the ratio of consecutive binomial coefficients is , which is greater than, equal to, or less than according as is less than, equal to, or greater than . Thus even has one maximum at , while odd has two equal maxima at .
Unimodular matrix Created 2026-09-24 Updated 2026-10-14
A unimodular matrix is a square integer matrix whose determinant is or . The decisive property is that its inverse matrix also has integer entries: multiplication by gives a bijection of the integer lattice onto itself. Thus an invertible linear map can preserve not only real coordinates but the requirement that every coordinate is an integer. These matrices form the integral general linear group.[ref]
For an original two-dimensional example, take
Its determinant is one, and it maps to . Conversely, the integer point comes from . For instance, has new coordinates relative to the columns and . No integer point disappears, although the basis vectors and their fundamental cell change shape.
Figure 1.
Two lattice bases generate exactly the same integer points
. Original drawings of the standard basis and the columns of . Both displayed cells have area one. The point has coordinates in the standard basis and in the sheared basis. Details.
This is useful whenever coordinates must remain integral. A unimodular change of lattice basis can give a shorter or more convenient description without changing the objects represented. Smith normal form and Hermite normal form use controlled integer operations to simplify integer matrices; ordinary Gaussian elimination may divide by numbers that destroy integrality. The geometric freedom is substantial: a sheared basis may look completely different while describing exactly the same infinite set of integer points.
A determinant of is allowed too. Swapping two basis columns reverses orientation while preserving the integer lattice. The condition is therefore preservation of the complete integer structure, rather than a requirement to preserve orientation.
Union by rank 2026-10-18
Union by rank keeps a nonnegative integer rank, initially zero, for each member. For each input, obtain its root of a tree using the disjoint-set find operation, then compare the resulting ranks. Attach the lower-rank root of a tree below the higher-rank root of a tree, leaving both ranks unchanged. When the two disjoint-set representatives differ but their ranks are equal, choose either survivor and increase its rank by exactly one. A redundant disjoint-set union operation changes no ranks. Path compression also changes no ranks. The surviving root's rank bounds the height of its rooted tree, measured in edges; after path compression it need not equal that height.[ref]
In our example, let the first argument's root of a tree survive equal-rank ties. The first two merges create roots , each of rank . The third gives and increases the rank of to . The fourth creates root of rank . The fifth attaches below without increasing any rank. Before any subsequent compression queries, the indexed arrays are
The redundant call on leaves these arrays unchanged. In particular, the disjoint-set representative of is , although is the minimum member of its block of a set partition.
Two short arguments explain the rank invariant. First, a root of rank has at least members in its block of a set partition: rank zero starts with one, and increasing rank combines two disjoint blocks of a set partition with at least members each. Unequal-rank linking only adds members. Thus every rank is at most for stored members, using the floor function and logarithm. Second, height is initially zero; unequal-rank linking adds at most one to the lower height, while equal-rank linking raises the available bound by one. Path compression only shortens routes. These arguments prove a height bound, not the stronger amortized analysis below.