Question

In: Computer Science

Suppose k is any natural number, k >= 0. Prove that the number of nodes in...

Suppose k is any natural number, k >= 0. Prove that the number of nodes in any binomial tree of height k is exactly 2^k.

Solutions

Expert Solution

For the binomial tree Bk,
1. There are 2k nodes.
2. The height of the binomial tree is k.
3. There are exactly ?ki ? nodes at depth i = 0,1,...,k.
4. The root has degree k, which is greater than that of any other node, moreover if the children of the root are numbered from left to right by k−1,k−2,...,0, child i is the root of the subtree Bi.


Proof of Property 1: Mathematical induction on k. The binomial tree B0 is the base binomial tree for k = 0. Clearly, by definition, B0 is a single node. Consider a binomial tree Bk, k ≥ 1. Since Bk is constructed using two copies of Bk−1, by the hypothesis, each Bk−1 has 2k−1 nodes. Thus, Bk has 2k−1 + 2k−1 = 2k nodes. Hence the claim.
Proof of Property 2: Mathematical induction on k. Clearly, B0 has height ’0’. By the hypothesis, Bk−1 has height k − 1. For Bk, one of the Bk−1’s becomes the root and hence the height increases by one when the other Bk−1 is attached. Thus, the height of Bk is k − 1 + 1 = k.
Proof of Property 3: Let D(k,i) be the number of nodes at depth i for a binomial tree of degree k. Since Bk is constructed using two copies of Bk−1, the nodes at depth (i − 1) of Bk−1 becomes the nodes at depth i for Bk. Therefore,
=
D(k, i) = D(k − 1, i) + D(k − 1, i − 1); = k−1Ci + k−1Ci−1;
(k − 1)! + (k − 1)! ; i!(k − 1 − i)! (i − 1)!(k − 1 − i + 1)!
(k−1)! ?1 1 ? = (k−i−1)!(i−1)! i+k−i ;
= k! ; i!(k − i)!
-1 7 9
= kCi
Proof of Property 4: Follows from the recursive definition of Bk.


Related Solutions

Suppose H is a binary min-heap with n nodes, Prove the following facts: Any algorithm that...
Suppose H is a binary min-heap with n nodes, Prove the following facts: Any algorithm that must nd the maximum key of the heap must search all of the leaf nodes.
Topic 2 TRUE OR FALSE Q’s 31.          A natural number is the number 0 or any...
Topic 2 TRUE OR FALSE Q’s 31.          A natural number is the number 0 or any number obtained by adding 1 to a natural number. 32.          The category of numbers called integers includes negative numbers. 33.          A rational number is any number that can be expressed without a fractional part. 34.          The base of a number system determines the number of digits used in the system. 35.          The digits used in any base are 1 through the base number. 36.         ...
prove: ambiguous implies not LL(k) for any k.
prove: ambiguous implies not LL(k) for any k.
Prove that every natural number is odd or even.
Prove that every natural number is odd or even.
Prove that if p is a polynomial with degree n and k is a real number...
Prove that if p is a polynomial with degree n and k is a real number so that p(k) = 0, then p(x)=(x-k)q(x) where q is a polynomial of degree n-1. Must use the fact that a^n-b^n=(a-b)(a^(n-1) + a^(n-2)*b + ... + ab^(n-2) + b^(n-1)).
L= {w belongs to {0,1}* | the number of 0's is a prime number} . Prove...
L= {w belongs to {0,1}* | the number of 0's is a prime number} . Prove that the language L is not regular.
Let (?,?,?) be a probability space and suppose that ?∈? is an event with ?(?)>0. Prove...
Let (?,?,?) be a probability space and suppose that ?∈? is an event with ?(?)>0. Prove that the function ?:?→[0,1] defined by ?(?)=?(?|?) is a probability on (?,?).
Let x, y be integers, and n be a natural number. Prove that x ^(2n) −...
Let x, y be integers, and n be a natural number. Prove that x ^(2n) − y ^(2n) is divisible by x + y
Let the cardinal number of N, the set of all natural numbers, be א0. Prove that...
Let the cardinal number of N, the set of all natural numbers, be א0. Prove that the product set N × N = {(m,n);m ∈ N,n ∈ N} has the same cardinal number. Further prove that Q+, the set of all positive rational numbers, has the cardinal number N_0. Hint: You may use the formula 2^(m−1)(2n − 1) to define a function from N × N to N, see the third example on page 214 of the textbook.
For independent projects, is it true that if PI>1.0, then NPV>0 and IRR>K? prove
For independent projects, is it true that if PI>1.0, then NPV>0 and IRR>K? prove
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT