Logo Data Structures and Algorithms with Object-Oriented Design Patterns in C++
next up previous contents index

Binomial Trees

A binomial tree is a general tree with a very special shape:

Definition (Binomial Tree)  The binomial tree of order tex2html_wrap_inline61524 with root R is the tree tex2html_wrap_inline66576 defined as follows
  1. If k=0, tex2html_wrap_inline66580. I.e., the binomial tree of order zero consists of a single node, R.
  2. If k>0, tex2html_wrap_inline66586. I.e., the binomial tree of order k>0 comprises the root R, and k binomial subtrees, tex2html_wrap_inline66594, tex2html_wrap_inline66596, ..., tex2html_wrap_inline66598.

Figure gif shows the first five binomial trees, tex2html_wrap_inline66594- tex2html_wrap_inline66602. It follows directly from Definition gif that the root of tex2html_wrap_inline66576, the binomial tree of order k, has degree k. Since k may arbitrarily large, so too can the degree of the root. Furthermore, the root of a binomial tree has the largest fanout of any of the nodes in that tree.

   figure26610
Figure: Binomial Trees tex2html_wrap_inline66594, tex2html_wrap_inline66596, ..., tex2html_wrap_inline66602

The number of nodes in a binomial tree of order k is a function of k:

Theorem  The binomial tree of order k, tex2html_wrap_inline66576, contains tex2html_wrap_inline58821 nodes.

extbfProof (By induction). Let tex2html_wrap_inline66638 be the number of nodes in tex2html_wrap_inline66576, a binomial tree of order k.

Base Case By definition, tex2html_wrap_inline66594 consists a single node. Therefore tex2html_wrap_inline66646.

Inductive Hypothesis Assume that tex2html_wrap_inline66648 for tex2html_wrap_inline66650, for some tex2html_wrap_inline66652. Consider the binomial tree of order l+1:

displaymath66564

Therefore the number of nodes in tex2html_wrap_inline66656 is given by

eqnarray26890

Therefore, by induction on l, tex2html_wrap_inline66648 for all tex2html_wrap_inline61524.

It follows from Theorem gif that binomial trees only come in sizes that are a power of two. I.e., tex2html_wrap_inline66664. Furthermore, for a given power of two, there is exactly one shape of binomial tree.

Theorem  The height of tex2html_wrap_inline66576, the binomial tree of order k, is k.

extbfProof (By induction). Let tex2html_wrap_inline66672 be the height of tex2html_wrap_inline66576, a binomial tree of order k.

Base Case By definition, tex2html_wrap_inline66594 consists a single node. Therefore tex2html_wrap_inline66680.

Inductive Hypothesis Assume that tex2html_wrap_inline66682 for tex2html_wrap_inline66650, for some tex2html_wrap_inline66652. Consider the binomial tree of order l+1:

displaymath66564

Therefore the height tex2html_wrap_inline66656 is given by

eqnarray26911

Therefore, by induction on l, tex2html_wrap_inline66682 for all tex2html_wrap_inline61524.

Theorem gif tells us that the height of a binomial tree of order k is k and Theorem gif tells us that the number of nodes is tex2html_wrap_inline66648. Therefore, the height of tex2html_wrap_inline66576 is exactly tex2html_wrap_inline59891.

Figure gif shows that there are two ways to think about the construction of binomial trees. The first way follows directly from the Definition gif. I.e., binomial tex2html_wrap_inline66576 consists of a root node to which the k binomial trees tex2html_wrap_inline66594, tex2html_wrap_inline66596, ..., tex2html_wrap_inline66598 are attached as shown in Figure gif (a).

   figure26922
Figure: Two Views of Binomial Tree tex2html_wrap_inline66602

Alternatively, we can think of tex2html_wrap_inline66576 as being comprised of two binomial trees of order k-1. For example, Figure gif (b) shows that tex2html_wrap_inline66602 is made up of two instances of tex2html_wrap_inline66738. In general, suppose we have two trees of order k-1, say tex2html_wrap_inline66742 and tex2html_wrap_inline66744, where tex2html_wrap_inline66746. Then we can construct a binomial tree of order k by combining the trees to get

displaymath66566

Why do we call tex2html_wrap_inline66576 a binomial tree? It is because the number of nodes at a given depth in the tree is determined by the binomial coefficient. And the binomial coefficient derives its name from the binomial theorem. And the binomial theorem tells us how to compute the tex2html_wrap_inline58453 power of a binomial . And a binomial is an expression which consists of two terms, such as x+y. That is why it is called a binomial tree!

Theorem (Binomial Theorem)  The tex2html_wrap_inline58453 power of the binomial x+y for tex2html_wrap_inline59063 is given by

displaymath66567

where tex2html_wrap_inline66762 is called the binomial coefficient  .

extbfProof The proof of the binomial theorem is left as an exercise for the reader (Exercise gif).gif

The following theorem gives the expression for the number of nodes at a given depth in a binomial tree:

Theorem  The number of nodes at level l in tex2html_wrap_inline66576, the binomial tree of order k, where tex2html_wrap_inline66770, is given by the binomial coefficient tex2html_wrap_inline66772.

extbfProof (By induction). Let tex2html_wrap_inline66774 be the number of nodes at level l in tex2html_wrap_inline66576, a binomial tree of order k.

Base Case Since tex2html_wrap_inline66594 contains a single node, there is only one level in the tree, l=0, and exactly one node at that level. Therefore, tex2html_wrap_inline66786.

Inductive Hypothesis Assume that tex2html_wrap_inline66788 for tex2html_wrap_inline66790, for some tex2html_wrap_inline63700. The binomial tree of order h+1 is composed of two binomial trees of height h, one attached under the root of the other. Hence, the number of nodes at level l in tex2html_wrap_inline66800 is equal to the number of nodes at level l in tex2html_wrap_inline66804 plus the number of nodes at level l-1 in tex2html_wrap_inline66804:

eqnarray27151

Therefore by induction on h, tex2html_wrap_inline66788.


next up previous contents index

Bruno Copyright © 1997 by Bruno R. Preiss, P.Eng. All rights reserved.