Skip to content

Commit

Permalink
fix(treap.md): 修正树高证明里面推导的笔误 (OI-wiki#6110)
Browse files Browse the repository at this point in the history
  • Loading branch information
untitledunrevised authored Jan 28, 2025
1 parent 222fc31 commit 653da56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/ds/treap.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ E(\operatorname{dep}(x_i))&=\sum_{k=1}^n\Pr(x_k=\min X_{i,k}\land k\neq i)\\
&=\sum_{k=1}^{n}\Pr(x_k=\min X_{i,k})-1\\
&=\sum_{k=1}^n\dfrac{1}{|i-k|+1}-1\\
&=\sum_{k=1}^{i-1}\dfrac{1}{i-k+1}+\sum_{k=i+1}^n\dfrac{1}{k-i+1}\\
&=\sum_{j=2}^i\dfrac 1j+\sum_{j=2}^{n-k+1}\dfrac 1j\\
&=\sum_{j=2}^i\dfrac 1j+\sum_{j=2}^{n-i+1}\dfrac 1j\\
&\le 2\sum_{j=2}^n\dfrac 1j < 2\sum_{j=2}^n\int_{j-1}^j\dfrac 1x\mathrm dx\\
&=2\int_1^n\dfrac 1x\mathrm dx=2\ln n=O(\log n)
\end{aligned}
Expand Down

0 comments on commit 653da56

Please sign in to comment.