Discrete Mathematics: Elementary and Beyond

(John Hannent) #1

154 8. Trees


FIGURE 8.6. Walking around a tree.

Every unlabeled tree is uniquely determined by its planar code.

Let us illuminate the proof of this by assuming that the tree is covered
by snow, and we have only its code. We ask a friend of ours to walk around
the tree just as above, and uncover the walls, and we look at the code in
the meanwhile. What do we see? Any time we see a 1, he walks along a
wall away from the root, and he cleans the snow from it. We see this as
growing a new twig. Any time we see a 0, he walks back, along an edge
already uncovered, toward the root.
Now, this describes a perfectly good way to draw the tree: We look at
the bits of the code one by one, while keeping the pen on the paper. Any
time we see a 1, we draw a new edge to a new node (and move the pen to
the new node). Any time we see a 0, we move the pen back by one edge
toward the root. Thus the tree is indeed determined by its planar code.
Since the number of possible planar codes is at most 22(n−1)=4n−^1 ,we
get that the number of unlabeled trees is at most this large. Summing up:


Theorem 8.5.1The numberTnof unlabeled trees withnnodes satisfies


nn−^2
n!

≤Tn≤ 4 n−^1.

The exact form of this lower bound does not matter much; we can con-
clude, just to have a statement simpler to remember, that the number of
unlabeled trees onnnodes is larger than 2nifnis large enough (n> 30
if you work it out). So we get, at least forn>30, the following bounds,
which are easy to remember:


2 n≤Tn≤ 4 n.

The planar code is far from optimal; every unlabeled tree has many
different codes (depending on how we draw it in the plane and how we
choose the root), and not every 0–1 sequence of length 2(n−1) is a code of
a tree (for example, it must start with a 1 and have the same number of 0’s

Free download pdf