How to write formal proofs? Prove that a 0-2 finite binary tree satisfies the condition: n_e=n_i+1

Andreasihf

Andreasihf

Answered question

2022-09-05

How to write formal proofs?
Prove that a 0-2 finite binary tree satisfies the condition: n e = n i + 1
Proof 2: Induction on height of btree, call it h

Answer & Explanation

Dwayne Small

Dwayne Small

Beginner2022-09-06Added 12 answers

Step 1
We prove the claim by induction on the height h of the tree.
Base case, h = 0: The only tree of height 0 is the single node, so we have n e = 1 and n i = 0, which satisfies the claim.
Induction step: Assume that the claim holds for trees of height h, and let T be a 0-2 binary tree of height h + 1 with n e external and n i internal nodes. Let T′ be the tree obtained by removing all nodes from the bottom level of T, i.e. all the nodes at depth h + 1. Let n e and n i be the number of external and internal nodes of T′. Note that the nodes of depth h + 1 are necessarily external in T, and that T′ has height h.
Step 2
Now, each node except for the root in a 0-2 tree has exactly one sibling. This means in particular that the nodes we remove from T come in, say, k sibling pairs. For each sibling pair removed, two external nodes are removed and one internal node (the parent) is converted to an external node in T′. This gives
n e = n e 2 k + k = n e k
and
n i = n i k .
T′ has heigth h, so by induction n e = n i + 1, and we get
n e = n e + k = n i + 1 + k = n i + 1.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?