I am making something that requires a very good randomizer but cannot find one that doesn't have some sort of bias in one output or another. Typically the main thing I see is that in liquid/gas randomizers there is always a bias to the left or right because TPT actually renders from left to right. (and up to down)
I was thinking that perhaps if it hasn't been done already you could combine multiple random data streams with each other and switch around their most significant bits? This could possibly negate the left/right bias and make the output closer resemble the random numbers the TPT code is generating.
@ivel236(View Post) It doesn't render left-to-right or up-to-down - it updates each particle in the order they were created. However... particles themselves run their reaction left-to-right, then top-to-down.
As for random numbers sampled from the system - rand() is sufficient for our non-cryptographic purposes. It's a pretty good normally distributed random generator in the GNU C and Microsoft Visual C++ Runtime cases.
When I said "render" I guess I meant "update". Anyway I am fairly certain this causes some sort of bias when it comes to moving particles. I went through with my idea and combined the outputs of multiple randomizers and the results are pretty good.
All the outputs are then XORred together into one 8-bit value.
My hope is that this will offset any kind of left/right bias in the movement of the particles that generate the output; and thus get closer to that glorious system - rand() function embedded in the C++.
Next I want to be able to generate a random number between a lower and upper limit while still utilizing the 0-255 output. Does anyone know of an efficient algorithm to do this?