Skip to content

Advertisement

  • Research
  • Open Access

RETRACTED ARTICLE: Strong limiting behavior in binary search trees

Journal of Inequalities and Applications20132013:60

https://doi.org/10.1186/1029-242X-2013-60

  • Received: 14 June 2012
  • Accepted: 6 November 2012
  • Published:

The Retraction Note to this article has been published in Journal of Inequalities and Applications 2013 2013:416

Abstract

Abstract

In a binary search tree of size n, each node has no more than two children, we denote the number of the node with k children by ξ n , k . In this paper, we study the strong limit behavior of the random variables ξ n , k and σ n , m , where σ n , m represents the number of subtrees of size m. The results can imply some known results.

MSC: 60F05, 05C80.

Keywords

  • binary search tree
  • strong limit properties
  • nodes
  • subtrees

1 Introduction

A binary tree is either empty or composed of a root node together with left and right subtrees which are themselves binary trees. A binary search tree T for a set of keys from a total order, say { 1 , 2 , , n } , is a binary tree in which each node has a key value and all the keys of the left subtree are less than the key at the root, and all the keys of the right subtree are greater than the key at the root, i.e., the first key is associated with the root, the next key is placed in the left child of the root if it is smaller than the key of the root and it is sent to the right child of the root if it is larger than the key of the root. In this way, we proceed further by inserting key by key. This property holds recursively for the left and right subtrees of the tree T.

Usually, it is assumed that every permutation of { 1 , 2 , , n } is equally likely and has the same probability 1 / n ! . Hence, any parameter of the binary search trees may be considered as a random variable.

The binary tree model turns out to be appropriate in formal language theory, computer algebra, etc., whereas the binary search tree model is of importance in sorting and searching algorithms and a lot of combinatorial algorithms. See, e.g., [14] for a detailed description. There are several papers devoted to the study of properties of the parameters. Kirschenhofer (see [5]) considered the height of leaves; Panholzer and Prodinger (see [6]) studied the number of ascendants and the number of descendants of any fixed node. Devroye and Neininger (see [7]) obtained the tail bounds and the order of higher moments for the path distance between any couples of nodes. Mahmoud and Neininger (see [8]) arrived at a Gaussian limit law for the distance between randomly selected pairs of nodes in random binary search trees and identified the rate of convergence. Svante (see [9]) got the exact and asymptotic formulas for moments and an asymptotic distribution for the difference between the left and right total pathlenghts. Devroye (see [10]) analyzed the properties of some parameter in binary search trees by applying the Stein’s method. There were also many authors, who were interested in the height of binary search trees and drew a variety of properties such as the asymptotic expected value, the variance and the limiting distribution of the height (see [1120]). Prodinger (see [21]) computed the probability that a random binary tree with n nodes had i nodes with 2 children. Rote (see [22]) gave three combinatorial proofs for the number of the binary trees having a given number of nodes with 0, 1, and 2 children. Liu et al. (see [23]) have studied the limiting theorems for the nodes in binary search trees. Su et al. (see [24]) have studied some limit properties on the subtrees of random binary search trees.

Let T n denote a random binary search tree of size n. In the binary search tree, every node has two children at most, we denote the number of the node with k ( = 0 , 1 , 2 ) children by  ξ n , k . Let σ n , m be the number of subtrees of size m in T n . In [23], Liu et al. have studied the limit properties of ξ n , k and σ n , m in the sense of probably. In this paper, by computing the exact expression of the fourth moment of ξ n , k and σ n , m , we obtain the strong limit properties (in the sense of a.e.) of them by the Chebyshev inequality and the Borel-Cantelli lemma. Obviously, the results can imply the case in [23].

In T n , we have σ n , 1 = ξ n , 0 , σ n , k = 0 as n < k , and σ k , k = 1 . Let L n and R n be the size of the left and right subtrees of T n . It is clear that L n + R n = n 1 . From the procession of constructing binary search trees, we can see that L n and R n are two random variables with uniform distribution on { 0 , 1 , 2 , , n 1 } . We write X = D Y if X and Y have the same distribution. It is easy to find that
R n = n 1 L n = D L n .

