# Equal branches maximize the chance that four leaves meet at one fork in a large tree

Pick four leaves at random from a tree and trace the paths that connect them. Sometimes an edge separates the leaves into two pairs. Otherwise the paths lead out from a single fork in four different directions. This second shape is called a star, or an *unresolved quartet*, because no edge shows how to group the four leaves into pairs. If branching is limited, how often can four leaves still form a star? An equal division of the leaves at one fork gives many stars there, but changing the division also changes how many stars can form at other forks.

When at most four edges meet at any vertex, the largest fraction of four-leaf sets that can form stars tends to \(59/416\), about 14.18%, as the tree grows. Four equal branches at the center, each repeatedly dividing in three, attain this limit. The same rule works for every branching limit: use all the available directions at the center and divide equally at every fork beyond it.

## The four-leaf problem

The *degree* of a vertex is the number of edges that meet there. The limit for degree four settles a question about trees with a designated root. In such a tree, the neighbors farther from the root are a vertex's children. Dossou-Olory and Wagner studied *ternary* trees, in which each vertex has at most three children. They asked how often four leaves form a particular shape when one keeps only the branches that separate those leaves, viewed from the root. In that shape, called \(Q_4\), one side of the first split leads to a single leaf; the other leads to a fork with three leaves. The largest limiting fraction of four-leaf sets with this shape is its *inducibility*. [Their Theorem 2](https://doi.org/10.23638/DMTCS-21-4-13) placed it between \(59/416\) and \(73848853/514606225\) (about 14.35% for the upper bound).

Their lower bound came from joining two complete ternary trees at a new root. In a complete ternary tree, every fork has three children and all leaves are the same distance from the root. The two trees differed in height by one edge. Remove the new root and connect its two neighbors by an edge. The top fork of the taller tree now has four identical branches: its three child branches and the whole shorter tree.

The connection holds for uneven trees too. Forgetting the root of a ternary tree leaves a tree of maximum degree four. Each star has a unique four-way fork, which must have been below the original root because the root had at most three neighbors. At that fork three of the selected leaves lie in child directions and one lies in the direction of the parent. Viewed from the original root, this is exactly \(Q_4\). Conversely, every rooted \(Q_4\) becomes a star. To go from an unrooted tree of maximum degree four to a rooted ternary tree, replace paths through degree-two vertices by single edges and insert a root on an edge. Thus at each leaf count the largest star fraction equals the largest \(Q_4\) fraction. At higher degrees the unrooted count includes both \(Q_4\) and a second rooted shape, a fork with four child directions.

## The maximum at fixed degree

Let \(d\ge4\) be the maximum allowed degree. The center can have \(d\) branches; at each fork beyond it, one edge leads back toward the center, leaving room for \(h=d-1\) children. An unrooted tree with \(n\) leaves has \(\binom n4\) four-leaf subsets. Write \(M_d(n)\) for the largest fraction of these subsets that form stars in any such tree of degree at most \(d\). Its limit, denoted by \(C\), is
\[
\lim_{n\to\infty}M_d(n)=
 C=\frac{(h-2)(h^4+4h^2+1)}{(h+1)^3(h^2+h+1)}.
\]
For \(n=d h^r\), \(r=0,1,\ldots\), the equal-branch tree is optimal even at that finite size. Each of its \(d\) central branches is a complete tree of height \(r\): every fork in the branch has \(h\) children and every leaf lies \(r\) edges from the start of the branch. For \(d=3\) the fraction is zero because a four-way fork is impossible.

A star can be centered at any fork, including one near the tips. Figure 1 shows both possibilities in the complete 12-leaf tree. There are \(3^4=81\) ways to choose one leaf in each central branch. There are also nine ways to choose all three leaves beside a given outer fork and a fourth leaf elsewhere. The total is \(81+4\times9=117\). Counting only stars that span four central branches would miss nearly a third of them.

![Two copies of the same 12-leaf tree, one highlighting four leaves in different arms, the other highlighting three leaves in one arm and a fourth across the tree.](results/quartet-centers.png)

Figure 1. Each dark subtree connects four selected leaves; the dot at its fork marks the center of that quartet. In the right panel the fourth leaf can lie anywhere outside the three-leaf branch.

## Bounding the count at all forks

Start at a single fork. To form a star centered there, choose four different directions and one leaf in each direction. Call the number of leaves in a direction its *mass*. For any four directions, the product of their masses counts the choices of leaves. Adding those products gives the star count at the fork. Each star has just one center, so adding the counts at all forks gives the total.

Write \(x=(x_1,\ldots,x_d)\) for the masses at a fork, using zeros for unused directions. Let \(e_j(x)\) denote the sum of products of \(j\) distinct entries, counting each set of entries once. The count at the fork is then \(e_4(x)\). To bound the sum of these counts, we divide the tree into branches and bound the contribution of each branch in terms of its mass and the total number of leaves, \(D=n\).

