水塘抽样:未知大小数据流的公平抽样 2025-07-15 | algorithms | #probabilistic #reservoir-sampling #streaming #randomized 面对一个不知道有多长的数据流,如何保证每个元素被等概率选中?水塘抽样用一个优雅的不变量解决了这个看似不可能的问题。