Table of Contents
Volume 2013, Article ID 543913, 11 pages
Research Article

Construction and Composition of Rooted Trees via Descent Functions

1Dipartimento di Ingegneria Meccanica e Aerospaziale, Politecnico di Torino Corso Duca degli Abruzzi 24, 10129 Torino, Italy
2Dipartimento di Matematica, Università di Torino, Via Carlo Alberto 8, 10123 Torino, Italy

Received 25 March 2013; Revised 28 June 2013; Accepted 30 June 2013

Academic Editor: Ricardo L. Soto Montero

Copyright © 2013 Marco Abrate et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.


We propose a novel approach for studying rooted trees by using functions that we will call descent functions. We provide a construction method for rooted trees that allows to study their properties through the use of descent functions. Moreover, in this way, we are able to compose rooted trees with each other. Such a new composition of rooted trees is a very powerful tool applied in this paper in order to obtain important results as the creation of new rational and Pythagorean trees.

1. Introduction

Trees represent one of the most important topics in the combinatorial theory. Generating trees whose nodes are elements of a structure may constitute an important step for studying the properties of the structure itself and for the structure visualization.

In this paper, some structural properties of trees will be dealt in a novel way in order to make easy the tree generation for sets satisfying specific requirements.

One of the main subjects of the present work is the so-called descent functions. Identifying functions of this type allows to reveal a simple and direct technique to the generation of trees on sets equipped with a weight function over a partially ordered set. Furthermore, the introduced technique yields to a substantial simplification of the study of tree levels and easily and directly finds the degree of any node.

Moreover, we introduce a composition of trees, which represents a completely new and very powerful tool for the generation of trees. This operation gives the feasibility of generating a new tree starting from a given pair of trees associated with a generating system once we assign a partition of the system itself. We present some examples to show the power of this tool. In particular, the composition of trees will be used to construct new examples of trees of rational numbers (rational trees) and of trees of primitive Pythagorean triples (Pythagorean trees). These applications are of special interest because nowadays only three examples of the first type [14] and two of the latter are known [57]. On the other hand, one can observe that the used techniques allow to generate an infinite number of trees of either type, and that the shown applications are merely representative.

The techniques of explicit construction of the trees described here show some features that arise from properties of the algebraic elements involved, making themselves natural and rigorous.

2. Tree Construction via Descent Functions

In this section, we present a new and useful approach to rooted trees by using particular functions that we will call descent functions. Let us start from the following.

Definition 1. A weight function over is a function , for any set and , such that (1)is a partially ordered set, where is the relation of strict total order; (2); (3)there are no infinite sequences , with , such that , .

It is easy to see that the element is unique. Moreover, if satisfies the descending chain condition for sets, then condition (3) is immediately verified.

Definition 2. Given a weight function over , a descent function is a function , where , such that

In this way, for all , there exists an integer such that (where ). This is sufficient to use the functions and for generating rooted trees.

Let us denote by a rooted tree and by its th level ( contains only the root). We say that two nodes and are connected if and only if or . If , then is a child node whose parent node is .

Definition 3. Given a rooted tree , the level of a node is the natural number such that .

The tree structure of is then completely determined by the descent function , by means of and vice versa one has the following: Thus, a node in belongs to the th level if and only if and is the root.

Definition 4. We call descent tree a tree associated with a descent function over a set , as aforementioned, having weight function over . The structure is the generative tree system.

Remark 5. The nodes of rooted trees studied in this paper are labeled by the choice of the set ; that is, one and only one element of corresponds to each node of the tree. However, we will not refer in this case to the term label because in the following, we use such a term in order to classify the nodes in some classes.

Example 6. Let us consider the following weight and descent functions: It is straightforward to see that and satisfy Definitions 1 and 2, respectively, for and . Observing that starting from the root 1, it is easy to construct the tree, represented up to the 4th level in Figure 1.

Figure 1

Example 7. Let be the set of vectors such that , for every , and . Moreover, let us consider and the weight function defined by And thus . Let us use the following descent function: whose inverse is The resulting tree is 543913.fig.0020
where the level contains all the partitions of the integer .

Definition 8. We call natural descent function of a rooted tree the function such that is the parent node of , for any node .

Definition 9. Let us define the set .

Definition 10. Let be a descent tree, whose nodes are labeled by . The structure of is determined by the following descent function:

The tree is an infinite tree, whose nodes have infinite degree.

