Open utterances-bot opened 1 year ago
Great article, but had a few issues. Seems like you meant to use k
here instead of j
, as it wasn't producing sane output at first. Had me going for a loop (pun intended).
uint32_t b = (bits >> j) & 1;
Also, was it your intention to have fully random samples look like this? Here's six runs of a CSPRNG fed into it:
With a slight change of your code to produce a saturation gradient, bias is better conveyed IMO:
(6th graph is another CSPRNG output for comparison with MurmurHash3).
Thanks for explaining the craft.
You are correct. It should be 'k'. And that looks right for a good random number generator. I don't remember the computation but it isn't possible to have zero bias in a finite number of bits and finite number of samples. There are definitely better visualization schemes possible.
Comments on the Avalanche Effect
A quick overview of what
http://marc-b-reynolds.github.io/math/2019/08/10/Avalanche.html