In the following, we will show several properties of ξ n , k , and σ n , m , the proofs can be seen in [23] and [24].

Lemma 1 (see [23])

Let ξ n , 0 be the number of nodes having no children in a binary search tree of size n. For any positive integer n 2 , we have
ξ n , 0 = D ξ L n , 0 + ξ n 1 L n , 0 ,
(1)

where ξ L n , 0 = D ξ n 1 L n , 0 , and the two random variables ξ L n , 0 and ξ n 1 L n , 0 are the independent conditioning on L n .

Lemma 2 (see [23])

In a binary search tree of size n, when n 3 , we have
E ξ n , 0 = E ξ n , 1 = n + 1 3 , E ξ n , 2 = n 2 3 ,
and
Var ξ n , 0 = Var ξ n , 2 = n + 1 18 , Var ξ n , 1 = 2 ( n + 1 ) 9 .
When n > m ,
E σ n , m = 2 ( n + 1 ) ( m + 1 ) ( m + 2 ) ;
(2)
when n > 2 m ,
Var σ n , m = m ( 5 m 2 ) ( n + 1 ) ( m + 1 ) ( m + 2 ) 2 ( 2 m + 1 ) : = ( n + 1 ) d m 2 ,
(3)

where EX and VarX denote the expectation and variance of X, respectively.

In the following, by computing the fourth moment of ξ n , k and σ n , m , we obtain the strong limit properties (in the sense of a.e.) of them by the Chebyshev inequality and the Borel-Cantelli lemma.

2 Main result

