「Learning Notes」sth about math

连续情形

一个实数变量 x ,每次等概率随机变成 [0, x] 中的一个实数,问期望多少次后 x \le 1

\begin{aligned} f(x) &= 1 + \frac{1}{x} \int_{0}^{n} f(t) \mathrm{d} t \\ x f(x) &= x + \int_{0}^{n} f(t) \mathrm{d} t \\ x f'(x) + f(x) &= 1 + f(x) \\ f'(x) &= \frac{1}{x} \\ f(x) &= \int f'(x) \mathrm{d} x = \ln{x} + C \\ \lim_{x \rightarrow 1^{+}} f(x) &= C = 1 \\ f(x) &= \begin{cases} 0 & x \le 1 \\ 1 + \ln{x} & 1 < x \end{cases} \end{aligned}

离散情形

一个整数变量 x ,每次等概率随机变成 [1, x] 中的一个整数,问期望多少次后 x = 1

\begin{aligned} f(x) &= 1 + \frac{1}{x} \sum_{i = 1}^{n} f(i) \\ x f(x) &= x + \sum_{i = 1}^{x} f(i) \\ f(x) &= \frac{x + \sum_{i = 1}^{x - 1} f(i)}{x - 1} \\ f(x - 1) &= \frac{x - 1 + \sum_{i = 1}^{x - 2} f(i)}{x - 2} \\ \frac{x - 2}{x - 1} f(x - 1) &= \frac{x - 1 + \sum_{i = 1}^{x - 2} f(i)}{x - 1} \\ f(x) &= \frac{1}{x - 1} + f(x - 1) \\ f(x) &= \begin{cases} 0 & x = 1 \\ \sum_{i = 1}^{x - 1} \frac{1}{i} & 1 < x \end{cases} \end{aligned}