Automata and Generating Trees 289
Root:(2)
Rule:(2) (2)(2).
Example 7.77 (The Fibonacci tree) The Fibonacci tree has many uses in
computer science applications. It is a variant of the binary tree and can
be visualized as follows. The root is a red vertex. A red vertex has a blue
offspring, and a blue vertex has a blue and a red offspring. The two different
types of vertices are thus distinguished by the number of offspring, so we label
the vertices according to their number of children and obtain these rules:
Root:(1)
Rules:(1) (2), (2) (1)(2)
We can encode the information from the generating tree as an automaton
whose states correspond to the labels. Furthermore, we place an edge from
vertex l
i
to vertex l
j
for every occurrence of l
j
in the succession rule of l
i
given
by (l
i
) →···. We use the integers from 1 to the maximum number of labels
in all the succession rules as the “alphabet” for the edge labels. Formally, we
have the following definition of the automaton.
Definition 7.78 For the automaton of a generating tree, the set of states E
consists of the labels of the generating tree. The alphabet is Σ={1, 2,...,m},
where m is the maximal number of labels in any of the succession rules. For
any label l
i
with succession rule (l
i
) (l
i
1
)(l
i
2
) ···(l
i
j
), the transition rule is
defined by Δ((l
i
),k)=(l
i
k
) for k =1,...,j. S
0
is the label of the root, and
F = E.
Example 7.79 (Continuation of Example 7.76) The automaton for the com-
plete binary tree is given by
E = {(2)}, Σ={ 1, 2}, Δ((2), 1) = Δ((2), 2) = (2),S
0
=(2),
and its graph is shown in Figure 7.17. The transfer matrix for the binary tree
is A =[2].Using(7.1) of Theorem 7.33 we obtain that the generating function
for the number of vertices at height n (which correspond to paths of length n
starting from the root) in the complete binary tree as
1
1−2x
=
n≥0
2
n
x
n
,and
we recover the well-known result that the number of vertices at height n in the
complete binary tree is given by 2
n
. This is a rather trivial application of the
transfer matrix, but it shows the power of the approach.
Example 7.80 (Continuation of Example 7.77) The automaton for the Fi-
bonacci tree is given by
E = {(1), (2)}, Σ={1, 2}, Δ((1), 1) = (2), Δ((2), 1) = (1), Δ((2), 2) = (2),
© 2010 by Taylor and Francis Group, LLC