Two missing leaves yield at most about four shapes per nine pairs in large binary trees
Why it matters
When two tips are missing from a branching tree, different pairs of missing tips can leave the same shape. Even the most varied large tree gives only about four distinct shapes for every nine pairs one could remove. Counting pairs alone therefore overstates how much variation missing tips can produce.
If some tips are missing from a tree that branches in two at every fork, how many different branching patterns could be left? Counting the sets of missing tips overstates the possibilities. Two tips that grow from the same fork, for example, leave the same pattern whichever one is lost. The largest possible number of patterns was known for one loss. A second loss poses a different problem because it can make two previously distinct patterns look alike.
For two missing tips, we find the exact maximum at every tree size. On a large tree that attains it, there are about four distinct shapes for every nine pairs of tips one could remove. A tree built to attain the one-loss maximum falls short by one shape at 10 leaves and every third size thereafter (13, 16, and so on). More generally, for any fixed number of losses, each additional loss cuts the maximum ratio of shapes to deletion choices by a factor tending to two thirds.
Counting the shapes left by deletion
We follow the branches from a fixed starting point, the root. Each branch point has two children. A tip is called a leaf. Leaves carry no names, and exchanging the children at any fork leaves the shape unchanged. After deleting leaves, discard empty branches and contract each vertex with just one surviving child. If that vertex is the root, its child becomes the root. Two leaves with the same parent form a cherry.
For a given tree, the set of different shapes left after exactly r deletions is its deck. Each shape in the deck is a card. Let M_r(n) be the largest deck size among all trees with n leaves. Dividing by \binom nr, the number of ways to choose the lost leaves, gives the number of shapes per choice in the best case. Each shape counts once, however many choices produce it.
Clifton and colleagues [1] determined the one-loss maximum, about 2n/3, and gave a tree Z_n that attains it at each size n. This suggests (2/3)^2 as the fraction for two losses, but counting one loss at a time can count the same final shape twice.
The maximum after two losses
We enumerated all 521,866 tree shapes with 3 through 20 leaves. The first difference between the maximum and the count for Z_n appeared at ten leaves (Table 1). Just one of the 98 trees yielded ten shapes after two losses; Z_{10} yielded nine. Both trees yielded five shapes after one loss. What distinguished them was how many of those differences survived a second loss.
Table 1. Two-loss counts from the complete enumeration. The six smaller sizes, 3 through 8, have maxima 1, 1, 1, 2, 3 and 5, respectively; the one-loss construction attains all six.
| Leaves | Shapes examined | Most two-loss outcomes | Outcomes for the one-loss construction |
|---|---|---|---|
| 9 | 46 | 8 | 8 |
| 10 | 98 | 10 | 9 |
| 11 | 207 | 13 | 13 |
| 12 | 451 | 18 | 18 |
| 13 | 983 | 20 | 19 |
| 14 | 2,179 | 25 | 25 |
| 15 | 4,850 | 32 | 32 |
| 16 | 10,905 | 34 | 33 |
| 17 | 24,631 | 41 | 41 |
| 18 | 56,011 | 50 | 50 |
| 19 | 127,912 | 52 | 51 |
| 20 | 293,547 | 61 | 61 |
The periodic gap holds at every larger size. Divide the number of leaves by three, writing n=3k+e with quotient k and remainder 0\le e\le2. For n\ge9, the maximum after two losses is
For these sizes Z_n attains the maximum when the remainder e is zero or two and falls short by one when it is one. The leading term in all three cases is 2n^2/9; dividing by the number n(n-1)/2 of pairs gives the limiting fraction 4/9.
Connection to the published counting problem
Clifton and colleagues also asked how many shapes a single tree can yield when j<n-1 leaves survive, and which trees attain the maximum [1, Problem 5.3]. They asked this for sizes at which no single n-leaf tree can yield all the j-leaf shapes. In symbols, u(j)>n, where u(j) is the smallest number of leaves a tree needs to contain every j-leaf shape after pruning. For j=n-2 and every n\ge9, we give the maximum and a tree attaining it.
To see why these sizes meet the condition, first take n=9: Clifton et al. give u(7)=10 [1, Table 4]. For n\ge10, compare two shapes on n-2 leaves. One is a chain of single leaves ending in one cherry. The other has at least four cherries: join four cherries into a tree and attach any extra leaves above its root. Deleting a leaf destroys at most one cherry. It can create a cherry only if the deleted leaf belonged to a cherry, so the count cannot increase. A tree that yields the first shape in two losses thus starts with at most three cherries and cannot yield the second. A smaller tree containing every shape would also give such an n-leaf tree, since leaves can be added above its root. Hence u(n-2)>n.
The fraction of distinct shapes after sparse losses
As the tree grows, suppose the number of deletions r stays fixed or grows slowly enough that the fraction of leaves lost tends to zero. We write this condition as 1\le r=o(n). Throughout this range,
An upper bound from interchangeable leaves
Group leaves so that within each group only the number lost matters. To locate the groups on a tree with m cherries, first remove its leaves. Each cherry is now a tip. Collapse each chain of vertices with a single child. The resulting skeleton has m tips and m-1 forks, each of which had two internal children in the original tree.
Trace the original tree down to each tip or fork from the preceding skeleton fork (or from the original root if there is no preceding fork). Group the single leaves attached along that chain. At a tip, include the two leaves of the cherry in the group. At a fork, discard the group if it is empty. This rule includes the stem above the skeleton root and works even for a skeleton with just one tip.
Each tip group forms a caterpillar: a chain of single leaves ending in a cherry. However its leaves are pruned, any nonempty remainder has the unique caterpillar shape of its size. At a fork, first combine the two pruned children, dropping any empty child. Then attach the surviving leaves of the incoming chain one by one. Even if both children disappear, the surviving chain leaves form a caterpillar of known size. Thus the counts of losses in the groups determine the entire card.
There are at most 2m-1 groups, one per skeleton tip or fork. There are also at most n-m, because each of the m tip groups contains at least two leaves. The smaller of the two bounds is at most (2n-1)/3. Let p=\lfloor(2n-1)/3\rfloor, rounding down to a whole number. Even if we allow p groups and let each lose more leaves than it has, the number of lists of nonnegative counts with sum r gives the upper bound
The bound can be loose for a small tree. With 13 leaves and three losses it gives 120, while enumeration of all 983 starting trees gives a maximum of 32.
A lower bound from deletions whose positions can be recovered
Build a tree along a path. Its side branches alternate between a single leaf and a cherry, which we record as a sequence of branch sizes 1,2. Use L=2\lfloor(n-4)/3\rfloor sites along the path and end it with any fixed tree of size n-3L/2\in\{4,5,6\}. This last tree is the anchor and retains all its leaves. Even after the deletions described below, one can read the sequence from the branching pattern. Starting at the root, peel off the smaller branch at each fork until only the anchor size remains. The branch leading to the anchor is always the larger one.
Leave two sites untouched at each end of the path. Select r remaining sites at pairwise distance at least four. At each selected site delete one leaf: this removes a symbol 1 or changes a 2 to a 1. In the alternating word a removed 1 creates a run 22 (two consecutive cherries); a changed 2 creates a run 111 (three consecutive single leaves). The neighbors immediately flanking each such run have the opposite symbol: the distance rule protects the two sites on either side of each edit. Away from these neighborhoods the word still alternates. Thus each run of repeated symbols identifies one deletion. Invert 22 to 212 and 111 to 121 simultaneously; each replacement marks the middle site in the original word. Thus two different sets of selected sites cannot yield the same unmarked tree.
Figure 1. Read the branching path from the root on the left toward the fixed anchor. Removing the marked single leaf leaves two adjacent cherries; removing a leaf from the marked cherry leaves three adjacent single leaves. The two runs reveal the original deletion sites.
To count the allowed selections, number the available sites in order. Subtracting 3(j-1) from the jth selected position in increasing order gives an ordinary subset of L-4-3(r-1) positions. This supplies the lower bound
Proof of the exact two-loss count
The key distinction is whether the losses can erase a whole branch at the root. Only a leaf or a cherry can disappear in two losses. Write A+B for the tree formed by joining A and B at a new root. Measure each branch by its number of leaves. The type t of a tree is the size of its smaller root branch, capped at three. For each tree record three counts (g,h,f). Here g counts its one-loss cards, h counts those one-loss cards with no leaf child at the root, and f counts its two-loss cards. Tracking h lets us count duplicates when we attach a new leaf. The following rules apply when the resulting tree has at least ten leaves. In the formulas, a bracketed condition equals one if true and zero otherwise.
- Attach a leaf to a tree B of type t. The triple becomes (g+[t\ne1],[t\ne1],f+h). Losing the new leaf alone adds B unless B already starts with a leaf. With two losses we get a leaf attached to each two-loss card of B, or a one-loss card of B itself. A one-loss card of B is already counted if and only if it starts with a leaf. Deleting that leaf leaves a two-loss card of B. Attaching the new leaf to that card restores the one-loss shape.
- Attach a cherry (two sibling leaves) to B. The triple becomes (g+1,g,f+g+[t=3]). With two losses the intact cherry and the reduced cherry contribute disjoint classes, distinguished by smaller root branches of size two and one. Losing the whole cherry contributes B itself exactly when it is new, namely when t=3. For t=1 the same B arises by reducing the new cherry and deleting the leaf branch of B. For t=2 it arises by keeping the new cherry and deleting the cherry branch of B.
- Join trees of sizes at least three with triples (g,h,f),(G,H,F'). A coordinatewise upper bound is (g+G,g+G,f+F'+gG). Neither branch disappears, so the two losses go in one branch or are split. Ignoring duplicates only increases the bound.
The first two rules give exact counts. The last gives an upper bound because exchanging the two root branches can make differently placed losses coincide.
Bounding every root split
Write n=3k+e as above and put G(n)=2k-1+[e=2], the one-loss maximum. For n\ge10 the following rows bound (g,h,f) coordinatewise. Write u_2=G-[e=0] for the type-2 one-loss bound. The notation (a,b,c)_e selects a, b or c when e is 0, 1 or 2, respectively.
| Type | g bound | h bound | f bound |
|---|---|---|---|
| 1 | G | 1 | F |
| 2 | u_2 | u_2-1 | F-(2k-5,1,0)_e |
| 3 | G-1 | G-1 | F-(2k-4+[e=2]) |
We prove the bounds by induction on tree size: assume the bounds hold for the smaller trees at a root split and use the root rules to bound their parent. For sizes 3 through 9 use exact coordinatewise maxima by type, obtained by listing unordered child pairs and deleting leaves. Table 2 gives the starting rows; different trees may supply the maxima in different coordinates.
Table 2. Exact starting bounds (g,h,f) by smaller root branch. A dash denotes an impossible split.
| Leaves | Leaf branch | Cherry branch | Both branches at least three |
|---|---|---|---|
| 3 | (1, 0, 1) | — | — |
| 4 | (1, 0, 1) | (1, 0, 1) | — |
| 5 | (2, 1, 1) | (2, 1, 1) | — |
| 6 | (3, 1, 2) | (2, 1, 2) | (1, 1, 2) |
| 7 | (3, 1, 3) | (3, 2, 3) | (2, 2, 2) |
| 8 | (4, 1, 5) | (4, 3, 5) | (3, 3, 4) |
| 9 | (5, 1, 8) | (4, 3, 6) | (4, 4, 6) |
Apply the appropriate root rule to the child rows; for two large branches (type 3 parent) only the overall bounds on g,f are needed. To complete the induction we must show that each resulting count is at most the bound in the parent’s row.
For example, attach a leaf to a type-1 child of size 3k+1\ge10. The child's row is (2k-1,1,2(k-1)^2+2). The leaf rule keeps the first coordinate, sets the second to zero and adds one to the last, giving (2k-1,0,2(k-1)^2+3). The parent also has type 1, now at size 3k+2, so its row is (2k,1,2k(k-1)+1). Subtracting the rule's bound from the parent row gives (1,1,2k-4), nonnegative for every k\ge3.
Represent each child size below ten by itself, and every other size by b+3x, b\in\{10,11,12\}, x\ge0. Once the representatives and types are fixed, the gap between each proposed parent bound and the bound from its children is a constant plus terms linear in the free variables. Indeed the leading terms of f and g for a variable child are 2x^2 and 2x. With two variable children the product of their one-loss bounds supplies the mixed term. The quadratic terms in the join rule therefore match those in the parent row:
The single-child rules add at most a linear term to the child's two-loss bound. The overall bounds used in the two-child rule are G,F for every variable child, both supplied by type 1. Thus a gap stays nonnegative if it starts nonnegative and does not decrease when any free variable increases by one. For example, joining sizes 3i,3j\ge12 gives g-bound 2(i+j)-2 and f-bound 2(i+j)^2-6(i+j)+5, the latter one below the type 3 row.
The finite check uses only integer arithmetic. For an attachment, consider child representatives 8 through 12, each feasible type, and attachments of size 1 or 2. For a fork, take every pair of representatives from 3 through 12. Only parents of size at least ten need checking. Check the gap at the representatives and, for each representative at least ten, check that increasing it by three does not reduce any gap coordinate. All inequalities pass. The linear form of the gaps therefore proves the table at every size. It gives f\le F, and for e=1 the type 2 bound is F-1. Clifton et al.'s Z_{3k+1} attaches a cherry to Z_{3k-1}, so this last bound applies.
Trees attaining the bound
Let x be a leaf, c=x+x, d=x+c, and q=c+c. Read each of the following sums with parentheses nested to the right:
Clifton et al. define Z_n by the unique shapes through size three. Above that size they attach a leaf to Z_{n-1} when three divides n, and a cherry to Z_{n-2} otherwise. This gives Z_9=T_9 and Z_{3k+3}=x+(c+Z_{3k}). Hence Z_{3k}=T_{3k} for k\ge3. Then Z_{3k+2}=c+Z_{3k} has f=F(3k)+G(3k)=F(3k+2) and g=G(3k+2). Attaching a second cherry gives Z_{3k+4}, with f=F(3k+2)+G(3k+2)=F(3k+4)-1; the initial case Z_{10} has nine cards by direct deletion.
Enumeration and independent checks
Starting with a single leaf, we generated each size by joining all unordered pairs of smaller trees with the required total size. For each tree we formed the set of one-loss cards by pruning each child in turn, replacing the root by the other child if one disappeared. Taking the union of the one-loss decks of these cards gave the two-loss deck. We used the same enumeration to obtain the starting triples in Table 2.
As an independent check, we took the tree shapes through 11 leaves from the public appendix of Brosch and Puges [2]. We temporarily numbered the leaves, removed each pair directly, and sorted the surviving children at every fork to compare shapes after forgetting the numbers. This recovered all nine maxima for sizes 3 through 11. Direct pruning also verified the one- and two-loss counts for the constructed trees and the two-loss counts for Z_n at every size from 9 through 35. For the alternating paths, we tested 3 through 14 repeats of the leaf–cherry pair with anchors of 4, 5 and 6 leaves. Across 20,742 allowed site selections, no two selections on the same tree with the same loss budget gave the same card.
The construction gives one maximizing tree at each size; the full set of maximizers remains unknown. For three or more losses, the result gives a rate when the fraction of leaves lost tends to zero, rather than an exact count at each size. The ratio of shapes to choices counts each shape once; it is not the probability that a randomly chosen deletion has a unique outcome.
References
- Ann Clifton et al. Decks of rooted binary trees. Definition 4.8, Theorem 4.9 and Problem 5.3.
- Daniel Brosch and Diane Puges. Getting to the Root of the Problem: Sums of Squares for Limits of Trees. Version 3, appendix of tree shapes.