Fixing Random, part 9

added by DotNetKicks
3/1/2019 1:11:15 PM

1 Kicks, 443 Views

Last time on FAIC I sketched out the "alias method", which enables us to implement sampling from a weighted discrete distribution in constant time. The implementation is slightly tricky, but we'll go through it carefully. The idea here is: If we have n weights then we're going to make n distributions.