It requires random because I avoided quantization noise using [additive noise][1], so there's always a chance of running the code two consecutive times on the same machine and having different results, but only by ±1. If you'd like to do tests like this, it'd be better to initialize `random` in a way that the output is predictable.

  [1]: https://en.wikipedia.org/wiki/Quantization_(signal_processing)#The_additive_noise_model_for_quantization_error