Agnes Scott College
Larry Riddle, Agnes Scott College

Details about the Side of a Symmetric Binary Tree

Let the tree be defined by the angle θ and scaling factor r. We will take the base of the tree to be at the origin and the initial vertical trunk to be of length 1. By the "right side" of the tree we will mean the right side of the branch tips, that is, the largest x-coordinate of the branch tips.

Let \(\alpha\) be the complex number \(\alpha = e^{\theta i}=\cos{\theta} + i \sin{\theta}\). We can represent the trunk of the tree by the complex number \(i\) (which we can also think of geometrically as a vector). Recall that multiplying a vector by r will scale the vector by r, that multiplying the vector by \(\alpha\) corresponds to a counterclockwise rotation by θ, and multiplying by \(\alpha^{-1}\) corresponds to a clockwise rotation by θ. We also have \(\alpha^n = e^{n\theta i}=\cos{(n\theta)} + i \sin{(n\theta)}\) and \(\alpha^{-n} = e^{-n\theta i}=\cos{(n\theta)} - i \sin{(n\theta)}\) for all integers n.


To get to the right side of the branch tips, we need the initial branches to turn right until the last branch passes the horizontal direction. We then want to go horizontally as much as possible for each new branch in the construction of the tree. Thus we want to alternate left and right branches. This gives the path Rk(LR), where k is the smallest integer such that kθ ≥ 90°. In terms of the complex numbers, this means we want to multiply by \(\alpha^{-1}\) for the first k branches, then alternate multiplying the vectors representing the branches by \(\alpha\) and \(\alpha^{-1}\), while at the same time also multiplying by r. The branch tip for this path is therefore located at the point \((x,y)\) corresponding to the complex number

\( \left(i + i r \alpha^{-1} + i r^2 \alpha^{-2} + \ldots + i r^k \alpha^{-k}\right) + i r^k \alpha^{-k} \cdot \left( {r \alpha + r^2 + r^3 \alpha + r^4 + \dots} \right) \) \[ \begin{align} &= i \left( \sum_{n=0}^{k}{r^n \alpha^{-n}} + r^k \alpha^{-k} \cdot \left( \dfrac{ra}{1-r^2} + \frac{r^2}{1-r^2} \right) \right) \\ \\ &= i \left( \sum_{n=0}^{k}{r^n \alpha^{-n}} + \frac{r^{k+1}\alpha^{-(k-1)} + r^{k+2}\alpha^{-k}}{1-r^2} \right) = iz. \end{align} \]

The x-coordinate of this branch tip is \(\text{Re}(iz) = -\text{Im}(z)\), or

\[ \sum_{n=0}^{k}{r^n \sin(n \theta)} + \frac{r^{k+1} \sin((k-1)\theta) + r^{k+2} \sin(k \theta)}{1-r^2}. \] Here is an example with θ = 55°, so k = 2. The image on the left shows the R2(LR) path while the image on the right shows the actual tree. The x-coordinate of the R2(LR) branch tip is x = 1.60947.

bottomPathExample bottom55-0.65tree
R2(LR) path, θ = 55°, r = 0.65


The following image shows two paths for the symmetric binary tree for θ = 100° and r = 0.95. The smallest integer satisfying kθ ≥ 90° is k = 1, so this example shows that the path described above will not always produce the branch tip with the largest x-coordinate. The red path R(LR) has a branch tip with x = 9.59556 while the blue path R5(LR) has a branch tip with x = 10.35548.

θ = 100°, r = 0.95
red: R(LR)
blue: R5(LR)

In this case the blue path is of the form Rm(LR) where m is the smallest integer satisfying mθ ≥ 450°. In essence, the blue path starts with enough right turns until the last branch has passed the rightward horizontal direction for the second time before it begins to alternate between left and right branch turns.


Let xn be the x-coordinate of the Rn(LR) branch tip. For a fixed θ, this coordinate depends on the value of r. Let k be the smallest integer satisfying kθ ≥ 90° and let m be the smallest integer satisfying mθ ≥ 450°. Let \(f_\theta (r)=x_m - x_k\) be the difference between the x-coordinates of the two corresponding branch tips , so \[ \begin{align} f_\theta (r) &= \sum_{n={k+1}}^{m}{r^n \sin(n \theta)} \\ \\ &+ \frac{r^{m+1} \sin((m-1)\theta) + r^{m+2} \sin(m \theta) - r^{k+1} \sin((k-1)\theta) - r^{k+2} \sin(k \theta)}{1-r^2} \end{align} \] If \(f_\theta (r)\) is negative then xk is greater than xm, but if \(f_\theta (r)\) is positive then xk is less than xm.

