随机生成的树的预期深度是多少?


19

我很早以前就考虑过这个问题,但是对此一无所知。

生成算法如下。我们假设有n离散的节点,编号从到。然后,每个在我们使在树个节点的母公司是在随机节点。依次遍历每个,以使结果成为根节点为的随机树。(也许这不够随机,但这无关紧要。)n 1 i { 1 n 1 } i { 0 i 1 } i 00n1i{1,,n1}i{0,,i1}i0

这棵树的预期深度是多少?


我认为v0是根,你的意思是说:“那对于每个i[1,n),我们做了i个节点的父......”。对?
无题

你尝试了什么?您是否尝试过编写递归关系,比如说d(i),即节点的预期深度i
DW

3
这些对象被称为“随机递归树”。
詹姆斯·马丁

Answers:


15

我认为关于有一个集中的结果elogn,但是我还没有填写细节。

我们可以得到一个上限值,该节点的概率具有d的祖先不包括0。对于每个可能的完整链d非零祖先一个1一个2d,该链的概率为1nd0d(a1,a2,...,ad)。对应于1(1a1)(1a2)(1ad)×1n1+1项的 n1n项按顺序排列。因此,此概率的上限为1(1+12+13+1n1)d其中Hn-1n-1次谐波数1+11n(d!)Hn1dHn1n1ħñ-1个日志ñ-1+γ。对于固定dÑ→交通,则概率节点Ñ是在深度d+1为至多1+12+...+1n1Hn1log(n1)+γdnnd+1

(logn)dn(d!)(1+o(1))

通过斯特林的近似,我们可以估计为

1n2πd(elognd)d.

对于大的,任何大于e log n的东西,指数的底数都很小,因此该范围很小,我们可以使用联合范围来表示存在至少一个带有d个非零祖先的节点的概率为小。delognd


看到

Luc Devroye,Omar Fawzi,Nicolas Fraiman。“缩放附件随机递归树的深度属性。”

B.皮特尔。请注意随机递归树和随机mary搜索树的高度。随机结构和算法,5:337-348,1994年。

前者声称后者以最大概率显示最大深度为,并提供了另一种证明。(e+o(1))logn


2
非常好。为了向其他读者阐明:由于您无法重复,因此术语1 + 1ai只是一个上限。(1+12++1n1)d
彼得·索尔

3

几年前回答了这个问题,但是,只是为了好玩,这里只是上限的简单证明。我们给期望设定一个界限,然后是一个尾限。

定义RV 要的节点深度{ 0 1 ... ñ - 1 }。定义ϕ i = i j = 0 e d jdii{0,1,,n1}ϕi=j=0iedj.

引理1. 预期的最大深度最多为eE[maxidi]eHn1

证明。最大深度最大为lnϕn1。要完成我们展示E[lnϕn1]eHn1

对于任何,调理上φ - 1,通过检查φ ë [ φ i1ϕi1ϕi

E[ϕi|ϕi1]=ϕi1+E[edi]=ϕi1+eiϕi1=(1+ei)ϕi1.

通过归纳法得出

E[ϕn1]=i=1n1(1+ei)<i=1n1exp(ei)=exp(eHn1).

So, by the concavity of the logarithm,

E[lnϕn1]lnE[ϕn1]<lnexp(eHn1)=eHn1.       

Here is the tail bound:

lemma 2. Fix any c0. Then Pr[maxidi]eHn1+c is at most exp(c).

Proof. By inspection of ϕ, and the Markov bound, the probability in question is at most

Pr[ϕn1exp(eHn1+c)]E[ϕn1]exp(eHn1+c).
From the proof of Lemma 1, E[ϕn1]exp(eHn1). Substituting this into the right-hand side above completes the proof.   

As for a lower bound, I think a lower bound of (e1)HnO(1) follows pretty easily by considering maxidilnϕtlnn. But... [EDIT: spoke too soon]

It doesn't seem so easy to show the tight lower bound, of (1o(1))eHn...


2

I have actually thought about the same question (although in a completely different formulation) a few months ago, as well as some close variants.

I don't have a closed form (/ asymptotic) solution for it, but you might find this view useful (are you only looking for upper bound perhaps?).

The process you describe here is a generalization of the Chinese Restaurant Process, where each "table" is a subtree whose root's parent is v0.

This also gives us a recursion formula for your question.

Denote by h(n) the expected heights of a such tree process with n nodes.

Denote by Pn(B)=ΠbB(b1)!n! (the probability of distribution B of the nodes into subtrees).

Then the quantity you're looking for, h(n), is given by:

h(n)=BBnPn(B)maxbBh(b)

If you wish to code this recursion, make sure you use the following so it won't go into infinite loop:

h(n)=BBn{{n}}Pn(B)maxbBh(b)11n!

Where Bn is the set of all partitions of n identical balls into any number of non-empty bins, and h(1)=1.


In practice, when I needed this I just used a simple monte-carlo method for estimating h(n), as trying to actually compute h by this method is extremely inefficient.


1
Thanks for the idea! Actually I wrote a monte-carlo program the first time when I met with this problem, but to my surprise the accurate result is so difficult to get.
zhxchen17
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.