2026-08-29
The Last Straw: A Stopping-Time Problem Where e Shows Up Three Times
2026-08-29 ~ 2026-10-15

Draw random numbers uniformly from $[0,1]$, one at a time, and keep a running sum. Stop the moment the sum first exceeds 1. Let $X_N$ denote the last number drawn — the one that pushed the total over the edge, the proverbial last straw. The question:

$$
E[X_N] = \ ?
$$

At first glance this looks innocent. Every draw is $\mathrm{U}(0,1)$ with mean $\tfrac12$, so shouldn’t the answer be something boring like $\tfrac12$? It isn’t. The last draw is special: it was selected by the stopping rule, and that selection systematically favors larger numbers. Teasing out exactly how much larger takes us through one of the most elegant corners of elementary probability — and along the way, $e$ makes three separate appearances.

2025-10-08
又一个同构不等式
2025-10-08 ~ 2025-10-08

题目:若 $a>0,b>0$,且
则判断下列选项的正误:
A: $a>b$ ; B: $a<b$ ; C: $2a>b$ ; D: $2a<b$。


解答

由已知等式两边同除以 $(a+1)(b+2)$,得到
$$
\frac{e^a}{a+1}=\frac{e^b+1}{b+2}.
$$

记
$$
f(x)=\frac{e^x}{x+1},\qquad g(x)=\frac{e^x+1}{x+2}\qquad(x>0).
$$

2025-10-06
一个同构不等式
2025-10-06 ~ 2025-10-06

证明:
$$\frac{sin(x^2)}{sin(x)}>x,(0<x<1)$$


① 不等式等价变形

由于 $0<x<1$ 时 $\sin x > 0$,两边同乘以 $\sin x$,不等式等价为
$$
\sin(x^2) > x \sin x
$$
进一步两边同除以 $x^2>0$,得到
$$
\frac{\sin(x^2)}{x^2} > \frac{\sin x}{x}
$$


② 引入辅助函数

定义函数
$$
h(t) = \frac{\sin t}{t}, \qquad t>0
$$

2025-09-06
推导两个一维正态分布的KL散度
2025-09-06 ~ 2025-09-06

设

$$
P(x) \sim \mathcal{N}(\mu_1, \sigma_1^2), \quad Q(x) \sim \mathcal{N}(\mu_2, \sigma_2^2)
$$

定义

$$
D_{\mathrm{KL}}(P\lVert Q) = \int P(x) \log \frac{P(x)}{Q(x)} dx
$$

则有

$$
\boxed{
D_{\mathrm{KL}}(P\lVert Q) = \ln \frac{\sigma_2}{\sigma_1} + \frac{(\sigma_1^2 - \sigma_2^2) + (\mu_1 - \mu_2)^2}{2\sigma_2^2}
}
$$


Step 1. 分布比值

$$
\frac{P(x)}{Q(x)} = \frac{\sigma_2}{\sigma_1} \exp \left[ \frac{\sigma_1^2(x - \mu_2)^2 - \sigma_2^2(x - \mu_1)^2}{2\sigma_1^2\sigma_2^2} \right]
$$

因此

$$
\log \frac{P(x)}{Q(x)} = \ln \frac{\sigma_2}{\sigma_1} + \frac{(\sigma_1^2 - \sigma_2^2)x^2 + (2\sigma_2^2\mu_1 - 2\sigma_1^2\mu_2)x + (\sigma_1^2\mu_2^2 - \mu_1^2\sigma_2^2)}{2\sigma_1^2\sigma_2^2}
$$