Logo Data Structures and Algorithms with Object-Oriented Design Patterns in Java
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_inline60478 with root R is the tree tex2html_wrap_inline65544 defined as follows
  1. If k=0, tex2html_wrap_inline65548. That is, the binomial tree of order zero consists of a single node, R.
  2. If k>0, tex2html_wrap_inline65554. That is, the binomial tree of order k>0 comprises the root R, and k binomial subtrees, tex2html_wrap_inline65562, tex2html_wrap_inline65564, ..., tex2html_wrap_inline65566.

Figure gif shows the first five binomial trees, tex2html_wrap_inline65562- tex2html_wrap_inline65570. It follows directly from Definition gif that the root of tex2html_wrap_inline65544, 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.

   figure25847
Figure: Binomial trees tex2html_wrap_inline65562, tex2html_wrap_inline65564, ..., tex2html_wrap_inline65570.

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_inline65544, contains tex2html_wrap_inline57844 nodes.

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

Base Case By definition, tex2html_wrap_inline65562 consists a single node. Therefore tex2html_wrap_inline65614.

Inductive Hypothesis Assume that tex2html_wrap_inline65616 for tex2html_wrap_inline65618, for some tex2html_wrap_inline65620. Consider the binomial tree of order l+1:

displaymath65532

Therefore the number of nodes in tex2html_wrap_inline65624 is given by

eqnarray26127

Therefore, by induction on l, tex2html_wrap_inline65616 for all tex2html_wrap_inline60478.

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

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

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

Base Case By definition, tex2html_wrap_inline65562 consists a single node. Therefore tex2html_wrap_inline65648.

Inductive Hypothesis Assume that tex2html_wrap_inline65650 for tex2html_wrap_inline65618, for some tex2html_wrap_inline65620. Consider the binomial tree of order l+1:

displaymath65532

Therefore the height tex2html_wrap_inline65624 is given by

eqnarray26149

Therefore, by induction on l, tex2html_wrap_inline65650 for all tex2html_wrap_inline60478.

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_inline65616. Therefore, the height of tex2html_wrap_inline65544 is exactly tex2html_wrap_inline58920.

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. That is, binomial tex2html_wrap_inline65544 consists of a root node to which the k binomial trees tex2html_wrap_inline65562, tex2html_wrap_inline65564, ..., tex2html_wrap_inline65566 are attached as shown in Figure gif (a).

   figure26160
Figure: Two views of binomial tree tex2html_wrap_inline65570.

Alternatively, we can think of tex2html_wrap_inline65544 as being comprised of two binomial trees of order k-1. For example, Figure gif (b) shows that tex2html_wrap_inline65570 is made up of two instances of tex2html_wrap_inline65706. In general, suppose we have two trees of order k-1, say tex2html_wrap_inline65710 and tex2html_wrap_inline65712, where tex2html_wrap_inline65714. Then we can construct a binomial tree of order k by combining the trees to get

displaymath65534

Why do we call tex2html_wrap_inline65544 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_inline57486 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_inline57486 power of the binomial x+y for tex2html_wrap_inline58076 is given by

displaymath65535

where tex2html_wrap_inline65730 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_inline65544, the binomial tree of order k, where tex2html_wrap_inline65738, is given by the binomial coefficient tex2html_wrap_inline65740.

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

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

Inductive Hypothesis Assume that tex2html_wrap_inline65756 for tex2html_wrap_inline65758, for some tex2html_wrap_inline62658. 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_inline65768 is equal to the number of nodes at level l in tex2html_wrap_inline65772 plus the number of nodes at level l-1 in tex2html_wrap_inline65772:

eqnarray26390

Therefore by induction on h, tex2html_wrap_inline65756.


next up previous contents index

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