Choose a *leaf centroid*, a vertex with at most half the leaves in any direction. To find one, start at any internal vertex and walk into any direction containing more than half the leaves. After crossing an edge one cannot cross back by this rule, so the walk ends. Use this vertex as the root. At any other fork, write \(y_1,\ldots,y_h\) for the child masses, \(s=\sum y_i\), and \(t=D-s\) for the mass towards the parent. Then \(s\le D/2\), since the entire branch lies in a centroid direction. At the centroid, let \(t\) be the mass in a largest direction and \(y\) the list of remaining masses, again with sum \(s\). Now \(t\le s\), but still \(t\ge\max y_i\).

Each set of four leaves has 24 orderings. Give each branch of mass \(s\) a budget \(F_D(s)\) for all ordered stars centered inside it, including those with a leaf outside the branch. The budget is an upper bound on their number:
\[
 F_D(s)=A D s^3-Bs^4,\qquad
 A=\frac{4(h-2)}{h+1},\qquad B=\frac{3(h-2)(h+1)}{h^2+h+1}.
\]
To see why this function fits equal branching, compare the count allowed for a branch with the counts passed to its children. A vertex with \(h\) equal child masses \(s/h\) contributes
\(24[t\binom h3(s/h)^3+\binom h4(s/h)^4]\) ordered quartets. Equating this with \(F_D(s)-hF_D(s/h)\) and matching the coefficients of \(Ds^3\) and \(s^4\) gives \(A,B\). For \(d\) equal arms at the center the corresponding choice is \(C=dF_1(1/d)+24\binom d4/d^4\), which simplifies to the stated formula.

To prove the bound it suffices to show that at each fork its budget covers the quartets centered there and the budgets passed to the children. This takes two inequalities, one for an ordinary branch and one for the centroid. In both, \(x=(y,t)\), \(D=s+t\), and all masses are nonnegative.
\[
\begin{array}{lll}
t\ge s: & F_D(s)-\sum_i F_D(y_i)-24e_4(x)\ \ge0 &\text{(branch)},\\
\max y_i\le t\le s: & CD^4-\sum_{i=1}^{d}F_D(x_i)-24e_4(x)\ \ge0 &\text{(center)}.
\end{array}
\]
Sum the inequalities over internal vertices, using the center inequality just once. Every internal branch budget cancels; the \(n\) leaves each retain a budget \(F_n(1)\). If \(U\) counts the unordered stars, this gives the finite bound
\[
24U\ \le\ C n^4-A n^2+B n .
\]
In the complete construction every split is one of the equalities used to define \(A,B,C\). This proves finite optimality at the indicated sizes. Dividing by \(24\binom n4\) gives the limiting upper bound, and the complete trees approach it. To see why the limit holds at all sizes, choose \(n\) leaves uniformly from a larger tree and keep the subtree connecting them. Its star fraction, averaged over these choices, equals the original fraction because every quartet is equally likely to be kept. The smaller tree still obeys the degree bound. Thus \(M_d(n)\) cannot increase with \(n\), and the complete-tree sizes determine its limit.

## Why the bound holds at each fork

In either inequality, the left side is a polynomial in the masses. Every term has total degree four. We express an allowed split as a sum of simple vectors with nonnegative weights. When we expand the polynomial, each term uses just four of these vectors, however large the degree bound. The proof checks the sign for each possible choice of four.

Order the \(h\) entries of \(y\) from largest to smallest. A list in this order can be built up in layers: each layer adds the same amount to an initial segment of the list. With \(b_k\) the drop from coordinate \(k\) to \(k+1\) (append a zero), \(y=\sum_{k=1}^h b_k\,{\bf1}_{[k]}\), where \({\bf1}_{[k]}\) is one on the first \(k\) coordinates and zero elsewhere. Include the parent or designated direction as a last coordinate. The resulting building blocks, called rays here, are vectors of the form
\[
 R(k,u)=({\bf1}_{[k]},u).
\]
For a branch, \(x\) is the sum of \(b_k R(k,k)\) and \((t-s)R(0,1)\). For the center, begin with the sum of \(b_k R(k,1)\); this gives last coordinate \(\max y_i\). To raise the last coordinate to \(t\) without changing the others, shift weight from \(R(k,1)\) to \(R(k,k)\), starting with the largest \(k\). Stop when the last coordinate reaches \(t\), shifting only part of the weight at the final index if necessary. The available increase is \(s-\max y_i\), exactly enough to reach any allowed \(t\). This gives nonnegative ray weights. In increasing index order all rays of type \(u=1\) precede all rays of type \(u=k\), with a shared boundary index allowed.

Let \(H\) be the polynomial on the left side of either inequality, and let \(\mathcal H\) be the form that is linear in each of its four inputs, unchanged by reordering them, and satisfies \(\mathcal H(x,x,x,x)=H(x)\). Expanding each input as a sum of rays multiplies each four-ray contribution by a product of nonnegative weights. It therefore suffices to show \(\mathcal H\ge0\) on any four rays in one such sum, repeats included. Order their indices \(k_1\le\cdots\le k_4\), putting \(u=1\) first at a tie when both types are used. For the center, let \(m\) count the initial rays assigned type \(u_i=1\); the rest have \(u_i=k_i\). For a branch the same rule holds, with the first \(m\) indices zero. All indices other than those special zeros lie in \([1,h]\).