Theorem 11. Given any countable rooted tree , then there exists an injective function , such that the following diagram is commutative: xy(10)

The function of the theorem can be defined recursively. The idea is to assign an element of to a node of that belongs to the th floor, such that the prime is the greatest divisor of . In particular, if is the root of , then . Moreover, let us suppose that is defined over all elements of until the floor . A node is the child of a node . If and is the th child of , then In this way, any countable rooted tree is contained in the universal tree . Indeed, given a countable rooted tree , it is determined by its natural descent function . Furthermore, is the restriction of to .

Example 12. Let us consider the following tree without label: 543913.fig.0040
We can assign labels, embedding the tree into in the following way: 543913.fig.0050
that is,
The structure of the tree is determined by the descent function (9). For example, we can determine the paths of the node 30 as follows:

Example 13. The tree given in Example 6 can be labeled as follows: 543913.fig.0070
And consequently it can be derived by using the descent function (9). We can derive such a tree starting from and . Given , let and be the exponent of the greatest prime that divides and the index of the greatest prime that divides in the sequence of prime numbers, respectively. Thus, the previous tree is defined by the following laws of growth: (1)1 generates 2;(2)if and , then generates the children and ;(3)if and , then generates the child .

Now we focus on a class of rooted trees which satisfy the following.

Definition 14. Let us consider the rooted tree , whose nodes are labeled by the set (disjoint union). We call types the sets . The fact that , that is, is a node of the type , determines the number of its children and their type. We call a typed tree, and if , we indicate with the number of its children that are in (i.e., the number of its children that have type ).

In a typed tree, any node belongs to a type; that is, the number of children and their type is known. A similar class of tree is studied in [8, 9], where the nodes of the tree are labeled considering the number of children and their label.

Remark 15. In the following, we directly use typed trees to derive the order of the levels as recurrent sequences. A sequence recurs with characteristic polynomial if satisfies the linear homogeneous recurrent relation given the initial conditions . We also recall that the ordinary generating function related to a linear recurrent sequence is , where is the reflected polynomial of and the polynomial is determined from initial conditions (see, e.g., [10] for a survey on recurrent sequences).

Using previous notation, we can define the matrix of types as . Such a matrix easily allows to determine the counting sequence of the levels as a linear recurrent sequence.

Proposition 16. The sequence is a linear recurrent sequence whose characteristic polynomial is the characteristic polynomial of .

Proof. Let us define ; then . Moreover, defining the distribution of the elements of as it is immediate that It follows that any sequence recurs with the characteristic polynomial of . Since is the sum of the ’s, then it is wellknown that is a linear recurrent sequence with the same characteristic polynomial of the ’s.

Example 17. Let us consider the tree constructed in Example 6. We consider the partition where and . Then : odd numbers have only one child which is an even number; even numbers have two children (one odd and one even). As a consequence, the sequence of the levels orders of such tree is the Fibonacci sequence. Indeed, the characteristic polynomial of is , and it is straightforward to check that , .

Example 18. Let us consider the tree constructed in Example 7. This is an example of tree constructed via descent function which is not a typed tree. By Proposition 16 it follows that in a typed tree the orders of the levels are a linear recurrent sequence. In Example 7, is the number of partitions of the integer , and it is well known that such a sequence is not recurrent. Indeed, it is wellknown that the generating function of the sequence counting the number of partition of the integers is That is not a rational function (see, e.g., sequence A000041 in [11]).
However, it is interesting to see that only changing the set , the descent tree alters its structure and properties. Let us use the same set and functions , of the Example 7, but we change , taking the set of the vectors such that and for every . In this case, the inverse descent function is and the descent tree is 543913.fig.0080
Setting , where and , this is a generating tree. We easily see that , whose characteristic polynomial is . Thus, we have , for any .

An important consequence of the use of descent functions for constructing trees is the possibility of composing trees to each other in order to obtain new ones. The composition of two descent trees is simple, and it is highlighted in the following.

Definition 19. Let , be descent trees created by the generative tree systems and , respectively. Let us consider any partition formed by two subsets. We define as the composed descent tree whose associated generative system is , where

It is easy to see that since and are descent functions, the function is still a descent function, and therefore is still a descent tree. By Definition 19, it is clear that tree composition depends on the partition of and on the order of the subsets and considered in (19). This means that any partition generates two different trees; that is,

In the next sections, we apply these tools to rational trees and Pythagorean trees.

