Inspired by hand shaking tree

What is the number of leaf nodes in a rooted tree of 100 nodes with each node having 0 or 3 children?


The answer is 67.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Shaurya Gupta
Feb 10, 2016

We start with the root node. It will definitely have 3 3 children. In fact, each node(except the root node) will exist as a sibling to 2 2 other nodes or as a "triplet". There will be 100 1 3 = 33 \frac{100-1}3 = 33 such triplets. Each of these 33 33 triplets will have a unique parent, thus the number of nodes(including root node) with 3 3 children will be 33 33 . The rest will be leaf nodes and there will be 67 \boxed{67} of them.

Zeeshan Ali
Feb 8, 2016

After a great struggle, I finally got the possible tree just by following the logic...

I know that I am not so good in drawing and am sorry for that.. :P

Hasmik Garyaka
Oct 17, 2017

p-parents l-leaves Each parent has 3 siblings, some of them are parents except root 3 p=l+p-1 2 p+1=l l+p=3*p+1=100 p=33 l=67

Rui Encarnação
Aug 18, 2018

We start with the root as a leaf node. So, we start with 1 node and 1 leaf. In each step, we'll create 3 children to one leaf node. So, in each step, we increase the number of leaf nodes by 2 (3-1 since the new parent becomes an interior node). We need to perform 33 steps and in each step we increase the leaf number by 2 so: 1 + 33x2 = 67

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...