Allocation to labelled bins Created 2026-10-18 Updated 2026-10-20
Allocate distinct objects to labelled bins of specified nonnegative sizes , with . Order within a bin is ignored. The number of allocations is the multinomial coefficient
To prove this, order all the objects in a permutation and assign the first to the first bin, the next to the second, and so on. Every allocation comes from exactly internal orderings. These disjoint classes exhaust the permutations, proving the formula by the multiplication principle. Empty bins are allowed because .
For two bins of sizes and , the count is and every allocation has multiplicity in the permutation sample space. Exchanging two equal-sized labelled bins generally gives a different allocation. In contrast, a set partition uses unlabelled nonempty blocks; forgetting bin labels changes the counting problem and must not be done silently.
Bell number 2026-10-14
The Bell number counts all set partitions of an -element finite set, with no restriction on the number of blocks of a set partition. Summing the Stirling numbers of the second kind gives . The first five values, for , are . In particular, . [ref]
Block of a set partition Created 2026-10-14 Updated 2026-10-20
A block of a set partition is one of its nonempty subsets. Distinct blocks of a set partition have empty intersection, and their union is the original set. For , the blocks of a set partition are and the singleton set . The indices in a written list of blocks of a set partition do not label or order the set partition.
Boolean game 2026-10-24
A finite game represented succinctly by propositional logic. Each player controls a disjoint collection of Boolean variables and chooses their truth values. Together those choices determine a Boolean valuation. A player's goal is a propositional formula, with payoff one if satisfied and zero otherwise. The control sets normally form a set partition of all variables.
A pure strategy strategy profile is a Nash equilibrium if every unsatisfied player remains unsatisfied after every change to that player's controlled variables. Checking a candidate can therefore require solving a Boolean satisfiability problem, even though evaluating its current payoffs is easy.
Chromatic index 2026-10-14
The chromatic index , also called the edge chromatic number, is the least number of labels in a proper edge colouring of a finite undirected graph without self-loops. Equivalently, it is the smallest number of matchings in a graph whose set partition covers all the edges. We take when there are no edges. For an arbitrary edge colouring, one colour always suffices whenever an edge exists, so properness is essential to this definition. The chromatic number instead colours vertices.[ref]
To establish an exact chromatic index, supply both a proper edge colouring and a reason that fewer colours cannot work. Every edge at a fixed vertex must have its own colour, giving the lower bound , where is the maximum degree of a graph. The bound need not be attained: it counts a single resource's workload, while conflicts can also accumulate around a graph cycle.
Figure 1.
Worked proper edge colourings: a triangle in a graph needs three colours, while an even cycle graph needs two
. Numbers beside edges are colour labels; letters at dots are vertices. Both graphs have maximum degree of a graph two. The triangle in a graph has three pairwise conflicting edges, while opposite edges of the square can share a colour. Details.
For the triangle in a graph with edges , every pair of edges shares a vertex, so all three require different labels. The assignment works, proving although . In its line graph, those three edges become a three-vertex clique. Treating this as three pair-resource jobs makes the obstruction tangible: each resource has only two jobs, but every pair of jobs conflicts, so no slot can contain two jobs.
For the square cycle graph with edges , use and . Each colour class is a matching in a graph, and each vertex has one edge of each colour. Since , this proves . More generally, alternation closes on any even cycle graph , . On an odd cycle , , two-colour alternation would make the last and first edges share a colour at their common vertex; a third colour on the last edge suffices. Thus even cycle graphs have chromatic index two and odd cycle graphs have chromatic index three. These exact examples show why maximum degree of a graph alone does not determine the answer.
Colour class 2026-10-14
A colour class of a finite colouring is a fibre . Each colour class is a monochromatic set, and these fibres give a finite set partition of after empty fibres are omitted.
Combinatorics Created 2026-09-24 Updated 2026-10-13
Combinatorics studies discrete structures through counting, construction, and extremal questions. Its objects include subsets, permutations, graphs, and set partitions. The question is often easy to ask: how many teams can we choose, how many arrangements avoid a collision, or how few connections are enough? The challenge is to organize the possibilities so that every permitted object is counted exactly as intended.
For example, choosing two people from five gives ten teams. Choosing a captain and deputy from those same five gives twenty assignments. The difference is whether order is part of the object: a team is a subset, while the two named roles distinguish an ordered pair. The binomial coefficient and the rule of product encode these two counting problems. Choosing the right objects comes before manipulating a formula.
The beauty is that a change of viewpoint can turn enumeration into an explanation. Double counting connects two descriptions of one collection; Pascal's identity splits a selection into cases; the inclusion-exclusion principle repairs overlapping counts. These methods also supply exact finite models for probability and help measure the possibilities an algorithm must handle. Richard Stanley's textbook introduces the subject through counting questions and then develops these general tools. [ref]
Dobiński's formula 2026-10-25
For with Poisson distribution of mean one, every factorial moment satisfies . The polynomial identity
expresses powers in terms of falling factorials, where are Stirling numbers of the second kind. Substituting and using linearity of expectation proves
On the other hand, the probability mass function gives . This proves Dobiński's formula and explains why a count of set partitions is a moment of a Poisson distribution. For example, . At , take also for , obtaining . For each fixed , the ratio test proves convergence of the displayed infinite sum.
Equitable regularity energy Created 2026-10-05 Updated 2026-10-14
For a set partition of the vertices of a graph of order , define
where the sum is ordered, the adjacency indicator defines the density also on diagonal pairs, and exceptional vertices are treated as singleton parts. Refinement cannot decrease this energy, by the Cauchy-Schwarz inequality. An irregular pair of equal cells of size , with witnesses of relative size at least and density discrepancy greater than , increases the energy by more than for each orientation. Splitting refined atoms into equal chunks and leftover singleton parts is a further refinement, so restoring equitability causes no energy loss.
For the two-choice Achlioptas process, fix and . Conditional on any current graph with , put equal to the vertices in its large graph components. There are at most such initial graph components. If after more steps no graph component contains vertices of , greedily assign final graph components to two groups so that each meets at least vertices of . This induces a set partition of the initial large graph components, of which there are at most possibilities.
For any fixed such split , a uniform candidate edge joins to with probability at least . If both candidates do so, the selected edge cannot avoid the crossing. Thus the probability that the split survives all steps is at most . The deliberately weaker constant also covers distinct candidate sampling for sufficiently large . In the absent-edge version, as long as the split has survived, every -- edge is absent, so conditioning on absence can only increase this crossing probability. A union bound with and bounds failure by . For fixed , a further union bound makes the conclusion simultaneous over all starting steps . This proof is independent of how the rule chooses between the two candidates.
Graph coloring Created 2026-10-14 Updated 2026-10-20
A graph coloring assigns labels called colours to elements of a graph, subject to specified constraints. Here we focus on proper vertex colouring of a simple graph : it is an undirected graph with a finite set of vertices, and a colouring with at most colours is a function
The colour labels need not be visual colours: they can represent time slots or resources. Unused labels are allowed. Properness concerns graph adjacency, so moving vertices in a drawing does not change whether the graph coloring is valid.[ref]
Each colour class is an independent set: no edge has both endpoints in it. Conversely, a set partition of into independent sets gives a proper graph coloring by assigning one colour to each part. Thus graph coloring groups mutually compatible objects, and its chromatic number asks for the fewest such groups.
For an illustrative scheduling model, let each vertex represent an activity of equal duration and each edge represent a pair that cannot occur in the same time slot. A proper graph coloring is then a schedule respecting those pairwise conflicts. If the conflicts form a cycle graph with edges , activities can share one slot and another. This model assumes interchangeable slots and includes only the pairwise conflicts encoded by the graph.[ref]
The word "colouring" also occurs in edge coloring, which requires different colours on edges sharing an endpoint. The chromatic number discussed here always refers to proper vertex colouring.
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]
Partition of an integer Created 2026-09-28 Updated 2026-10-14
A partition of a nonnegative integer records a way to write as a sum of positive integers, with the order of the summands ignored. Its canonical notation is a finite sequence
We write , call the its parts, and call its length. Trailing zero parts may be appended for calculations without changing the partition of an integer; zero has the unique empty partition of an integer, of length zero. Thus , and describe the same partition of an integer of five. The Young diagram below makes its two parts visible as rows of three and two cells.
The seven partitions of an integer of five are
This is a different object from a set partition: specifies block sizes, whereas a set partition must also specify which elements belong to each block.
Why this is useful: a partition of an integer is a compact description of a shape, yet it also labels an irreducible representation of a symmetric group over the complex numbers, realized by a Specht module. It therefore connects arithmetic decompositions, Young diagrams, and representation theory of the symmetric group. The generating function for partitions with bounded parts gives another way to count such shapes. Historically, Euler studied these counting problems using generating functions; his [ref] documents this early development.
For fair division, let and let the additive valuation of agent be . Use one variable per agent, with constraint domain , the power set of the items. Empty bundles are permitted in this original formulation.
Require pairwise disjoint sets:
Each such binary constraint involves exactly . Require complete allocation by the single all-variable constraint
Finally impose the envy-free allocation binary constraints
each on . The two directions for a pair use different agents' additive valuations and must both hold. These conditions give precisely an ordered set partition of the items that is an envy-free allocation.
For an undirected graph with adjacency matrix , degrees of vertices and edges, network modularity is
Each undirected edge contributes twice to the double sum, explaining the denominator . Include the terms with : even though the observed graph has no self-loops, the null-model contribution on the diagonal is part of this definition.
An independent implementation forms the modularity matrix and sums its within-community blocks. Initializing the best value to negative infinity also handles a candidate collection whose scores are all negative:
def modularity(adjacency,communities):
    a=np.asarray(adjacency);degrees=a.sum(axis=1);twom=degrees.sum()
    if twom==0:raise ValueError('positive edge count required')
    B=a-np.outer(degrees,degrees)/twom
    return sum(B[np.ix_(group,group)].sum() for group in communities)/twom

