{"docId":246,"paperId":246,"url":"https:\/\/dmtcs.episciences.org\/246","doi":"10.46298\/dmtcs.246","journalName":"Discrete Mathematics & Theoretical Computer Science","issn":"","eissn":"1365-8050","volume":[{"vid":68,"name":"Vol. 1"}],"section":[],"repositoryName":"Hal","repositoryIdentifier":"hal-00955702","repositoryVersion":1,"repositoryLink":"https:\/\/hal.science\/hal-00955702v1","dateSubmitted":"2015-03-26 16:17:09","dateAccepted":"2015-06-09 14:45:01","datePublished":"1997-01-01 08:00:00","titles":{"en":"Descendants and ascendants in binary trees"},"authors":["Panholzer, Alois","Prodinger, Helmut"],"abstracts":{"en":"There are three classical algorithms to visit all the nodes of a binary tree - preorder, inorder and postorder traversal. From this one gets a natural labelling of the n internal nodes of a binary tree by the numbers 1, 2, ..., n, indicating the sequence in which the nodes are visited. For given n (size of the tree) and j (a number between 1 and n), we consider the statistics number of ascendants of node j and number of descendants of node j. By appropriate trivariate generating functions, we are able to find explicit formulae for the expectation and the variance in all instances. The heavy computations that are necessary are facilitated by MAPLE and Zeilberger's algorithm. A similar problem comes fromlabelling the leaves from left to right by 1, 2, ..., n and considering the statistic number of ascendants (=height) of leaf j. For this, Kirschenhofer [1] has computed the average. With our approach, we are also able to get the variance. In the last section, a table with asymptotic equivalents is provided for the reader's convenience."},"keywords":[["Zeilberger's algorithm"],["binary tree"],["tree traversal"],["generating function"],"[INFO.INFO-DM] Computer Science [cs]\/Discrete Mathematics [cs.DM]"]}