Proving the Number of Nodes in a Full Binary Tree

  • Thread starter Thread starter NuPowerbook
  • Start date Start date
  • Tags Tags
    Binary Tree
AI Thread Summary
To prove that a full binary tree with N≥1 leaves has 2N-1 nodes, the approach involves mathematical induction. The base case is established with P(1), where a single node equals one leaf, confirming the formula. Assuming P(k) holds true, the proof shows that adding one leaf (to make k+1) requires adding two nodes, leading to P(k+1) = 2k + 1. This confirms the inductive step, completing the proof. The definitions of full and complete binary trees were clarified, but the argument remains valid for both types.
NuPowerbook
Messages
8
Reaction score
0
I need to prove that for any full binary tree with N\geq1 leaves, that it has 2N-1 nodes. I can see this when looking at a tree, but I can't figure out how to prove this.
 
Physics news on Phys.org
I'll take a stab at it.

I would try proving by induction on N by letting P(N) be the statement that for a full binary tree with N\geq1 leaves, it has 2N-1 nodes.


starting with the simplest case (a tree consisting of a single node) we'll prove P(1).
in this case #leaves = #nodes = 1.
hence P(1) = 2(1) - 1 and P(1) is a true statement.

now let's assume that P(k) is true for some integer k, where k is greater than or equal to 1.
If we can show that P(k) implies P(k+1) then were done with the proof.

What we want to prove: P(k+1) = 2(k+1) - 1 = 2k + 1

Proof: ( I'll use the notation FBT for "full binary tree" )

a FBT with k+1 leaves has the same number of nodes of a FBT with k leaves + 2.
( notice that you can't add just one node to a FBT for it to remain full )

therefore
P(k+1) = P(k) + 2
P(k+1) = (2k-1) + 2 <---- ( here we used the assumption that P(k) is true )
P(k+1) = 2k + 1

QED


EDIT: I looked up the definitions of both full and complete binary trees online, and realize that they are a little different, however the same argument applies. I went ahead and edited out the word "complete" and changed it to "full".
 
Last edited:
Thank you for the help.
 
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...
Back
Top