Ballot number 2026-10-20
The number of walks with up-steps and down-steps, , that never go below zero is . Reflecting the initial segment through the first step below zero pairs forbidden walks with walks having down-steps. Setting gives the Catalan number .
Binary tree Created 2026-10-13 Updated 2026-10-14
A binary tree, in the data structure convention used here, is a rooted tree in which each vertex has zero, one or two children in a rooted tree, occupying distinct left and right positions. A single left child and a single right child give different binary trees. A vertex with no children in a rooted tree is called a leaf. An empty binary tree has no root of a tree and is also allowed as a storage case. [ref]
For example, give the root of a tree label , its left child label and its right child label . Attach as the left and right children in a rooted tree of , and as those of . This binary tree has seven vertices, six edges, and height of a binary tree : a longest downward graph path contains two edges. The binary search tree lookup illustration below shows this shape alongside the binary tree consisting only of successive right children , whose height of a binary tree is .
Left and right positions specify an ordered shape, not a numerical total order on stored labels. Swapping labels and in the first example still gives a binary tree, but destroys the binary search tree property. Nor must a binary tree be balanced: the right-child chain is just as valid. The same shape convention supports a binary heap, a Huffman code, or a binary search tree, each with its own additional rules. The useful idea is to describe two smaller subtrees at each vertex, making structural recursion natural.
For a precise recursive description, a finite binary tree is either empty or a root of a tree carrying a value together with an ordered pair of disjoint smaller binary trees. The entries of this ordered pair are its left and right subtrees, each of which may be empty. Thus two binary tree child slots exist even when fewer than two children in a rooted tree exist; an empty slot does not denote an extra vertex. This decomposition is the basis of structural recursion.[ref]
4.4 Symbol Tables. Introduction to Programming in Java, section 4.4, Binary search trees: recursive definition and node representation
Left and right binary tree child slots distinguish shapes even with just one child
. Solid circles are vertices; outlined squares mark empty binary tree child slots. The first two binary trees differ only in the occupied slot at . The last two have the same four labels but different height of a binary tree. Details.In the four-vertex mixed example, has left child and right child , while has only a right child . Count its vertices by structural recursion: the empty binary tree contributes zero and each nonempty binary tree contributes one plus the counts of its left and right subtrees. Thus contributes , and contributes . The same decomposition computes height of a binary tree, supports inorder traversal, and supplies short proofs by structural induction. It separates shape from the values stored in a data structure.
Ignoring values, let count finite binary tree shapes with vertices, retaining left and right slots and counting the empty shape once. Splitting at the root of a tree gives the recurrence relationFor each left subtree size , choose its shape and the right subtree shape independently. This yields the Catalan numbers: , , and . The two shapes at are exactly the left-only and right-only examples. Forgetting the slot distinction would change the counting problem.
Catalan number Created 2026-09-24 Updated 2026-10-14
The Catalan number counts Dyck paths with semilength of a Dyck path . For a nonnegative integer ,The count includes the empty path. Of the paths with three up steps and three down steps, exactly five stay at nonnegative height. Their shapes and balanced parentheses encodings appear below.[ref]
Bijective Proof Problems by Richard P. Stanley. §5, printed pp. 38–39, formula (7) and Problems 154–159: Catalan counts, binary parenthesizations, binary trees and Dyck paths
All five Dyck paths of semilength three and their balanced parentheses encodings
. Original enumeration of six-step up/down paths with nonnegative prefix heights. An up step encodes an opening parenthesis and a down step a closing one. Each panel shows one distinct string; no path shape or illustration is copied from a source. Details.The useful connection is a shared decomposition. A Dyck path splits uniquely at its first-return decomposition of a Dyck path; a binary tree splits at its root into left and right subtrees; a binary parenthesization splits at its last operation. Each removes one outer unit and leaves an ordered pair of smaller objects. The resulting Catalan recurrence lets one count several different structures with the same calculation. A count of five does not mean the structures are physically identical: a bijection supplies the precise translation between them.
Dyck path Created 2026-09-24 Updated 2026-10-14
A Dyck path starts at , ends at , uses steps and , and never passes below the horizontal axis. Its semilength of a Dyck path is : there are up steps and down steps. The nonnegative height records a constraint throughout the journey, not just the endpoint. The Catalan number counts the Dyck paths of this size.
Eugène Charles Catalan 2026-10-14
Homepage: 200.ulg.ac.be/catalan-bio.html
For a branching process starting from one individual with offspring two with probability and zero otherwise, the finite total progeny is odd. Exploring individuals gives an active queue beginning at one, with increments or . A first hit of zero at time requires positive and negative increments and no earlier empty queue. The Catalan number counts these admissible sequences, for example by the reflection principle after removing the final down step. Independence then gives the displayed mass formula.
If , and , so . Choosing bounds every finite mass by . This does not exclude an atom at infinity. In the supercritical case that atom has mass . At criticality , the process dies out almost surely, but the Catalan number asymptotic gives masses proportional to and hence infinite mean total progeny.
Draw balls sequentially without replacement from green and red balls. Let be the first positive draw count at which the numbers of drawn green and red balls agree. For ,where denotes the falling factorial and is a Catalan number. Odd first return times are impossible because equality requires an even total number of draws.
To count the successful colour orders, encode green by a step and red by a step . If the first step is positive, a first return time means that the partial sums remain strictly positive until the last step. Delete the first positive step and the last negative step, and shift the remaining heights down by one. The result is a Dyck path of length , of which there are . Interchanging the colours doubles this count. Every such colour order has the same probability under sampling without replacement, namely , proving the formula. In particular, the numbers of successful colour orders at lengths two, four and six are two, two and four; balanced orders with an earlier return must not be counted.
Matrix-chain multiplication Created 2026-10-14 Updated 2026-10-20
Given a fixed sequence of compatible matrices , choose a binary parenthesization of that minimizes the number of scalar multiplications in ordinary matrix multiplication. The order of the matrices is fixed: parenthesization changes the grouping, not the operand order. Associativity preserves the product while intermediate matrix dimensions change the cost. The possible binary groupings are counted by the Catalan number for .
Matrix-chain split reconstruction 2026-10-18
Extend the original example by a matrix with matrix dimensions , so . The Catalan number counts all possible groupings. Their scalar multiplication costs areThe optimum is , with cost . Enumeration makes a useful check here, but dynamic programming reaches the same answer by solving ten integer intervals, including the four single-matrix base cases:For example, . The three final-split candidates for the full matrix product supply a compact certificate:The first candidate already uses the better grouping of ; the worse need not be reconsidered at the top level. This is how optimal substructure lets the table represent all five possibilities with only three final candidates.
Read , which separates from . Then separates from , and separates from . This recursion stops at every , returning the corresponding matrix name. Combining the returned expressions recovers , rather than only its cost. Every recursive call uses a shorter integer interval, establishing algorithm termination; a tied minimum may choose any attaining split. The recovered binary tree has leaves and internal nodes, so reconstruction takes steps. Its attraction is the separation between an enormous family of groupings and a small set of reusable dynamic programming states.
Narayana number 2026-10-20
The number counts Dyck paths of semilength with exactly peaks, for . Summing over gives the th Catalan number.
Noncrossing partition 2026-10-20
A partition of cyclically ordered points into blocks whose connections can be drawn inside the circle without crossings between blocks. Equivalently, no two distinct blocks contain alternating points with in one block and in the other. The number on points is the th Catalan number.
Suppose the first draw is green. The excess of green over red must remain positive after draws one through five and return to zero at draw six. After deleting the first green and final red, the remaining four steps must form a Dyck path: they have equal colour counts and never go below zero relative to the new starting level. There are such orders, and , giving and in the original game.
Interchanging green and red gives and . Thus there areorders. More generally, the Catalan number counts each sign of excursion with first return time .
Richard P. Stanley Created 2026-10-13 Updated 2026-10-14
Homepage: math.mit.edu/~rstan/
Portrait of Richard P. Stanley
. Photograph identified on the MIT Mathematics profile. Rooted plane tree 2026-10-20
A plane tree with a distinguished root and root corner, equivalently a rooted tree with a linear order on the children at each vertex. Trees with edges are counted by the Catalan number .
Triangulation of a convex polygon Created 2026-10-14 Updated 2026-10-20
A triangulation of a convex polygon divides a convex polygon into triangles using diagonals between its existing vertices of a polytope, with no diagonal crossings in the interior. For vertices it uses diagonals and produces triangles. Fixing one boundary edge, its adjacent triangle separates two smaller polygon regions; summing over the possible third vertices of a polytope gives the Catalan recurrence. Thus the number of triangulations of a convex polygon is , with the Catalan number. A quadrilateral has two choices and a pentagon has five.




