Mathematical Induction in binary trees

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
6 replies · 2K views
TheMathNoob
Messages
189
Reaction score
4

Homework Statement


Show that every 2-tree(Definition 3.2) with n internal nodes has n+1 external nodes

Homework Equations


A 2 tree is a tree which nodes have 2 children or no children.
Internal nodes are nodes which have two children
external nodes are leafs.

The Attempt at a Solution


Proof
base case
n=1
Internal nodes=1
external nodes=2

Inductive step

Inductive hypothesis: Let k internal nodes have k+1 external nodes
so k+1 internal nodes will have (k+1)+1 external nodes.
 
Physics news on Phys.org
TheMathNoob said:
so k+1 internal nodes will have (k+1)+1 external nodes.
What is your reason for thinking that that follows?
 
andrewkirk said:
What is your reason for thinking that that follows?
k internal nodes= k+1 external nodes. But I have been thinking and this doesn't make any sense.
1 internal node= 2 external nodes
so k+1 internal nodes= k+3 external nodes.

I know that when you add an internal node, you should eliminate one external node, but I don't know how to show that.
 
What happens to the internal and external node counts when you take an external node and give it two child nodes?
 
andrewkirk said:
What happens to the internal and external node counts when you take an external node and give it two child nodes?
+2 external nodes +1 internal nodes
 
Yes there are two new external nodes, but what is the net change in the number of external nodes?.
 
andrewkirk said:
Yes there are two new external nodes, but what is the net change in the number of external nodes?.
1?