3. Applications and Examples

3.1. Rational Trees

A rational tree is a tree such that , where every positive rational number appears in the tree exactly once and each node generates children following some explicit rule. Actually, only three rational trees are known: the Kepler tree [3], the Calkin-Wilf tree [2], and the Stern-Brocot tree [1, 4].

The oldest, but the less famous, is the Kepler tree, introduced by Kepler in Harmonices Mundi in 1619. The Kepler tree is a binary tree, that is; each node has two children by means of the following rule: 543913.fig.0090

We can derive the Kepler tree via descent functions, by setting

Remark 20. The fractions in rational trees are considered with , coprime.

It is easy to see that generates the Kepler tree: 543913.fig.00100

A similar tree, recently studied, is the Calkin-Wilf tree where the construction rule is given by 543913.fig.00110

We can derive the corresponding generative system tree by means of from which we have the Calkin-Wilf tree: 543913.fig.00120

Now, we can apply the composition of descent functions stated in Definition 19 to the generative systems tree and obtaining a new generative system tree , where, for example, we can construct as follows: from which we can derive its inverse in order to construct the tree starting from the root as follows: The generative system tree generates the following tree: 543913.fig.00130

Such a tree is different from the Kepler, Calkin-Wilf, and Stern-Brocot trees. Moreover, every positive rational number appears exactly once in the tree. Indeed, given any rational number , there exists a positive integer such that , since is a descent function for the system by construction.

Theorem 21. The generative system tree , where generates a rational tree.

Remark 22. Using different partitions of into two subsets, we can apply Definition 19 in order to compose Kepler and Calkin-Wilf trees to obtain a new rational tree. This is a very important result because in this way, we are able to construct infinite rational trees.

Finally, we examine the Stern-Brocot tree from the point of view of the descent functions. The Stern-Brocot tree is a rational tree made up of mediants of two fractions and , as described in Figure 2. It is not immediate to obtain the corresponding generative system tree (despite the Kepler and Calkin-Wilf cases). However, if we consider the invertible matrices with determinant 1, we can find a descent function from which we can derive the Stern-Brocot tree. Precisely, we take the following: where means

Figure 2

Remark 23. Observe that, since the matrices considered ealier are invertible, equalities in (28) cannot hold simultaneously. Moreover, given a , or holds, except for .

It is easy to observe that using the following transformation, We can construct the Stern-Brocot tree by using the generative system tree .

Remark 24. The use of the descent function provides a new explicit representation of the Stern-Brocot tree.

In [12], a method involving continued fractions has been proposed in order to locate the position of any rational number over the Stern-Brocot tree. Here, we highlight an iterative method (involving the generative system tree ) to find the path of any rational number over the Stern-Brocot tree.

Given any rational number in the Stern-Brocot tree (with ), then it is the mediant of the fractions , , where Indeed, if is the mediant of and we must have and we obtain from which We only need to find . Since and are coprime, and we obtain If the rational number is the path on the Stern-Brocot tree is trivial to find.

Thus, given any rational number , we are able to construct the corresponding matrix such that and . Using the descent function , we have according to (27), where is the parent node of in the Stern-Brocot tree. The iteration of the descent function provides the path of the rational number .

Example 25. Let us consider the rational number ; then by (31) we have that in the Stern-Brocot tree is the mediant of Consequently the parent node of is . Now, we know from (38) that is the mediant of and , and and the parent node of is . Again, we have The parent node of is . Similarly, we obtain that the parent node of is , and finally we arrive to the root . Thus the path from the rational number to the root in the Stern-Brocot tree is

3.2. Pythagorean Trees

Pythagorean trees are trees of Pythagorean triples; that is, each node is a triple of positive integers that satisfy the equation . In the following, we describe the two known Pythagorean trees in terms of descent functions introduced in Section 2. Moreover, we will find two new Pythagorean trees by simply applying the tree composition presented in Definition 19.

We consider the sets and of all the couples where are odd coprime positive integers. The function satisfies the Definition 1 of weight function. As a matter of fact, is a partially ordered set with respect to the relation of strict total order between integers, and we have such that , and also the third condition of Definition 1 is clearly satisfied. The two systems and where are generative tree systems. Indeed, from (43), we immediately have for all that and , so the functions and are descent functions. Moreover, a simple calculation shows that So we have a complete description of the two trees and corresponding to the generative tree systems and , respectively. We show to the third level as follows: 543913.fig.0015

