Marc-B-Reynolds / Marc-B-Reynolds.github.io

My ramblin' blog
https://marc-b-reynolds.github.io/
The Unlicense
5 stars 0 forks source link

math/2019/08/10/Avalanche #21

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Comments on the Avalanche Effect

A quick overview of what

http://marc-b-reynolds.github.io/math/2019/08/10/Avalanche.html

bryc commented 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:

image

With a slight change of your code to produce a saturation gradient, bias is better conveyed IMO:

image (6th graph is another CSPRNG output for comparison with MurmurHash3).

Thanks for explaining the craft.

Marc-B-Reynolds commented 1 year ago

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.