不知道我是否应该把它放在数学 stackexchange 上,但是哦。
在 CLRS 的第 300 页...
Theorem 12.4
The expected height of a randomly built binary search tree on n distinct keys is O(lgn).
他们定义了3个随机变量......
'Xn' is the height of a randomly built binary search on n keys.
'Yn' is the "exponential height", where Yn = 2^(Xn)
'Rn' is the position that the root key would occupy if the key's were sorted, its rank.
和指标随机变量Zn,1 Zn,2 Zn,3 ... Zn,n
...
'Zn,i = I{Rn = i}'
因此,他们继续进行证明(见正文),但在此过程中,他们提出了以下主张……
We claim that the indicator random variable Zn,i = I{Rn = i} is independent of the
values of Yi-1 and Yn-i. Having chosen Rn = i, the left subtree (whose exponential
height is Yi-1) is randomly built on the i-1 keys whose ranks are less than i. This
subtree is just like any other randomly built binary search tree on i-1 keys.
Other than the number of keys it contains, this subtree's structure is not affected
at all by the choice of Rn = i, and hence the random variables Yi-1 and Zn,i are
independent.
对于 Yn-i 也是如此。我的问题是那部分,除了它包含的键的数量......是的,子树的结构不受 Rn 的影响,但是 Rn 影响子树中键的数量这一事实似乎暗示了依赖于如何它限制了子树的高度。
我显然错过了一些关键的关系。任何帮助表示赞赏,谢谢。