Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Generation of random binary trees
Replies: 10   Last Post: Mar 20, 2014 10:30 AM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ] Topics: [ Previous | Next ]
 Herman Rubin Posts: 399 Registered: 2/4/10
Re: Generation of random binary trees
Posted: Feb 28, 2014 12:37 PM
 Plain Text Reply

On 2014-02-27, Mok-Kong Shen <mok-kong.shen@t-online.de> wrote:
> Am 27.02.2014 20:11, schrieb Herman Rubin:

>> Can you describe the probability model you want to use? This
>> is necessary to answer your question.

> I simply want to be able to pick any of the total number of
> different binary trees with n end nodes with equal probability.
> As I wrote, the method I employed seems to be biased towards
> favouring those trees that are comparatively flat (of lower
> height).

> M. K. Shen

Do you want equally likely labelled trees or equally likely
unlabelled ones? For the labelled trees, the method is fairly
easy; there are 2^(n-1)! labelled trees with n nodes, and going
from n-1 to n can be done by selecting a node at random and
branching there. For unlabelled trees, the problem is much
harder.

--
This address is for information only. I do not claim that these views
are those of the Statistics Department or of Purdue University.
Herman Rubin, Department of Statistics, Purdue University
hrubin@stat.purdue.edu Phone: (765)494-6054 FAX: (765)494-0558

Date Subject Author
2/26/14 Mok-Kong Shen
2/27/14 Herman Rubin
2/27/14 Mok-Kong Shen
2/28/14 Herman Rubin
2/28/14 Mok-Kong Shen
2/28/14 Gordon Sande
3/1/14 Mok-Kong Shen
2/28/14 Luis A. Afonso
3/1/14 Joe keane
3/2/14 Mok-Kong Shen
3/20/14 Mok-Kong Shen

© The Math Forum at NCTM 1994-2017. All Rights Reserved.