and to the third level as follows: 543913.fig.0016

These trees are strictly related to the Pythagorean triples. As a matter of fact, we can observe their correspondence with the two trees presented in [7] where the second columns of the matrices in the nodes are exactly the nodes of our trees. Here every node represents the primitive Pythagorean triple . The tree is the Barning-Hall tree [5, 6], while is the new Pythagorean tree presented by Price [7]. Combining and by means of the composition rule stated in Definition 19, we can generate two new Pythagorean trees. As a first step, we have to find two disjoint subsets in ; for example, we can consider the most natural partition of the set of even numbers; namely, Thanks to this partition of , we obtain the two compositions which clearly are descent functions. We easily determine their inverses using the definitions of and as follows. When , we have for the elements belonging to the set (44) for the elements of the set (45), On the other hand, when we have for the elements belonging to the set (44) for the elements of the set (45), the situation is the same as in (49). Therefore, if we use , we reach from the node using or from the nodes using . Moreover, we reach from the nodes using , and from the nodes using . This allows us to invert in this way as follows: With similar considerations on , we obtain The system generates the tree which we show to the third level 543913.fig.0017

The system gives rise to the tree whose first three levels appear as in Figure 3.

Figure 3

The partition of in the two subsets and allows us to complete our analysis of the four Pythagorean trees that we have considered.

Remark 26. We point out some interesting results which are straightforward applications of our approach. For each of the four Pythagorean trees described ealier, we are able to determine the related generating matrix and consequently to study the sequence of the order of the th level for . In fact, from relations (48),(49), and (50) it easily follows that (i)the generating matrix for is whose characteristic polynomial is , with roots and ; (ii)the generating matrix for is whose characteristic polynomial is with roots and ; (iii)the generating matrix for is whose characteristic polynomial is with roots and ; (iv)the generating matrix for is whose characteristic polynomial is with roots and . Clearly, the th level order of and is the same as follows: The th level order of is We observe that the sequence of level orders has ordinary generating function (see [10]) given by and is a sequence not present in the OEIS.
Finally, the th level order of is The sequence is surprisingly the sequence A000129 of Pell numbers described in OEIS.


The authors would like to thank the anonymous referees, whose suggestions improved the paper.


  1. A. Brocot, “Calcul des rouages par approximation, nouvelle methode,” Revue Chonometrique, vol. 3, pp. 186–194, 1861. View at Google Scholar
  2. N. Calkin and H. S. Wilf, “Recounting the rationals,” The American Mathematical Monthly, vol. 107, no. 4, pp. 360–363, 2000. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet
  3. A. Karttunen, An excerpt from the Book III of The Harmony of the World by Johannes Kepler.
  4. M. A. Stern, “Ueber eine zahlentheoretische Funktion,” Journal fur die Reine Und Angewandte Mathematik, vol. 55, pp. 193–220, 1858. View at Google Scholar
  5. F. J. M. Barning, “On Pythagorean and quasi-Pythagorean triangles and a generation process with the help of unimodular matrices,” Mathematisch Centrum Amsterdam Afdeling Zuivere Wiskunde, vol. ZW-001, 1963. View at Google Scholar
  6. A. Hall, “Genealogy of pythagorean triads,” The Mathematical Gazette, vol. 54, no. 390, pp. 377–379, 1970. View at Google Scholar
  7. H. Lee Price, “The pythagorean tree: a new species,” Cornell University Library, Mathematics, History and Overview,
  8. F. R. K. Chung, R. L. Graham, V. E. Hoggatt,, and M. Kleiman, “The number of Baxter permutations,” Journal of Combinatorial Theory A, vol. 24, no. 3, pp. 382–394, 1978. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet
  9. J. West, “Generating trees and forbidden subsequences,” Discrete Mathematics, vol. 157, no. 1–13, pp. 363–374, 1996. View at Google Scholar · View at Zentralblatt MATH
  10. R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics: A Foundation for Computer Science, Addison-Wesley, Reading, Mass, USA, 2nd edition, 1994. View at MathSciNet
  11. N. J. A. Sloane, The On-Line Encyclopedia of Integer Sequences, OEIS Foundation, 2011,
  12. B. Bates, M. Bunder, and K. Tognetti, “Locating terms in the Stern-Brocot tree,” European Journal of Combinatorics, vol. 31, no. 3, pp. 1020–1033, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet