This preview shows page 1. Sign up to view the full content.
Unformatted text preview: So, prob(a) <= prob(c). Same proof for prob(b) > prob(c). Induction Step, Assume P holds for Huffman tree with height n, show it holds for Huffman trees with height n+1. Let depth(a) > depth(b). Case 1, depth(a) <= n, then depth(b) < n. Use the technique above to combine all leaves, whose depth is n+1. Clearly, we get a new Huffman tree, in which a, b are leaves. The height of the new tree is n, and depth(a) > depth(b). By induction hypothesis, prob(a) <= prob(b). Case 2. depth(a) = n+1, ie a is a leaf. Again, Use the technique above to combine all leaves, whose depth is n+1. Then, we get a new Huffman tree, whose height is n. Then for a, it looks like: x a c where prob(x) = prob(a) + prob(c), and x will be a leaf in new tree. Lets do the same thing to b, y b T Now, x, y are leaves of new Huffman tree, whose height is n, and depth(x) > depth(y), Thus, by induction hypothesis, prob(x) <= prob(y)....
View Full Document
This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.
- Spring '03