formatting fix (#2823)

This commit is contained in:
Bryan White 2019-08-19 23:51:06 +02:00 committed by GitHub
parent 863675605a
commit 8832a393e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,9 +51,9 @@ n004 + + + + + + +
Unvetted nodes should get 25,000 pieces per month. On a good day, there will be 1000 pieces added to an unvetted node, which should quickly fill the reservoir sample. Unvetted nodes should get 25,000 pieces per month. On a good day, there will be 1000 pieces added to an unvetted node, which should quickly fill the reservoir sample.
We have a reservoir of k items and a stream of n items, where n is an unknown number. + We have a reservoir of k items and a stream of n items, where n is an unknown number.
Fill the reservoir from [0...k-1] with the first k items in the stream + Fill the reservoir from [0...k-1] with the first k items in the stream
For every item in the stream from index i=k..n-1, pick a random number j=rand(0..i), and if j<k, replace reservoir[j] with stream[i] + For every item in the stream from index i=k..n-1, pick a random number j=rand(0..i), and if j<k, replace reservoir[j] with stream[i]
## Rationale: Discussion of Alternate Approaches, Advantages, Disadvantages ## Rationale: Discussion of Alternate Approaches, Advantages, Disadvantages