|
|
一开始我一直顺着原文的叙述试图理解概率为何为1/(k+1), 很困惑。谢谢数值分析坛友的提醒,终于想明白了。下面试着用同一思路但不同的语言叙述一下,作为总结。- N# L2 i, k! y' J& o
& B: q( N- Y8 f8 T5 e. Z2 G' u* I( F
Let S be the set of the n elements in which there are k and only k elements that have value x. For each element w, let I be the indicator if w is examined or not, that is, I(w) = 1 if w is examined and 0 if w is not examined. X, the number of elements being examined, will be the sum of I(w) for all w in S. Accordingly, E[X] will be the sum of E[I(w)]=P{I(w)=1}. , R( F" ~+ t/ H8 A
7 ]3 v& \7 N# i8 k \6 B8 k9 x& {& {: |
For w that has a value x, the chance of w being examined is the chance that w is at the first position of a permutation of k x-valued elements. Therefore it's 1/k.. k4 {) s3 r$ i$ `. J( a
2 y" b! `& c0 T8 ?* @7 E) V; U+ c; nFor w that has a value not being x, the chance of x being examined is the chance that w is at the first position of a permutation of all k x-valued elements plus w. Therefore it's 1/(k+1).; E& e" w! r5 O2 s( O& e
/ K% R; A1 }! w, x. Z
There are k elements that have value x and n-k elements that are not equal to x, so the sum of all these probabilities will be k*(1/k) + (n-k)*(1/(k+1)) = (n+1)/(k+1).
! h* S* Z7 u; s
4 e! h2 |! p2 S( Q理解上述解法的一个关键点是对于所有不等于x的element,它能不能有机会被查验取决于而且只取决于它与k个值为x的elements的相对位置。 |
评分
-
查看全部评分
|