Binomial theorem Created 2026-09-24 Updated 2026-10-20
For a nonnegative integer and commuting quantities ,
In expanding the factors, obtain by selecting the positions that contribute . There are such choices. For example,
The coefficients are row five of Pascal's triangle, in reverse order under the displayed convention; the row is symmetric. Setting gives , the number of subsets of a five-element set. Each member has two inclusion choices, agreeing with the rule of product and the cardinality of the power set.
Catalan recurrence Created 2026-10-14 Updated 2026-10-20
The first-return decomposition of a Dyck path and the rule of product give
For a given , choose the inside path in ways and its suffix in ways. Different first-return locations give disjoint groups, so the rule of sum adds their counts. For , the terms are . Iterating the recurrence relation computes the counts without enumerating every full path.
Cayley's formula 2026-10-14
For an integer , let be the set of labelled trees with fixed vertex set . Each tree is a finite simple graph, with no distinguished root of a tree, and two trees are different exactly when their sets of edges differ. Then
Equivalently, this is the number of spanning trees of the complete graph . The labelled combinatorial structure includes the fixed labels: drawings, positions, and the order in which edges are listed do not create extra trees. For , the single vertex with no edges is the unique tree; count it separately, since the Prüfer sequence construction requires . For , the unique tree has edge and corresponds to the empty Prüfer sequence. [ref]
For four fixed labels, there are labelled trees, but only two unlabelled trees: the star graph and the path graph. There are four star graphs, one for each choice of centre. There are path graphs: arrange the labels along a graph path, then identify each ordering with its reversal, which describes the same set of edges. Thus . For instance, star graphs centred at and at have different sets of edges even though they have the same shape.
Figure 1.
All sixteen labelled trees on four fixed vertices: four star graphs and twelve path graphs, each with its Prüfer sequence
. Details.
The striking point is that connectedness and the absence of a graph cycle are global restrictions on edges, yet the answer is a power with no correction factor. The Prüfer sequence supplies a bijection that turns those restrictions into freely chosen labels. The rule of product then gives immediately. The same representation makes vertex degrees easy to count and supports uniform labelled tree generation for simulations and algorithm experiments.
Arthur Cayley's 1889 paper "A theorem on trees", published in the Quarterly Journal of Pure and Applied Mathematics, volume 23, pages 376–378, treats the counting problem and its refinement by vertex degrees. It was reprinted as paper 895 in volume XIII of his Collected Mathematical Papers, pages 26–28. This publication is the historical context for the name Cayley's formula; the name alone is not a claim of priority. [ref] [ref]
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]
Exponential generating function Created 2026-10-07 Updated 2026-10-20
An exponential generating function encodes a sequence using . For labelled counting, is the number of structures on a fixed set of distinct labels. Labels distinguish otherwise similar objects: changing which person belongs to a group can change the structure. Recover the count by coefficient extraction as . The raw coefficient is , not .
The factorial makes multiplication account automatically for distributing labels. To combine an -structure on labels and a -structure on the remaining , choose the first label subset in ways, then choose the two structures. The binomial coefficient counts how the two groups of labels interleave within the full label set. Thus
The normalization works because . This explains the usefulness of exponential generating functions for labelled counting: an ordinary Cauchy product would omit the choices of labels. See Peter Magyar, Math 482, notes for 2/7, labelled product principle.
For a concrete example, there is one undecorated set on any given collection of labels. Its exponential generating function is the exponential function . Combine a red set and a blue set, allowing either to be empty:
Every label independently receives one of two colours, giving assignments by the rule of product. With three labels, the counts by number of red labels are , totalling eight. Choosing only the two group sizes would give the four possibilities ; it would forget which labels are red.
Indeed, the ordinary generating function for the constant sequence is the geometric series . Its square has coefficient , counting pairs of nonnegative sizes. Both encodings are correct for their respective questions. The decision is whether identity matters when objects are combined.
For unordered sets of labelled components of positive size, an exponential generating function becomes : the term forgets the ordering of components. The existing rooted-tree generating function develops the richer example . A labelled rooted tree consists of its root of a tree and an unordered set of smaller labelled rooted trees, connecting the same label-distribution mechanism to recursive counting.
Factorial Created 2026-09-24 Updated 2026-10-13
For a nonnegative integer , the factorial is the product of the positive integers from to , with the empty product equal to :
Thus , , , and . The factorial counts the permutations of distinct objects: arranging gives exactly . The choice tree in permutation shows the three choices for the first position, two for the second, and one for the last.
The value has a counting explanation: the empty set has exactly one ordering, the empty list. Equivalently, it has exactly one bijection to itself, the empty function. There are no choices to make, and one completed outcome. The factorial therefore obeys the recurrence relation
The useful distinction is how many positions are filled. For integers , choosing and ordering distinct objects by sampling without replacement gives the falling factorial, while choosing an unordered -element subset gives the binomial coefficient:
For five people, assigning captain and deputy gives outcomes; choosing a two-person team gives . Every team has exactly assignments of the two roles, explaining the division. When , both counts are one. The factorial is useful here because one count of full orderings yields both formulas by cancellation and by forgetting order. [ref]
Distinctness matters. If the two copies of in are indistinguishable, the visible arrangements are just , numbering . Temporarily labelling them gives six permutations, but exchanging the two labels leaves each visible word unchanged, so every word was counted times.
Proof outline. For , choose the first object in ways, then order the remaining objects in ways. The rule of product gives the recurrence relation; repeated application gives the displayed product, starting from the one empty ordering. This explains why the factorial grows quickly: every additional distinct object introduces another multiplicative factor.
Generating function Created 2026-10-07 Updated 2026-10-14
A generating function packages a sequence into a series so that operations on objects become operations on their encodings. An ordinary generating function uses the power series ; in counting problems, the coefficient records the number of objects of size . The variable initially marks size: it need not be assigned a numerical value. Coefficient extraction writes this recovery as . One compact expression can therefore answer infinitely many counting questions, while explaining how their answers fit together.
Start with two contributions: choose from and from , with exactly one option at each allowed value. Their individual ordinary generating functions are the polynomials and . To count ordered pairs by total , multiply:
The coefficients count the ways to obtain totals zero through three. For total two, the possibilities are and ; the two corresponding monomials both contribute . There are six ordered pairs altogether, agreeing with .
Figure 1.
Polynomial multiplication groups six ordered choices by their total contribution
. Details.
If the first contribution has two distinguishable choices when , replace by . Its product with becomes . The coefficients now carry multiplicities as well as possible totals; the exponent still records cost. This lets the same construction handle several actions with identical costs without losing their separate identities.
In general, the Cauchy product gives
For each split of the total size, the rule of product counts the choices of the two components; summing over those splits counts all possibilities. This requires each combined object to have a unique decomposition into the two components. The same idea works for costs, lengths, or other additive measures, not just the number of pieces. See MIT 18.310, generating functions, sections 1–2.
Now cover a board of length with tiles of lengths one and two, without gaps or overlaps. Let count these tilings. There is exactly one empty tiling, so , and . Removing the first tile leaves a board shorter by one or two, giving the recurrence relation
These are the Fibonacci numbers shifted by one index: under the convention , . Keeping the empty tiling is essential to both the counting rule and the resulting ordinary generating function.
Figure 2.
Length-one and length-two tiles give five coverings of a length-four board and the Fibonacci recurrence
. Details.
For , the empty board or a first tile followed by a remaining tiling gives
Equivalently, : each factor chooses one tile, and counts pieces while the exponent of records total length. The same ordinary generating function counts ordered histories of two repeatable actions costing one and two units. Histories and differ despite having the same total cost. MIT's notes use dots and dashes with these costs, including the empty message. [ref]
These identities hold in formal power series algebra: each requested coefficient uses only finitely many contributions. The repeated-choice expansion is legitimate because has zero constant term; a zero-cost repeatable action would allow infinitely many histories of the same size. Numerical evaluation separately requires a convergent series. Here the radius of convergence is , the reciprocal of the golden ratio. At , the rational function equals , but the counting series diverges: that value cannot represent its sum.
Other generating functions change the encoding: an exponential generating function divides by factorials, while a Dirichlet series uses . A counting generating function also differs from a probability generating function, whose coefficients must be nonnegative and sum to one.
Pascal's triangle Created 2026-10-06 Updated 2026-10-18
Row of Pascal's triangle consists of the binomial coefficients , beginning with row . Boundary entries are one, and Pascal's identity says each interior entry is the sum of the two entries above it. The hockey-stick identity evaluates sums along its diagonals.
The highlighted entry in the binomial coefficient illustration is . Split two-person teams according to whether they contain the fifth person: six choose both members from the other four, and four contain the fifth person together with one of those four. Thus . All entries can be generated by the same local rule, so a large table of counts needs no repeated enumeration of its subsets.
Reading row seven. Label the entries in each row from on the left through on the right. Rows zero through seven are shown below. The highlighted entry comes from and . Starting with row zero , the edges remain one and Pascal's rule determines every interior entry, so mathematical induction uniquely determines the whole array.
Figure 1.
Rows zero through seven of Pascal's triangle, with
. The index increases from left to right in each row; it counts north steps in the north-east lattice path interpretation. Each row index counts all steps. Details.
The triangular and rectangular layouts describe the same entries. For a north-east lattice path ending at , set and , so . The predecessor has indices , while has indices . Thus the grid's west and south arrivals are exactly the triangle's two parents. This change of indices explains why the north-east lattice path recurrence and Pascal's rule agree.
There is also a global check on the local construction: row sums to . Every subset of an -element set appears exactly once among the classes of sizes , and each element has two inclusion choices by the rule of product. In row seven, . Replacing every subset by its complement reverses the row, explaining . The binomial theorem packages the whole row as the coefficients of .
Blaise Pascal's Traité du triangle arithmétique, published in 1665, presents an arithmetic array and connects it to combinations, games of chance, and powers of binomial expressions. This makes the connection between a counting table and several applications visible in the original work. [ref] The University of Cambridge's account of the treatise explains its 1654 composition and the organization of these applications. [ref]
The conventional worst-case estimate is the backtracking leaf bound given by the product of the initial constraint domain sizes. Before exploiting any attacking-queen constraints, the three models give respectively
Model 1 has binary choices. Model 2 has labeled queens with possible cells each. Model 3 has row variables with possible columns each. The rule of product gives the displayed bounds; assigning variables in one prescribed order avoids multiplying again by the number of variable orderings.
With mutually nonattacking prescribed queens incorporated as singleton constraint domains, the corresponding bounds improve to
In Model 1 only the prescribed occupied cells have been fixed in this estimate; immediate deletion of attacked cells tightens it further. In Model 3 consistent clues occupy distinct rows. If the clues are inconsistent, preprocessing can reject the instance immediately.
These are upper bounds on leaves, rather than exact attained counts for a fully specified pruning implementation. Ordinary backtracking rejects inconsistent partial assignments and often creates far fewer leaves; a stopped branch is itself a leaf even if not all variables were assigned. Such early leaves still obey the backtracking leaf bound, since distinct leaves describe disjoint nonempty families of full domain assignments when constraints are ignored. Counting only possible complete nonattacking assignments is a different question. For example, row/column restrictions alone reduce full assignments to at most in Model 3, but that number does not directly count failed partial leaves. Exact counts depend on variable ordering and constraint propagation, neither of which is specified.
A subset is determined uniquely by deciding, for each of the elements, whether to include it. Each decision has two possibilities. By the rule of product, there are decision strings. The correspondence between such binary strings and subsets is a bijection, so . The all-zero string corresponds to the empty subset.
The rule of product says that a sequence of choices, with possibilities at stage regardless of earlier choices, has possible outcomes. Applied to the Cartesian product of finite sets, it gives . Here independence means that the available choices do not restrict one another; no probability assumption is needed.
Each of the elements is either included or excluded, so the rule of product gives . Alternatively, partition the power set into disjoint families according to cardinality. The family of -element subsets has size equal to the binomial coefficient . The rule of sum therefore gives
The rule of product says that if a construction has stages, with exactly choices at stage after every permitted earlier history, then it has possible outcomes. The later choices need not be identical sets after different histories; their numbers must have the stated values.
For a permutation of distinct objects, choose the first object in ways, the second in ways, and continue until only one remains. Thus the number is
Every ordered arrangement is produced exactly once by its successive choices, so this counts permutations without omissions or repetitions. For , the unique empty arrangement agrees with .
Permutation Created 2026-09-24 Updated 2026-10-13
A permutation of a set is a bijection : every element has exactly one image and every element appears exactly once as an image. For a finite set, a permutation can also be recorded as an ordering of all its elements, once a reference order has been chosen. For three distinct letters , the six orderings are
There are three choices for the first letter, two unused letters for the second, and one for the third. Every path in the tree gives one complete ordering, and every ordering has one such path, so the rule of product gives , a factorial.
Figure 1.
The full choice tree for the six permutations of three distinct letters: three first choices, two second choices, and one third choice
. Details.
Ordering versus mapping. Label the reference positions . An ordering tuple of these labels describes the function ; conversely, reading the images recovers the ordering. For example,
means , , , . Its ordered image list is , whereas its cycle decomposition of a permutation is : starting at , follow its successive images back to . Parentheses in the latter expression encode arrows around a permutation cycle, rather than an image list in reference order. [ref]
The two viewpoints answer different useful questions about the same object. An ordering tells us which object occupies each position; a bijection tells us where each label is sent and allows successive rearrangements through function composition. All permutations of labels form the symmetric group, whose subgroups are permutation groups. The counting viewpoint supplies possibilities, a factorial; the mapping viewpoint reveals how rearrangements combine.
Composition convention. Apply the rightmost permutation first:
For the displayed and the transposition , direct evaluation gives
For instance, , but . Thus function composition of permutations need not be commutative; the omitted labels in these permutation cycles are fixed points.
Rule of product 2026-10-13
For finite sets, the number of ordered choices of one element from each is the product of the individual numbers of choices. More generally, if stage has exactly possible choices after every permitted history of earlier stages, the total number of full choice sequences is , by mathematical induction on the stages. This counts functions between sets of sizes , and counts the injective functions by the falling factorial when .
With five people, choose a captain in five ways and a different deputy in four ways: ordered assignments. The second choice depends on the first because the captain is excluded, but its number of permitted options is always four. The rule of product therefore applies without any assumption about independent events. To count two-person teams instead, each subset has two possible role assignments, so division by gives ten teams. This division works because every team was counted equally often.