Loading topic
random module. It also assumes elementary probability: counting outcomes, independence, and conditional probability. Before building any streaming algorithm, we need a precise definition of a correct result. Later chapters 3 min readrandom module, and with the ideas of mean and standard deviation. The proof says Algorithm R is correct. A test checks that your code is correct, and the two can dif3 min readrandom module. The bugs covered here don't crash anything. The code runs and returns k items, but the sample is quietly non-uniform, and only a statistical check will show it.3 min readheapq module, and the idea that independent continuous random variables tie with probability zero. It covers a second way to build a uniform reservoir. This version is slower than Algorithm R, but it records extra3 min readheapq module and that you know the uniform distribution on (0, 1).2 min readheapq module and basic conditional probability.3 min read