I was asked the following question on an exam and it was only marked wrong with no other marks on it. I went to see the TA who marked it and he could only tell me that it was wrong. I suspect that he did not have the time to explain it to me. This is worrying because I must not have as good of an understanding of induction as I thought I did. Any help would be greatly appreciated as this will not be the last time I will being seeing induction.
Question:
For a proper binary tree, prove e = i + 1, where e is the number of leaves (external nodes) in the tree, and i is the number of internal nodes in the tree.
My best attempt at a proof:
Base Case: there is one node in the tree that is external.
i = 0
e = i + 1 = 1
Assume: e = i + 1
if we add a node, the node (parent) will become an internal node and the number of external nodes stays the same. Now we have e = i. However, for the tree to be a proper binary tree, we must add one more child so e = i + 1.