User mouk - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-25T12:55:30Z http://mathoverflow.net/feeds/user/4247 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/16403/count-of-full-binary-trees-with-fixed-number-of-leaves Count of full, binary trees with fixed number of leaves Mouk 2010-02-25T15:23:20Z 2010-02-25T15:39:38Z <p>How many ways is there to build an arithmetic expression with fixed number of terms and fixed order? Let’s assume we have only one distinct operation that is neither commutative nor associative. The problem can be reduced to the question of how many different, full, binary trees could be constructed with a fixed number of leaves.</p> <p>Suppose we have a list of n elements which have to become leaves in a full, binary tree. The root could be chosen between each two sequential numbers. Thus, there is (n-1) different ways to choose the root. If the root is located after the i-th number, we can still construct the left child as a binary tree with i leaves and the right one with (n – i) leaves.</p> <p>The formula for the number of different ways to construct a full, binary tree is</p> <p><code>$\Phi(n) = \sum^{n-1}_{i=1}\Phi(i).\Phi(n-i)$</code></p> <p>The first value for n=1 ist set to:</p> <p><code>$\Phi(1) = 1$</code></p> <p>Is there a closed formula for this function? Is it - maybe - a popular problem in the Graph Theory with known solutions?</p> http://mathoverflow.net/questions/16403/count-of-full-binary-trees-with-fixed-number-of-leaves/16407#16407 Comment by Mouk Mouk 2010-02-25T15:47:14Z 2010-02-25T15:47:14Z That can definitely be calculated faster than the recursion :) Sorry for not voting you up. It seems I need more reputation for voting! http://mathoverflow.net/questions/16403/count-of-full-binary-trees-with-fixed-number-of-leaves/16405#16405 Comment by Mouk Mouk 2010-02-25T15:43:07Z 2010-02-25T15:43:07Z Amazing! Thanks a lot for the very handy site!