Advertisement
HimikoWerckmeister

Untitled

Mar 31st, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. 1. Proof by induction
  2. Definition of a leaf as a refresher:
  3. Leaf- a node with no children
  4.  
  5. Mathematical theorem:
  6. L(I) = I+1; where I denotes the amount internal nodes
  7.  
  8.  
  9. Basis Step:
  10. A tree with only one vertex is considered to have one internal node with no children
  11. Thus L(0) holds
  12.  
  13. Inductive hypothesis:
  14. Imagine a tree with n internal nodes, now remove two sibling leaves at any random node.
  15. Let that sub-tree be T’
  16.  
  17. Then that sub-tree has n-1 internal nodes.
  18. As a result let y = L(I) = I+1
  19. By algebraic manipulation that implies L(I-1) = I
  20. Hence by inspecting the following formula manipulation one can see that adding two leaves implies increasing the internal node count by 1. As a result the theorem holds because deducting one internal node implies that we remove two leaves. Hence the inverse holds where adding an internal node yields two new leaves.
  21. L (n) = I+2-1  I+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement