Fix one distinguished element of the -element set. Every partition of a set into blocks belongs to exactly one of two cases. If is a block, removing it leaves an -block partition of a set of the other elements, giving possibilities. Otherwise remove from its block; that block remains nonempty, so the result has blocks. Conversely choose any of the such partitions and insert in any one of its blocks. This gives possibilities.
These cases are disjoint and exhaustive, proving the Stirling numbers of the second kind recurrenceUse , for , and for ; these conventions include the boundary cases and .
For a surjection, the nonempty fibres form a partition of a set into exactly blocks. Choose these unlabelled blocks in ways, then assign the distinct elements of to them in ways. ConsequentlyIt is zero when . With and for , the same formula also handles an empty set codomain.
The fifty disjoint sets form a partition of a set . If a chosen subset met each pair at most once, it would contain at most fifty elements. The pigeonhole principle therefore forces a -element subset to contain both elements of at least one pair. Those two distinct elements sum to .
A partition of a set is a collection of nonempty subsets such that for and . Thus every outcome lies in exactly one cell. For a probability-space partition the cells must also be measurable events. Nonempty cells may nevertheless have probability zero.
A disjoint-set data structure maintains a partition of a set into pairwise disjoint sets.
Make-Set(v) creates the singleton containing a new vertex. Find-Set(v) returns the disjoint-set representative of its current set. Union(u,v) merges the two sets containing its arguments, preserving the partition; it has no effect if they are already the same set. A disjoint-set forest can implement these operations without explicitly moving every member when sets are joined.A partition of a set consists of nonempty subsets that are pairwise disjoint and whose union is the whole set. HereThus every outcome belongs to exactly one cell. The probability calculation additionally requires the cells to be measurable events.
Let be a finite or countable partition of a set of the sample space into disjoint events, with . For any event , the law of total probability isTo prove it, the intersections are disjoint and have union . Countable additivity and the definition of conditional probability therefore giveIt is enough that the union of the partition events has probability one. Parts of probability zero contribute zero in the intersection formula and can be omitted before writing conditional probabilities; conditioning by division on a zero-probability part would be undefined.
The floor function is constant at on the four consecutive integers . Consequently the partition of a set is . Different blocks are disjoint and every nonnegative integer has exactly one quotient and remainder upon division by .
Take the nonempty intersections of the length-three and length-four blocks. Within the first twelve nonnegative integers the common cut points are , givingThe complete partition of a set consists of these six blocks translated by for every . Indeed, adding increases the two floor quotients by and respectively, preserving equality of both quotients within each translated block. No adjacent displayed blocks can merge because at least one quotient changes at their boundary. This is the periodic common refinement of floor-quotient partitions, with period .
Path component Created 2026-09-24 Updated 2026-10-14
A path component of a topological space is a nonempty subset maximal among its path-connected subsets. The path component through can be described asEvery point along such a continuous path also belongs to : the initial part of the path reaches that point. Thus the paths witnessing membership stay inside . This makes path components useful for deciding which allowed positions can be reached from one another by continuous motion.
Every path component lies inside one connected component, because every path-connected space is connected. Thus each connected component is a union of path components. In a locally path-connected space the two classifications agree, by connected locally path-connected spaces are path-connected. For a subset of the real line with its usual subspace topology, the classifications also agree: every connected component is a real interval, and interpolation supplies a continuous path within it.
The topologist's sine curve shows why the distinction matters in general. Use specifically the closed versionwith the subspace topology from the usual Euclidean plane. It has one connected component, , but two path components, and . The graph of a function is a continuous image of a connected space, and its closure is , so closure of a connected set gives connectedness. Each of is path-connected, but a continuous path crossing from into would force its second coordinate to oscillate between and arbitrarily near its departure time, contradicting continuity; the topologist's sine curve article gives the short argument. Also is not closed in , so path components need not be closed, unlike connected components.[ref]
General Topology by Tom Leinster. p. 78, and the discussion after Lemma C4.12, p. 84: the sine-curve obstruction and nonclosed path components; here the positive graph is restricted to
Being joined by a continuous path is an equivalence relation. Proof outline: the constant path joins a point to itself; reverses a path; and a path from to followed by one from to gives a path from to . For the last construction, run each path on half of ; their values agree at , so the pasting lemma for closed subspaces gives continuity. The equivalence classes are path-connected, are maximal, and form a partition of a set of into path components.[ref]
Path compression 2026-10-18
Path compression changes parent pointers during a disjoint-set find operation so that future queries traverse fewer edges. Full path compression first follows the entire parent route to its root of a tree, then makes every member on that route point directly to that same root of a tree. No member changes its block of a set partition or its disjoint-set representative. Pointers outside the traversed route stay as they were. The following iterative Python implements full path compression and union by rank;
parent and rank are initially indexed arrays with parent[x] = x and rank[x] = 0 for every valid member.def find(x):
root = x
while parent[root] != root:
root = parent[root]
while parent[x] != x:
following = parent[x]
parent[x] = root
x = following
return root
def unite(x, y):
a, b = find(x), find(y)
if a == b:
return False
if rank[a] < rank[b]:
a, b = b, a
parent[b] = a
if rank[a] == rank[b]:
rank[a] += 1
return TrueStarting from the displayed disjoint-set forest,
find(3) traverses , returns and changes only from to . The route still has two edges. Then find(5) changes only from to . The final parent array is ; every stored rank retains its displayed value. The rooted tree at now has height one although its root's rank is two. Root still represents a separate singleton set.find(3) followed by find(5). Labels record stored ranks, including historical ranks at nonroots. Details.The two-pass algorithm first discovers the answer and then reuses it. During the second pass, saving
following before overwriting the pointer preserves the remaining route. Every replacement pointer targets the original root of a tree, proving that the partition of a set is unchanged.Full path compression is one specific rule. The authored
UF.java implementation instead uses path halving, redirecting a visited member to its parent's parent while advancing along the route. Its union by rank rule agrees with the one above.[ref]UF.java. Algorithms, 4th edition by Robert Sedgewick and others; UF.java, find and union methods: halving assignment versus the full-compression algorithm here; lower-rank linking and equal-rank increment
Pooled-mean compatibility under rounding Created 2026-10-25 Updated 2026-10-31
For a partition of a set of complete sample observations into groups of known sizes and total , its sample mean is the weighted mean of the group sample means. Indeed, dividing by proves the identity. If the printed group means each have absolute rounding error at most , their compatible pooled mean lies inThis follows because all the weights are nonnegative. Equivalently, the pooled absolute rounding error is at most , by the triangle inequality. A printed overall mean must have a rounding interval intersecting this interval. Disjoint intervals prove incompatibility, rather than merely a difference of displayed decimals. This is a necessary consistency check for means of the same complete sample; it cannot silently equate a full-sample mean with a different complete-case mean or establish a unique repair to inconsistent output.
Set partition Created 2026-09-24 Updated 2026-10-13
A set partition of a finite set is a set of nonempty subsets, called blocks of a set partition, withThus every set element of belongs to exactly one block of a set partition. This is the finite counting version of a partition of a set. The blocks of a set partition are unlabelled: their subscripts help describe them, but give them no roles or order. Stanley uses this definition in his classification of counting problems.[ref]
Enumerative Combinatorics, Volume 1 (second-edition draft) by Richard Stanley. section 1.9: set partitions and their blocks
All possibilities for three elements. The set has exactly five set partitions:For two blocks of a set partition, one must have size two and the other size one; the three choices of the lone element give the middle row. One block of a set partition forces the whole set, and three blocks of a set partition force three singleton sets. This proves the enumeration complete, with counts by number of blocks of a set partition. Their sum is the Bell number .
Exact enumeration of the five set partitions of : outlines show blocks of a set partition, whose positions and colours carry no labels
. Details. What information is kept? Exchanging the two blocks of a set partition in leaves the same set partition; writing the tuple instead makes an ordered list, different from . Exchanging elements within a block of a set partition also changes nothing. In contrast, is a different set partition, because the actual memberships differ. Both have the same integer partition of sizes. An integer partition, or its Ferrers diagram, forgets which distinct objects were grouped together.
For four named people, and therefore describe different ways of making two unnamed teams, although both have sizes . If every team must have exactly two people, only three set partitions qualify; if any nonempty team sizes are permitted, the Stirling number of the second kind counts them. Naming the teams changes the counting problem again.
A set partition is useful whenever membership matters but category names do not. Define when and belong to the same block of a set partition. This is an equivalence relation, and its equivalence classes recover the set partition. Conversely, an equivalence relation supplies its set partition of equivalence classes. The beautiful simplification is that one grouping can be described by whole subsets or by a rule comparing two elements. Additional distinctions are organized by refinement of a set partition.
The empty set has one set partition, the empty collection , with zero blocks of a set partition. This differs from , which is forbidden because its proposed block of a set partition is empty.
A finite simple graph that is a cubic graph and has a perfect matching admits a partition of a set of its edges into graph paths of length three.
Proof. Delete a perfect matching . The remaining spanning subgraph has vertex degree two at every vertex, so it consists of disjoint graph cycles. Orient each cyclically, giving a successor bijection . Replace each by the graph path . The four vertices are distinct: the successor edges are not in , neither is a self-loop, and injectivity of excludes . Every edge of appears once in the middle, and every other edge appears once at its unique tail. Thus the graph paths cover every edge exactly once. In particular, the perfect matching theorem for a cubic graph with at most two bridges guarantees this decomposition under its hypotheses.
Totient divisor-sum identity Created 2026-10-14 Updated 2026-10-20
The divisor sum of Euler's totient function is the identity arithmetic function:Equivalently, under Dirichlet convolution, with the constant-one arithmetic function. [ref]
https://darijgrinberg.gitlab.io/floor.pdf. Darij Grinberg, MIT 18.781 lecture notes, Propositions 2.4.4 and 2.4.5
To see why, group the integers by . Each is a positive integer divisor of . Within its group, with and , by the scaling identity for greatest common divisors. Dividing by gives a bijection with the integers counted by . The groups form a partition of a set, soFor , the groups with greatest common divisor are respectively . Their sizes are , totaling . Möbius inversion reverses this divisor sum to recover Euler's totient function from .
Union-find operation bounds 2026-10-18
Assume identifiers, pointers and ranks fit into constant-size machine words, with constant-cost indexed array access, comparison and assignment. Initializing members costs time and machine words. With union by rank and full path compression, any sequence of disjoint-set find operations and disjoint-set union operations then has total time complexity, in Big O notation,Here is a conventionally normalized inverse Ackermann function. The documented path-halving implementation has the same amortized analysis bound.[ref]
UF.java. Algorithms, 4th edition by Robert Sedgewick and others; UF.java, class documentation: linear constructor, logarithmic worst-case operations and inverse-Ackermann sequence bound for rank with halving
A disjoint-set union operation includes two disjoint-set find operations and a constant amount of additional linking work. Including in the bound accounts for initialization even if no queries follow.
This is a bound on an entire sequence. It is not a worst-case constant bound for each call: a disjoint-set find operation can still encounter a previously uncompressed route of logarithmic length. The inverse Ackermann function grows extraordinarily slowly but is unbounded, so it cannot be replaced by a mathematical constant in this asymptotic statement. The general distinction between a per-operation maximum and a whole-sequence guarantee is explained in amortized analysis.
Robert Tarjan's 1975 paper established an inverse Ackermann function bound for set union. Its abstract states the sharper two-parameter form for representative queries and intermixed merges: the worst total cost is bounded above and below by positive constant multiples of . Those variables count different operations from the convenient formulation above; the abstract's matching lower bound is about its analyzed method, rather than a claim that every conceivable representation obeys the same lower bound.[ref]
The intuition is that union by rank limits how parent routes grow, while path compression makes an expensive traversal improve later queries. The rank argument alone proves only a logarithmic bound. Establishing the inverse Ackermann function bound requires a finer accounting of traversals across rank ranges; it does not follow merely from drawing a flatter rooted tree. The useful result is that repeated merging and membership queries can share the work of maintaining a changing partition of a set.
Voronoi cell 2026-10-25
For centres in Euclidean space, the Voronoi cell of is the set of points at least as close to as to every other centre. Shared boundaries consist of points tied between nearest centres; assigning each such point to one centre makes the cells a partition of a set.
On the real line with distinct ordered centres, the Voronoi cells are intervals, with boundaries at the midpoints of adjacent centres. This makes nearest-centre clusters contiguous blocks of sorted observations in k-means clustering.

