在CLRS中要求混淆的是随机建立的二叉搜索树证明

| 不知道我是否应该把它放在数学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影响 子树中键的数量似乎暗示了依赖性,因为它如何限制高度 的子树。 我显然缺少一些关键的关系。任何帮助表示赞赏,谢谢。
已邀请:
为了获得预期的时间证明,您可以将每次插入都视为独立事件。插入程序不是对抗性的(即不会尝试破坏您的二叉树)。现在,如果这确实是随机的,那么您可以考虑将插入的每个其他值(每个奇数或偶数)作为坏节点插入。坏节点是导致树高增加的节点。坏节点之间有好节点。 如果您已经有一个高度为\'h \'的树(考虑到它有O(2 ^ h)个节点),那么它的叶子将有O(2 ^(h-1))个节点(大约一半的节点是树叶)。新值无处不在的可能性是相等的(即作为这些节点中任何一个的子节点)。预计其中一半将成为叶子的左子代(将叶子节点的高度增加1),另一半将成为叶子的右子代。这为树提供了预期的O(log n)高度。因此,对这种树的每个操作都花费O(log n)。

要回复问题请先登录注册