Note that \(f_\theta (0) = 0\). It can be shown [Details] that for r close to 0, the graph of \(f_\theta (r)\) will initially begin decreasing in a concave down fashion as r increases, and thus \(f_\theta (r)\) will be negative for r close to 0. Below are examples of the three things that can happen with the graph of \(f_\theta (r)\) for 0 < r < 1:

sideGraph90 sideGraph110 sideGraph100
θ = 90°
\(\lim_{r \rightarrow 1^{-}} f_\theta (r) = A_\theta < 0\)
θ = 110°
\(\lim_{r \rightarrow 1^{-}} f_\theta (r) = -\infty\)
θ = 100°
\(\lim_{r \rightarrow 1^{-}} f_\theta (r) = +\infty\)

To see why, we need to examine the behavior of the numerator of the fraction in the expression for \(f_\theta (r)\) when r = 1 since the denominator is positive and goes to 0 as r approaches 1 from the left. So we need to determine the sign of \[ N(\theta) = \sin((m-1)\theta) + \sin(m \theta) -\sin((k-1)\theta) -\sin(k \theta) \] where \(k = \lceil \frac{90}{\theta}\rceil\) and \(m = \lceil \frac{450}{\theta} \rceil\), in particular whether N(θ) is 0, negative, or positive (corresponding to the three graphs above).

Below is the graph of \(N(\theta)\) showing that \(N(\theta)\) alternates between intervals where it is positive and intervals where it is negative (with those intervals getting smaller and alternating more rapidly as θ approaches 0.)


Here are closer views of the graph on the intervals 40° ≤ θ ≤ 90° and 90° ≤ θ ≤ 180°.

sideNumeratorGraph40-90 sideNumeratorGraph90-180

The places where the graph has a sharp corner are where \(\theta = \frac{450^\circ}{p}\) for an integer p ≥ 3.

The zeros of N(θ) occur at \(\theta = \frac{540^\circ}{p}\) for all integers p ≥ 3 and at \(\theta = \frac{360^\circ}{2p+1}\) for all integers p ≥ 1 [Proof]. Starting at the right end of the graph and going in decreasing order, the first four zeros are at 180°, 135°, 120°, and 108°. Between each pair of zeros of the form \(\frac{360^\circ}{2p+1}\) there are three zeros of the form \(\frac{540^\circ}{p}\).

If θ is a zero of N(θ), then \(\lim_{r \rightarrow 1^{-}} f_\theta (r)\) exists and is negative [Proof]. Where N(θ) is negative we have \(\lim_{r \rightarrow 1^{-}} f_\theta (r) = -\infty\). For these values of θ, therefore, \(f_\theta (r) < 0\) for all 0 < r < 1 and hence yk will be greater than ym.

On the intervals where N(θ) is positive we have \(f_\theta (r)\) negative for small r and \(\lim_{r \rightarrow 1^{-}} f_\theta (r) = +\infty\), so there must be some some rS between 0 and 1 where \(f_\theta (r_S) = 0.\)

The equation \(f_\theta (r) = 0\) can be solved numerically to find the solution rS. This equation will also have a solution on the intervals where N(θ) is negative, but for those values of θ, rS will be greater than 1. The next two figures show the graph of rS for 0° < θ < 180°, and a close up of this graph just on the range 40° < θ < 108°.


The intervals where N(θ) > 0 correspond to the intervals in these graphs where rS < 1. On these intervals, the right side of the symmetric binary tree will be determined by ym rather than yk for rS < r < 1.

Notice, however, that when θ < 72°, the value of the critical scaling factor rS is greater than 0.99 so that for all practical purposes the right side of a "reasonable" symmetric binary tree will be determined by the Rk(LR) path. Any choice of r > 0.99 will produce a tree that has a massive overlap of branches. And even on the 3 intervals where N(θ) > 0 for θ > 72°, we still have rS ≥ 0.92.