Theorem 1 In a binary search tree of size n, for any integer k = 0 , 1 , 2 , we have
lim n ξ n , k n = 1 3 a.e.
(4)
Proof From the Theorem 5 of [23], we already have ξ n , 0 = ξ n , 2 + 1 and ξ n , 0 + ξ n , 1 + ξ n , 2 = n . Then we have by Lemma 2
E [ ξ n , 1 n + 1 3 ] 4 = E [ n + 1 2 ξ n , 0 n + 1 3 ] 4 = 16 E [ ξ n , 0 n + 1 3 ] 4 ,
(5)
E [ ξ n , 2 n 2 3 ] 4 = E [ ξ n , 0 1 n 2 3 ] 4 = E [ ξ n , 0 n + 1 3 ] 4 .
(6)
In the following, we will show the exact expression of E [ ξ n , 0 n + 1 3 ] 4 , then we can get (4) by the Borel-Cantelli lemma.
E [ ξ n , 0 n + 1 3 ] 4 = E [ ξ L n , 0 + ξ n 1 L n , 0 n + 1 3 ] 4 = E [ j = 0 n 1 ( ξ j , 0 j + 1 3 + ξ n j 1 , 0 n j 3 ) 4 P ( L n = j ) ] = 1 n j = 0 n 1 E [ ξ j , 0 j + 1 3 + ξ n j 1 , 0 n j 3 ] 4 = 1 n j = 0 n 1 { E [ ξ j , 0 j + 1 3 ] 4 + 4 E [ ( ξ j , 0 j + 1 3 ) 3 ( ξ n j 1 , 0 n j 3 ) ] + 6 E [ ( ξ j , 0 j + 1 3 ) 2 ( ξ n j 1 , 0 n j 3 ) 2 ] + 4 E [ ( ξ j , 0 j + 1 3 ) ( ξ n j 1 , 0 n j 3 ) 3 ] + E [ ξ n j 1 , 0 n j 3 ] 4 } .
(7)
By the independence of ξ j , 0 and ξ n j 1 , 0 , and ξ j , 0 = D ξ n j 1 , 0 , we have
E [ ( ξ j , 0 j + 1 3 ) 3 ( ξ n j 1 , 0 n j 3 ) ] = E [ ξ j , 0 j + 1 3 ] 3 E [ ξ n j 1 , 0 n j 3 ] = 0 ,
(8)
E [ ( ξ j , 0 j + 1 3 ) ( ξ n j 1 , 0 n j 3 ) 3 ] = E [ ξ j , 0 j + 1 3 ] E [ ξ n j 1 , 0 n j 3 ] 3 = 0 .
(9)
By ξ j , 0 = D ξ n j 1 , 0 , (7), (8), and (9), we have
E [ ξ n , 0 n + 1 3 ] 4 = 2 n j = 0 n 1 E [ ξ j , 0 j + 1 3 ] 4 + 6 n j = 0 n 1 E [ ξ j , 0 j + 1 3 ] 2 E [ ξ n j 1 , 0 n j 3 ] 2 = 2 n j = 0 n 1 E [ ξ j , 0 j + 1 3 ] 4 + 6 n j = 0 n 1 ( j + 1 ) ( n j ) 18 2 .
(10)
Using (10) once again, we arrive at
E [ ξ n , 0 n + 1 3 ] 4 = 2 n j = 0 n 2 E [ ξ j , 0 j + 1 3 ] 4 + 2 n E [ ξ n 1 , 0 n 3 ] 4 + 6 n j = 0 n 1 ( j + 1 ) ( n j ) 18 2 = 2 n j = 0 n 2 E [ ξ j , 0 j + 1 3 ] 4 + 6 n j = 0 n 2 ( j + 1 ) ( n 1 j ) 18 2 + 2 n E [ ξ n 1 , 0 n 3 ] 4 6 n j = 0 n 2 ( j + 1 ) ( n 1 j ) 18 2 + 6 n j = 0 n 1 ( j + 1 ) ( n j ) 18 2 = n 1 n [ 2 n 1 j = 0 n 2 E [ ξ j , 0 j + 1 3 ] 4 + 6 n 1 j = 0 n 2 ( j + 1 ) ( n 1 j ) 18 2 ] + 2 n E [ ξ n 1 , 0 n 3 ] 4 + 6 n j = 0 n 2 j + 1 18 2 + 1 54 = n + 1 n E [ ξ n 1 , 0 n 3 ] 4 + n + 1 108 .
Hence, we have
E [ ξ n , 0 n + 1 3 ] 4 n + 1 = E [ ξ n 1 , 0 n 3 ] 4 n + 1 108 .
(11)
By (11), we obtain
E [ ξ n , 0 n + 1 3 ] 4 n + 1 = = E [ ξ 2 , 0 1 ] 4 3 + n 2 108 = n 2 108 .
(12)
By (12),
E [ ξ n , 0 n + 1 1 3 ] 4 = n 2 108 ( n + 1 ) 3 1 108 ( n + 1 ) 2 .
(13)
By the Chebyshev inequality and (13), for arbitrary ε > 0 , we have
P ( | ξ n , 0 n + 1 1 3 | ε ) E [ ξ n , 0 n + 1 1 3 ] 4 ε 4 1 108 ( n + 1 ) 2 ε 4 .
Then
n = 1 P ( | ξ n , 0 n + 1 1 3 | ε ) < .
(14)
By the Borel-Cantelli lemma and (14), for arbitrary ε > 0 , we have
P ( n k { | ξ n , 0 n + 1 1 3 | ε } ) 0 ( k ) .
(15)

By (15), we have (4) holds in the case k = 0 ; by (13), (5), and (6), we have (4) holds in the case k = 1 and k = 2 . This completes the proof. □

In the following, we will show the strong limit property of σ n , m in a random binary search tree of size n.