The following formulas specify the coefficient calculation. For a nonempty subset \(J\) of \(I=\{1,2,3,4\}\), write
\[
 K_J=\min_{i\in J} k_i,\qquad S_J=K_J+\prod_{i\in J}u_i,\qquad D_i=k_i+u_i .
\]
Here \(K_J\) is the sum, over child coordinates, of the product of the indicated ray entries. \(S_J\) includes the last coordinate as well. To compute the form of \(24e_4\), assign the four rays to distinct coordinates and multiply their entries. For \(J=\{j_1<\cdots<j_p\}\) let
\[
 P_J=\prod_{a=1}^p(k_{j_a}-a+1).
\]
This counts assignments to distinct *child* coordinates: the next ray has a one in every previously used coordinate, so at step \(a\) exactly \(a-1\) are taken. If the assignment is impossible, the product reaches a zero factor at the first failed step. Either all four rays use child coordinates or just one ray uses the last coordinate. Thus the form of \(24e_4\) is
\[
 E=P_I+\sum_i u_iP_{I\setminus\{i\}}.
\]

Writing \(-i=I\setminus\{i\}\), the forms to test are therefore
\[
\begin{aligned}
H_{\rm center}&=C\prod_iD_i-\tfrac A4\sum_iD_i S_{-i}+B S_I-E,\\
H_{\rm branch}&=\tfrac A4\sum_i D_i\left(\prod_{j\ne i}k_j-K_{-i}\right)
                      -B\left(\prod_i k_i-K_I\right)-E .
\end{aligned}
\]
For example, the factor \(1/4\) averages the four choices of ray supplying \(D\) in \(Ds^3\). These expressions contain no sum running to \(h\).

To check the signs for all degree bounds at once, first clear the denominators. Multiply each form by \(L=(h+1)^3(h^2+h+1)>0\). For each \(m=0,\ldots,4\), classify each positive index as \(1\), \(2\), or at least \(3\), in nondecreasing order. Keep the first two classes fixed. Write the first index in the third class as \(3+z_i\) and each subsequent one as the preceding index plus \(z_i\). Write \(h\) as the final such index plus \(z_5\), or \(3+z_5\) if that class is empty. These gaps are all nonnegative. If the resulting polynomial has only nonnegative coefficients, its value is nonnegative for every allowed choice of the gaps. The split at three matters: merely writing the smallest index as \(1+z_1\) produces coefficients of both signs.

Table 1 reports the number of case polynomials and their total number of nonzero monomial coefficients, without combining different cases. Every nonzero coefficient is positive. An identically zero polynomial requires no sign test.

Table 1. Exact counts after writing the ordered indices in terms of nonnegative gaps. The row label \(m\) counts the initial rays assigned last coordinate one.

| \(m\) | Center cases | Nonzero coefficients | Branch cases | Nonzero coefficients |
|---:|---:|---:|---:|---:|
|0|15|2964|15|2139|
|1|15|2964|10|508|
|2|15|2964|6|0|
|3|15|2526|3|0|
|4|15|2145|1|0|

Expanding products by integer arithmetic and collecting equal monomials gives 16,210 positive coefficients in total. The 110 cases exhaust the ordered indices for every integer \(h\ge3\). Each local difference is therefore nonnegative, which completes the proof.

## Finite count check

A separate calculation found the largest star count over all tree shapes and confirmed that it obeyed the finite bound for every \(4\le n\le40\) and \(4\le d\le9\). For fixed \(n,d\), we set aside one reference leaf and worked out the best count in a branch of \(s\) leaves, starting with zero at \(s=1\). We tried every division of \(s\) into two through \(h\) positive integer child sizes \(y_i\). To the best counts in those children we added the stars centered at their common fork: \((n-s)e_3(y)\) with a leaf outside the branch and \(e_4(y)\) with all leaves inside. We kept the largest total. All child choices with the given sizes can be combined, since the count centered inside a child depends on the rest of the tree only through its leaf count. The answer at \(s=n-1\) is the unrestricted maximum.

At degree four the finite bound was met at exactly 4, 12 and 36 leaves within this range. Direct enumeration on the corresponding complete trees gave 1, 117 and 9,873 unresolved quartets: for each subset we tested whether all three ways of pairing the four leaves gave the same sum of path lengths. When an edge separates two pairs, the paths joining the leaves within each pair have a smaller total length than the paths for either cross-pairing.

The theorem identifies a best tree at each complete-tree size and gives the limiting fraction for every fixed degree. Which shapes are best at intervening sizes remains open.

## Reference

Audace A. V. Dossou-Olory and Stephan Wagner. [On the inducibility of small trees](https://doi.org/10.23638/DMTCS-21-4-13). *Discrete Mathematics & Theoretical Computer Science* 21(4), article 14 (2019).
