Also, in the multi-card example, it wasn't obvious that "generate a random number between 0 and *n*" assumes that *n* is not included. This is also confusing because, up to that point in the article, we counted *n* from 1.
Also, in the multi-card example, it wasn't obvious that "generate a random number between 0 and *n*" assumes that *n* is not included. This is also confusing because, up to that point in the article, we counted *n* from 1.
Maybe I missed something, but for me, Q always replaces K in the final one-card example. I think this is because, in SimpleReservoir, *n* starts from 0. On the second deal, it's 1, so `floor(random() * this.n)` always evaluates to 0, resulting in a replace github.com/samwho/visua...
Maybe I missed something, but for me, Q always replaces K in the final one-card example. I think this is because, in SimpleReservoir, *n* starts from 0. On the second deal, it's 1, so `floor(random() * this.n)` always evaluates to 0, resulting in a replace github.com/samwho/visua...