best_score = -np.inf
best_partition = None
for candidate in community_partitions:
    value = modularity(adjacency_matrix, candidate)
    if value > best_score:
        best_score, best_partition = value, candidate
print(best_partition, best_score)
The best partition is , with . There are seven edges, and each selected community has three internal edges and total degree seven, so independently
The supplied candidates include the optimum, but do not exhaust even the balanced two-community set partitions: there are of those, rather than six. To substantiate a best partition among all community counts, the following short recursion enumerates all 203 unlabeled set partitions of the six vertices:
def partitions(items):
    if not items:
        yield [];return
    first,*rest=items
    for part in partitions(rest):
        yield [[first]]+[g.copy() for g in part]
        for j in range(len(part)):
            new=[g.copy() for g in part];new[j]=[first]+new[j];yield new

candidates = list(partitions(list(range(len(adjacency_matrix)))))
best_partition = max(candidates, key=lambda p: modularity(adjacency_matrix, p))
print(len(candidates), best_partition, modularity(adjacency_matrix, best_partition))
This exhaustive calculation returns the same two triangles and the same network modularity. Enumerating every set partition becomes impractical rapidly as the number of vertices increases, but is small enough here to verify the global optimum.
Use the equitable form of the Szemerédi regularity lemma. For and a prescribed lower bound , there are such that every sufficiently large graph admits a set partition
with at most unordered irregular pairs among the nonexceptional cells. A uniform pair here means a regular pair of vertex sets. Larger values of follow from a smaller parameter, so the stated restriction loses nothing.
For the proof, retain the exceptional vertices as singleton cells in an auxiliary set partition . Define its regularity energy by the ordered sum
For diagonal rectangles the adjacency matrix of a graph defines ; diagonal terms are included. Thus . If is split into rectangles of densities and sizes , their weighted mean is . Expanding squares proves the refinement variance identity for regularity energy:
Every refinement therefore increases or preserves energy.
Suppose equal cells of size are -irregular. Choose witnesses , of sizes at least , whose density differs from by more than . Refine the cells so that these witnesses are unions of refined atoms. Applying the Cauchy-Schwarz inequality inside gives an increase, for this oriented rectangle, greater than
Choose witnesses simultaneously for every irregular pair. Each original cell is cut by at most witness sets and has at most atoms. If more than unordered pairs are irregular, both orientations contribute, giving
as long as the exceptional set has at most vertices.
To restore equal sizes without sacrificing this increase, use equalization with a controlled exceptional set. Cut every witness atom into blocks of size , leaving fewer than unused vertices in each atom. Make each unused vertex a singleton exceptional cell. This is a further refinement, so there is no energy loss. The number newly exceptional is at most
When , the new nonexceptional cell count is at most : indeed and . It is at least , since each old cell supplies at least blocks.
Let . Choose the initial count so large that , and begin with equal cells and fewer than leftover vertices. Take large enough that these initial leftovers are at most . Iterate the bound for rounds to obtain a finite number . Increase further to ensure . Then every cell size encountered satisfies , so every equalization is legitimate. The total exception budget is at most , because the initial losses use half the budget and all later losses sum to at most . Energy cannot increase by more than one, so failing rounds are impossible. The process must stop with at most irregular pairs. This proves the Szemerédi regularity lemma, including the bounded cell count, equitability and exceptional-set control.
For the dense-pair application, apply this proof with and . Suppose every -regular pair of nonexceptional cells has density at most . Edges touching number at most . Edges inside nonexceptional cells number at most . The at most irregular cell pairs contribute at most . Finally the regular cross-cell pairs contribute at most . Therefore
a contradiction. Some regular pair consequently has density greater than . It is also a -uniform pair, since subsets of relative size at least qualify in the stronger -regularity condition. The common cell size satisfies . Thus the dense regular pair from edge surplus gives
This first proves the assertion for . For the finitely many smaller possible orders, choose the endpoints of any edge as singleton sets: the pair has density one and is regular for every positive parameter. Taking includes these cases as well.
We prove a weighted version of the Szemerédi regularity lemma, which is sufficient for the grid application. For disjoint nonempty vertex sets in a graph, write for their edge density of a bipartite graph. Call the pair -regular if every , with and satisfies .
The weighted Szemerédi regularity lemma states that, for every , there are integers such that every graph on vertices has a set partition into at most nonempty cells , each of size at most , for which
The sum is ordered. The cells need not have equal sizes; their weights replace the usual unweighted count of bad pairs.
To prove it, start with nearly equal cells, taking . Each has size at most . Define the regularity energy
Here even diagonal rectangles use the mean adjacency indicator, counting ordered pairs of vertices. Thus . Under a refinement, the old rectangle density is the weighted mean of the new ones, and the refinement variance identity for regularity energy gives
In particular refinement cannot decrease energy.
If the irregular-pair weight exceeds , choose witness subsets , for every irregular unordered pair, and split each cell simultaneously by all its witnesses. There are at most such subsets in any one cell, so the new number of cells is at most . In an irregular rectangle, its witness has relative area at least and density discrepancy greater than . Since the witness rectangle is now a union of refined rectangles, the Cauchy-Schwarz inequality applied to their weighted density discrepancies bounds the variance contribution from below by
Summing over both orientations of all irregular pairs raises by more than . Since , after at most rounds the required weight bound must hold. The finite recurrence , starting at , supplies ; all cells remain small because we only refine. This proves the stated weighted Szemerédi regularity lemma.
We next derive the triangle removal lemma from this version. First, three disjoint classes whose pairs are -regular pairs of density at least have many triangles if and . Fewer than vertices of have fewer than neighbours in : otherwise that set of vertices, paired with all of , would violate regularity. The same holds for . For each of the at least remaining vertices, both neighbour sets have relative size at least . Regularity of then supplies at least times the product of those two neighbour-set sizes edges. Thus the regular triangle counting lemma, also for unequal class sizes, gives
For a desired deletion tolerance , take , , and a weighted regularity partition with at most cells. Put . Delete edges inside cells, between irregular pairs, between regular pairs of density less than , and incident to cells smaller than . The first two deletions each cost at most . The sparse-pair deletion costs at most . For the last deletion, small-cell deletion in weighted regularity removes at most vertices and at most incident edges. The total is bounded by
A triangle surviving these deletions would lie in three distinct cells, all of size at least , with all their pairs regular and of density at least . The original graph would then have at least triangles. Therefore, with
a graph on sufficiently many vertices with at most triangles can be made triangle-free by deleting fewer than edges. This establishes the triangle removal lemma with every parameter depending only on .
Now apply a tripartite graph encoding of a grid. Take separate vertex classes , , . For each grid point in the given set, put in the three edges
where their endpoints belong respectively to , , and . Each point supplies a triangle. These triangles are edge-disjoint triangles, since any one of the three edge types uniquely determines the point that supplied it.
Conversely, any triangle with vertices , , forces the three points
to belong to . Put . For these form a corner in an integer grid; for they all arise from the same grid point. Thus if there is no corner, the graph has exactly triangles, yet destroying all triangles requires at least edge deletions.
We may suppose , since larger densities make the request vacuous. Use the triangle removal lemma with . Our graph has vertices, so, for sufficiently large , its bound on the number of triangles is at most . The lemma would delete fewer than
edges to destroy all triangles. This contradicts the lower bound from the edge-disjoint family. Hence every sufficiently large positive-density square grid contains a nondegenerate corner, proving the requested corners theorem and in particular the existence of a suitable .