Theorem 2 Let n, m be two positive integers, σ n , m be the number of subtrees of size m (<n) in random binary search trees of size n. Then
lim n σ n , m n = 2 ( m + 1 ) ( m + 2 ) a.e.
(16)
Proof When j < m , σ j , m 0 ; σ m , m = 1 ; when n > m , by (2) and (3), we have
E [ σ n , m 2 ( n + 1 ) ( m + 1 ) ( m + 2 ) ] 4 = E [ ( σ L n , m 2 ( L n + 1 ) ( m + 1 ) ( m + 2 ) ) + ( σ n 1 L n , m 2 ( R n + 1 ) ( m + 1 ) ( m + 2 ) ) ] 4 = 2 n j = n m n 1 E [ ( σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ) + ( 0 2 ( n j ) ( m + 1 ) ( m + 2 ) ) ] 4 + 1 n j = m n m 1 E [ ( σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ) + ( σ n 1 j , m 2 ( n j ) ( m + 1 ) ( m + 2 ) ) ] 4 = 2 n j = m n 1 E [ σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 4 + 6 n j = m n m 1 E [ σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 2 E [ σ n 1 j , m 2 ( n j ) ( m + 1 ) ( m + 2 ) ] 2 8 n j = n k n 1 2 ( n j ) ( k + 1 ) ( k + 2 ) E [ σ j , k 2 ( j + 1 ) ( k + 1 ) ( k + 2 ) ] 3 + 12 n j = n m n 1 [ 2 ( n j ) ( m + 1 ) ( m + 2 ) ] 2 E [ σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 2 + 2 n j = n m n 1 [ 2 ( n j ) ( m + 1 ) ( m + 2 ) ] 4 = n + 1 n E [ σ n 1 , m 2 n ( m + 1 ) ( m + 2 ) ] 4 + 6 d m 4 n { j = m n 1 ( j + 1 ) ( n j ) j = m n 2 ( j + 1 ) ( n 1 j ) } 16 n ( m + 1 ) ( m + 2 ) { j = n m n 1 ( n j ) E [ σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 3 j = n 1 m n 2 ( n 1 j ) E [ σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 3 } + 12 d m 2 n { j = n m n 1 [ 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 2 ( j + 1 ) j = n 1 m n 2 [ 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 2 ( j + 1 ) } .
(17)
The second term of (17),
6 d m 4 n { j = m n 1 ( j + 1 ) ( n j ) j = m n 2 ( j + 1 ) ( n 1 j ) } = 3 ( n 2 m 1 ) d m 4 + 6 ( n m ) ( m + 1 ) n d m 4 = O ( n + 1 ) ,
(18)
where x n = O ( n ) means that x n / n constant as n . Then by σ n 1 m , m / n 1 , the third term of (17),
16 n { j = n 1 m n 2 n 1 j ( m + 1 ) ( m + 2 ) E [ σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 3 j = n m n 1 n j ( m + 1 ) ( m + 2 ) E [ σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 3 } = 16 n ( m + 1 ) ( m + 2 ) × { j = n m n 2 E [ σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 3 E [ σ n 1 , m 2 n ( m + 1 ) ( m + 2 ) ] 3 } + 16 m n ( m + 1 ) ( m + 2 ) E [ σ n 1 m , m 2 ( n m ) ( m + 1 ) ( m + 2 ) ] 3 = 16 ( m + 1 ) ( m + 2 ) j = n m n 2 E [ ( σ j , m n + 2 ( j + 1 ) n ( m + 1 ) ( m + 2 ) ) ( σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ) 2 ] + 16 ( m + 1 ) ( m + 2 ) E [ ( σ n 1 , m n + 2 ( m + 1 ) ( m + 2 ) ) ( σ n 1 , m 2 n ( m + 1 ) ( m + 2 ) ) 2 ] + 16 ( m + 1 ) ( m + 2 ) × E [ ( σ n 1 m , m n 2 ( n m ) n ( m + 1 ) ( m + 2 ) ) ( σ n 1 m , m 2 ( n m ) ( m + 1 ) ( m + 2 ) ) 2 ] < 16 ( m + 1 ) ( m + 2 ) j = n m n 2 [ 0 + 2 ( j + 1 ) n ( m + 1 ) ( m + 2 ) ] E ( σ j , m 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ) 2 + 32 ( m + 1 ) ( m + 2 ) E [ ( 0 + 1 ( m + 1 ) ( m + 2 ) ) ( σ n 1 , m 2 n ( m + 1 ) ( m + 2 ) ) 2 ] + 16 ( m + 1 ) ( m + 2 ) E [ ( σ n 1 m , m n 0 ) ( σ n 1 m , m 2 ( n m ) ( m + 1 ) ( m + 2 ) ) 2 ] < 32 d m 2 [ ( m + 1 ) ( m + 2 ) ] 2 j = n m n 2 ( j + 1 ) 2 n + 32 n d m 2 [ ( m + 1 ) ( m + 2 ) ] 2 + 16 ( n m ) d m 2 ( m + 1 ) ( m + 2 ) = O ( n + 1 ) .
(19)
The last term of (17),
12 d m 2 n { j = n m n 1 [ 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 2 ( j + 1 ) j = n 1 m n 2 [ 2 ( j + 1 ) ( m + 1 ) ( m + 2 ) ] 2 ( j + 1 ) } = 12 d m 2 n { [ 2 n ( m + 1 ) ( m + 2 ) ] 2 n [ 2 ( n m ) ( m + 1 ) ( m + 2 ) ] 2 ( n m ) } < 48 d m 2 [ n 3 ( n m ) 3 ] n [ ( m + 1 ) ( m + 2 ) ] 2 = O ( n + 1 ) .
(20)
By (17), (18), (19), and (20), we have
E [ σ n , m 2 ( n + 1 ) ( m + 1 ) ( m + 2 ) ] 4 < n + 1 n E [ σ n 1 , m 2 n ( m + 1 ) ( m + 2 ) ] 4 + O ( n + 1 ) .
(21)
Repeating (21), we have
E [ σ n , m 2 ( n + 1 ) ( m + 1 ) ( m + 2 ) ] 4 n + 1 < < E [ σ 2 m + 1 , m 2 ( 2 m + 2 ) ( m + 1 ) ( m + 2 ) ] 4 2 m + 2 + O ( 1 ) .
(22)
By (22), for n large enough and fixed m, we have
E [ σ n , m n + 1 2 ( m + 1 ) ( m + 2 ) ] 4 < O ( 1 n 3 ) .
(23)
By the Chebyshev inequality, the Borel-Cantelli lemma and (23), for arbitrary ε > 0 , we have
P ( n m { | σ n , m n + 1 2 ( m + 1 ) ( m + 2 ) | ε } ) 0 ( m ) .
(24)

By (24), (16) holds. This is the end of the proof. □

Notes

Declarations

Acknowledgements

This work is supported by Anhui Scientific Research Foundation (KJ2012A205, KJ2012B117, KJ2013B162) and Chaohu University Scientific Research Foundation.

Authors’ Affiliations

(1)
Department of Mathematics, Chaohu University, Chaohu, 238000, P.R. China

References

  1. Kemp R: Fundamentals of the Average Case Analysis of Particular Algorithms. Wiley-Teubner, Stuttgart; 1984.View ArticleMATHGoogle Scholar
  2. Knuth D 3. In The Art of Computer Programming: Sorting and Searching. Addison-Wesley, Reading; 1973.Google Scholar
  3. Mahmoud H: Evolution of Random Search Trees. Wiley, New York; 1992.MATHGoogle Scholar
  4. Sedgewick R, Flajolet P: An Introduction to the Analysis of Algorithms. Addison-Wesley, Reading; 1996.MATHGoogle Scholar
  5. Kirschenhofer P: On the height of leaves in binary trees. J. Comb. Inf. Syst. Sci. 1983, 8: 44–60.MATHGoogle Scholar
  6. Panholzer A, Prodinger H: Descendants and ascendants in binary trees. Discrete Math. Theor. Comput. Sci. 1997, 1: 247–266.MATHGoogle Scholar
  7. Devroye L, Neininger R: Distances and finger search in random binary search trees. SIAM J. Comput. 2004, 33: 647–658. 10.1137/S0097539703424521View ArticleMATHGoogle Scholar
  8. Mahmoud H, Neininger R: Distribution of distances in random binary search trees. Ann. Appl. Probab. 2003, 13(1):253–276.View ArticleMATHGoogle Scholar
  9. Svante J: Left and right pathlenghts in random binary trees. Algorithmica 2006, 46: 419–429. 10.1007/s00453-006-0099-3View ArticleMATHGoogle Scholar
  10. Devroye L: Applications of Stein’s method in the analysis of random binary search trees. Institute for Mathematical Sciences Lecture Notes Series 5. In Stein’s Method and Applications. Edited by: Chen L, Barbour A. World Scientific, Singapore; 2005:247–297.View ArticleGoogle Scholar
  11. Drmota M: An analytic approach to the height of binary search trees. J. Assoc. Comput. Mach. 2001, 29: 89–119.MATHGoogle Scholar
  12. Drmota M: An analytic approach to the height of binary search trees II. J. Assoc. Comput. Mach. 2003, 50: 333–374. 10.1145/765568.765572View ArticleMATHGoogle Scholar
  13. Devroye L: A note on the height of binary search trees. J. Assoc. Comput. Mach. 1986, 33: 489–498. 10.1145/5925.5930View ArticleMATHGoogle Scholar
  14. Devroye L: Branching processes in the analysis of the height of trees. Acta Inform. 1987, 24: 277–298.MATHGoogle Scholar
  15. Drmota M: The variance of the height of binary search trees. Theor. Comput. Sci. 2002, 270: 913–919. 10.1016/S0304-3975(01)00006-8View ArticleMATHGoogle Scholar
  16. Flajolet P, Martinez C, Gourdon X: Patterns in random binary search trees. Random Struct. Algorithms 1997, 11: 223–244. 10.1002/(SICI)1098-2418(199710)11:3<223::AID-RSA2>3.0.CO;2-2View ArticleMATHGoogle Scholar
  17. Robson JM: On the concentration of the height of binary search trees. Lecture Notes in Computer Science 1256. ICALP 97 Proceedings 1997, 441–448.Google Scholar
  18. Robson JM: Constant bounds on the moments of the height of binary search trees. Theor. Comput. Sci. 2002, 276: 435–444. 10.1016/S0304-3975(01)00306-1View ArticleMATHGoogle Scholar
  19. Su C, Liu J, Feng QQ: A note on the distance in random recursive trees. Stat. Probab. Lett. 2006, 76: 1748–1755. 10.1016/j.spl.2006.04.020View ArticleMATHGoogle Scholar
  20. Su C, Liu J, Hu ZS: The law of large numbers of the size of complete interval trees. Adv. Math. China 2007, 36(2):181–188. (in Chinese)Google Scholar
  21. Prodinger H: A note on the distribution of the three types of nodes in uniform binary trees. Sémin. Lothar. Comb. 1996., 38: Article ID 38b (electronic)Google Scholar
  22. Rote G: Binary trees having a given number of nodes with 0, 1, and 2 children. Sémin. Lothar. Comb. 1997., 38: Article ID 38b (electronic)Google Scholar
  23. Liu J, Su C, Chen Y: Limiting barticle for the nodes in binary search trees. Sci. China Ser. A, Math. 2008, 51(1):101–114. 10.1007/s11425-007-0129-xView ArticleMATHGoogle Scholar
  24. Su C, Miao BQ, Feng QQ: On the subtrees of random binary search trees. Chin. J. Appl. Probab. Stat. 2006, 22(3):304–310. (in Chinese)MATHGoogle Scholar

Copyright

© Chen and Peng; licensee Springer 2013

This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Advertisement