Abstract data type invariant 2026-10-24
A condition describing legal abstract states, independently of their concrete storage. A bounded-key multiset has nonnegative counts and zero counts outside its allowed range. A representation invariant instead constrains implementation states; an abstraction function connects a valid representation to its abstract state. The two kinds of invariant should not be conflated.
Array multiset 2026-10-25
A multiset of keys in a fixed finite integer range represented by one nonnegative count per key. The abstraction function extends the stored array counts by zero outside the range. Single-key additions, removals and queries use constant array work, provided overflow and operation preconditions are handled. Encapsulation of the count array is necessary to preserve its representation invariant.
Bitonic sorting algorithm 2026-10-24
A divide-and-conquer algorithm that sorts two halves, reverses one result to form a bitonic sequence, then performs a bitonic merge. For the shuffle-and-adjacent-comparison merging network on entries, passes each cost , so merging costs . The complete recurrence relation is , giving time. A compare-exchange operation preserves the multiset of entries while putting its two selected entries in order.
Coin-change counting 2026-10-20
Combination (combinatorics) 2026-10-20
Compression of an entropy sum 2026-10-06
A union-intersection compression can only decrease the sum of information entropies for a finite-valued random vector . Each elementary step follows from entropy submodularity; iteration proves the assertion with multiset multiplicities. Uniform coordinate multiplicity gives Shearer inequality by compressing to repeated full sets and empty sets.
Digit permutation 2026-10-20
A rearrangement of the numerical digits of a numeral. Two numerals have the same digit permutation class exactly when their digit multisets agree. If they represent numbers of the same length, a leading zero must be disallowed.
Euler transform of a sequence 2026-10-20
The Euler transform of a sequence has coefficients defined by . In unlabelled counting, may count connected components of size , while counts multisets of components.
Factorization tree Created 2026-10-14 Updated 2026-10-20
A factorization tree is a rooted tree whose root is an integer . Each nonleaf label is a composite number split into two factors greater than one whose product equals that label; the leaves are prime numbers. Multiplying the leaves recovers . Many factorization trees can have the same root, but the fundamental theorem of arithmetic gives them the same leaf multiset.
Fundamental theorem of arithmetic Created 2026-09-24 Updated 2026-10-20
Every integer is a product of prime numbers, uniquely up to reordering the factors. More precisely, there are unique distinct prime numbers and unique positive integer exponents such thatIn the header's displayed form, is the prime valuation, the exponent of in this prime factorization; it is zero when does not divide . Reordering or regrouping the prime factors does not give a different prime factorization.
For , repeated division gives , , , then , , and . ThusIts nonzero prime valuations are , and . Recording only the distinct prime factors would lose the difference between and .
This turns divisibility into coordinatewise comparison of nonnegative exponents. A positive divisor of chooses an exponent from for , from for , and from for , giving positive divisors. The greatest common divisor takes the smaller exponent at each prime number; the least common multiple takes the larger. The theorem is a structural description, not an assertion that finding the factors of every large integer is computationally easy.
In general, for positive integers , the exact divisibility criterion isFor example, divides , with quotient , whereas does not: it requires four factors of two, but supplies only three. Both use only prime factors of , so membership in that list alone does not establish divisibility. Every positive divisor of is uniquely with , , . Sorted, all 24 positive divisors areThus the divisor function gives . These include divisors that are composite numbers, as well as the prime factors and one.
For another positive integer , the prime valuations give exact formulas for the greatest common divisor and least common multiple:With and , their prime valuations at are and . The smaller exponents give , and the larger give , henceIndeed, , , and . The same rules also explain : the smaller and larger exponents sum to the two original exponents. Here .
Prime valuations compute the greatest common divisor, least common multiple and all 24 positive divisors of 360
. The upper table compares exponents at the prime numbers for and , then takes their columnwise minimum and maximum. The lower tables enumerate for and ; each cell gives one positive divisor. Details.The useful change of viewpoint is that multiplication becomes addition of prime valuations, , and divisibility becomes comparison. Many different-looking calculations therefore share one representation. The prime valuations are coordinates for multiplication, rather than digits in positional notation: they do not turn ordinary addition of integers into coordinatewise addition.
Different intermediate splits lead to the same prime ingredients. Starting with gives and ; starting with gives and . Continuing to split the composite numbers produces the same multiset of prime factors: three twos, two threes, and one five. The factorization tree records choices in the calculation, while the prime factorization records the invariant result.
The proof outline explains the uniqueness. Existence follows by splitting a composite number into smaller factors until only prime numbers remain. For uniqueness, Euclid's lemma says that a prime factor of one product must divide one factor of any other prime product equal to it. That factor must be the same prime number; cancel it and repeat. The crucial divisibility step appears in Book VII, Proposition 30 of Euclid's Elements. [ref]
https://mathcs.clarku.edu/~djoyce/java/elements/bookVII/propVII30.html. Euclid, Elements VII.30: a prime divisor of a product
The ancient text supplies specific precursors to the modern statement: Book VII, Proposition 31 establishes that every composite number has a prime factor, and Book IX, Proposition 14 excludes any new prime factor from the least common multiple of given prime numbers. These are the propositions being cited, rather than the complete modern exponent formulation of the fundamental theorem of arithmetic. [ref]
https://mathcs.clarku.edu/~djoyce/java/elements/bookVII/propVII31.html. Euclid, Elements VII.31: every composite number has a prime divisor
[ref]https://mathcs.clarku.edu/~djoyce/java/elements/bookIX/propIX14.html. Euclid, Elements IX.14: prime divisors of a least common multiple of primes
Excluding one from the prime numbers keeps uniqueness meaningful: otherwise would give different collections of supposed prime factors. For , the natural convention is the empty product, equal to one, with no prime factors and all prime valuations zero.
Hook length Created 2026-10-05 Updated 2026-10-14
The hook length of cell in the Young diagram of a partition of an integer is the number of cells in its Young-diagram hook:Here is the conjugate partition. There is one hook length for every cell, so the multiset of hook lengths has cardinality .
For and , compute and . Continuing cell by cell gives the hook graph of a partitionor the row array . Its hook product is . A cell has hook length one exactly when it is a Removable node of a Young diagram: it has no cell to its right or below. Here these are and . Transposing the Young diagram gives the array with the same hook product; this explains geometrically why conjugate shapes have equal counts in the hook-length formula.
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]
Enumerative Combinatorics, Volume 1 (second-edition draft) by Richard Stanley. section 1.7, definitions of partitions and diagrams
Computed example. The seven integer partitions of five are exactlyThus . 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 .
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 isProof 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]
Enumerative Combinatorics, Volume 1 (second-edition draft) by Richard Stanley. section 1.8, conjugation and partition generating functions
Multihypergraph 2026-10-06
A multihypergraph has a multiset of hyperedges, allowing the same subset of vertices to appear more than once. Its hypergraph vertex degrees and hypergraph codegrees count multiplicity. Such multiplicity is important when several original hyperedges produce the same link in a hypergraph container theorem.
Multiset overlap 2026-10-25
The common multiplicity of two multisets, summing the smaller multiplicity of each value. To return an order-preserving overlap of two finite lists, scan the first list and consume one equal item from the second whenever available. Each token can be consumed at most once, so the resulting subsequence has maximum possible length among those that occur in a permutation of the second list.
Past exam of the groups and representations course of the University of Oxford 2019 4 c Solution 2026-10-25
Let be the four-dimensional spinor representation. The tensor product representation splits into its symmetric square and exterior square, with dimensions ten and six. If is a highest-weight vector of , then is a highest-weight vector of weight in the symmetric square. The irreducible representation with that highest weight has dimension ten by solution, exhausting the symmetric square:For the exterior square, add each pair of distinct weights from solution. The resulting multiset of weights isIts maximal weight is the highest weight of a five-dimensional irreducible representation. It accounts for the four nonzero weights and one zero weight, leaving a single zero weight. By complete reducibility of semisimple Lie algebra representations, that remaining one-dimensional summand is the trivial representation. Thus , and the spinor tensor square for so5 isThe dimension check is . The trivial representation lies in the exterior square, reflecting the invariant nondegenerate alternating bilinear form of this pseudoreal representation. Although itself does not descend to , its tensor square does: the central element acts as .
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 13 2 iii Solution Created 2026-10-03 Updated 2026-10-06
The empty family satisfies the bound, so assume is nonempty and choose a graph according to the uniform distribution on a finite set . Let be its random vector of edge indicators, indexed by . Then its information entropy is .
For each vertex , put , so records the graph neighbourhood of . The possible graph neighbourhoods form an intersecting family of subsets of : the graph intersection of any two members of has no isolated vertex at . A subset and its complement cannot both occur. Pairing the subsets into complementary pairs gives at most possible graph neighbourhoods. The maximum entropy on a finite alphabet therefore givesThis argument applies for . For the assumed nonempty family cannot exist, since its only possible graph has an isolated vertex.
Each edge belongs to exactly two of the sets . To obtain the needed instance of Shearer inequality directly from the preceding compression argument, repeatedly apply a union-intersection compression to incomparable members of the multiset . Each such step strictly increases , byThe potential is bounded and integer-valued, so the process terminates in a chain under inclusion. Coordinate multiplicities stay equal to two, so, for , the terminal chain consists of two copies of and empty sets. The compression of an entropy sum now givesExponentiating proves the entropy bound for graphs with isolated-vertex-free intersections:
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 13 2 ii Solution Created 2026-10-03 Updated 2026-10-06
An elementary union-intersection compression replaces two occurrences in a multiset by . By entropy submodularity, this changes the sum of information entropies byA compression of an entropy sum is obtained by iterating these elementary union-intersection compressions. Summing the inequalities over the sequence, with repetitions counted according to their multiset multiplicities, proves the required monotonicity:Neither the number of occurrences of an individual coordinate nor the total number of sets changes under union-intersection compression.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 110 4 Solution Created 2026-10-03 Updated 2026-10-06
Assume the uniform hypergraph has positive average hypergraph vertex degree , so . Its hypergraph degree measure isIt is a probability measure on the vertex set; vertices of degree zero have measure zero. If the hypergraph is regular, it equals . An edgeless hypergraph has no normalized degree measure of this form and must be treated separately.
Every edge entirely in contributes to the degree sum over , giving the upper bound. For the lower bound, an edge entirely in contributes , and any other edge contributes at most . ThereforeTogether these give both degree-measure inequalities:In particular every hypergraph independent set has measure at most , which explains why degree measure can control containers even in very nonregular hypergraphs.
A sufficient container theorem. For every fixed , there are positive constants such that if andthere is a family of hypergraph containers covering all hypergraph independent sets, each with . Each container is determined by a container fingerprint with and . In particular, for sufficiently small , the number of containers is at most . We will give an algorithm and constants establishing this version.
The golden rule for container algorithms is that reconstruction may depend on the small container fingerprint, but never on unrevealed information about the independent set. When a deterministic test calls for inspecting a vertex, a positive membership answer is recorded in the container fingerprint, while a negative answer permits its exclusion from the container. All tests and all state updates must be reproducible using that container fingerprint. Choosing tests that permit only a few positive answers then yields few containers.
Here is an explicit implementation with controlled links. Use the fixed order , parameters , and a bound on nonsingleton codegrees. Let count incidences with multiplicity in the -uniform multihypergraph . Define thresholdsA saturated subset is one whose current degree has reached its threshold.
- Put ; start and their saturation families empty for . Put , , and .
- At the current vertex , for every compute the multisetRetain the multiplicity from . Compute all these multisets before modifying any at this vertex.
- Inspect if and either or for some . If it is not inspected, leave in and continue.
- On inspection, if , remove it from . If , put it in and retain it in .
- For a vertex put in , add the full multiset to for every . Then insert into every nonempty future subset with and . Once saturated, a subset stays in .
- Advance to the next vertex. To reconstruct from , use exactly the same state evolution, replacing the inspected membership test by .
Every generated edge of extends to an original edge by adding earlier vertices from . Thus, for a hypergraph independent set , no singleton generated in can be a member of . In particular an inspected vertex in cannot give a positive membership answer. All other positive answers are recorded. The golden rule for container algorithms now proves that the reconstructed container contains and that its state depends only on .
Control the possible overshoot at saturation. The multisets are added in batches; merely claiming would be wrong. In the last batch that increases , the set was not yet saturated, and the batch comes from some vertex . Its contribution is at most . HenceInduction downwards from yields, for ,Indeed the two terms in the last-batch bound have coefficients and with the same power of . Applying this nonsingleton bound to gives the singleton estimateSumming over , using , proves the requested estimate at every stage of the algorithm:It applies with multiplicities; replacing the multisets by sets in the accounting would invalidate the argument.
Check that the container fingerprint is small and the container loses positive measure. Assign each positive inspected vertex to one index witnessing its test. Its added link batch has size at least . Distinct batches count separately in the multiset. Since , the preceding bound givesThe second inequality uses for every .
For completeness, the loss of measure can be verified by a short incidence count. Put and . Every saturated singleton belongs to . Partition by its earliest vertex. An earliest vertex in accounts for at most incidences. For any other earliest vertex, the unsaturated link has size less than ; the remaining edges meet some saturated subset of .
For a saturated nonsingleton , the degree bounds imply . For a saturated singleton the corresponding bound is . Every multiedge of has fewer than nonempty subsets. These observations giveFor , all saturated subsets are singletons in , so directly summing their degrees givesSince , these inequalities prevent from having arbitrarily small measure. To make the constants explicit, letIterating the displayed inequalities gives , hence whenever . Also , so gives , while . ThereforeOne can take in the stated container fingerprint bounds. Counting subsets of size at most gives the asserted bound on the number of containers. Thus the explicit algorithm produces the family promised by the sufficient hypergraph container theorem, as well as the required intermediate degree estimate.
For the standard weak-threshold formulation, see Online containers for hypergraphs. The constants above come from the explicit incidence estimates given here.
For , no multilevel construction is needed: take the sole container to be the vertices that are not singleton edges. It contains every hypergraph independent set and has degree measure zero when ; its fingerprint is empty. The requested degree-sum inequality follows directly from the definition of .
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 103 4 i Solution Created 2026-10-03 Updated 2026-10-05
We use the abacus divisible-hook correspondence in its multiset form: the hook lengths of that are divisible by , divided by , form exactly the disjoint union of the multisets of hook lengths of the components of its quotient of a partition for modulus .
Iterating this correspondence gives, for every ,as multisets. Each Young diagram has one hook for every cell, so the cardinality of the right-hand side is , the sum of the component sizes.
For any positive integer , its P-adic valuation is the number of positive for which . Summing this identity over hooks and interchanging the finite sums provesThusThe sums are finite because hook lengths are bounded by , and the total size at each level of the quotient tower of a partition decreases by at least a factor until it reaches zero.
Set aside the selected pivot at the end, array partitioning the other entries, then move the pivot to the separation index:The loop invariant is , , , and . The segment's multiset is unchanged and all entries outside it are unchanged. A low entry is swapped into the low segment; a high entry simply extends the high segment. The loop variant is . At exit, exchanging the reserved pivot with
def partition(l: Int, r: Int): Int = {
require(0 <= l && l < r && r <= a.length)
def swap(i: Int, j: Int): Unit = {
val t = a(i); a(i) = a(j); a(j) = t
}
val chosen = bestIndex(l, r)
val x = a(chosen)
swap(chosen, r - 1)
var p = l
var j = l
while (j < r - 1) {
if (a(j) < x) {
swap(p, j)
p += 1
}
j += 1
}
swap(p, r - 1)
p
}a(p) gives , , and . The displaced value at the old pivot position was already at least . Length one is handled by self-swaps and an empty loop. Duplicate pivot values belong to the high side. This costs time and auxiliary space.

