题解 BZOJ2720: [Violet 5]列队春游
首先显然我们可以对每一个人分开进行考虑,
令 $low$ 为小于当前人身高的人数。
当前人为 $i$。
对于一个比当前人矮的 $j$。
$j$ 有贡献的概率为: $Cnt(有)/Cnt(总)$。
Cnt(有)= $A_{n-low+1-1}^{n-low+1-1} \times A_{n}^{low-1}$ = $A_{n-low}^{n-low}\times A_{n}^{low-1}$ = $n!/(n-s+1)$
Cnt (总) = $n!$。
$P(j)=\frac{1}{n-s+1}$
$E(i)=\sum P[j]= \frac{s}{n-s+1}+1=\frac{n+1}{n-s+1}$

浙公网安备 33010602011771号