News for hackers. Stuff that matters.
Re:Evolution of Random Number Generators by SuchAnonMuchWow on Sunday May 02, 2021 @06:30AM (#27013937)
Storing a number of the order of magnitude of n! will take the same amount of memory than storing a permutation of n elements, so what's the point ?
Re:Evolution of Random Number Generators by HelloNurse on Sunday May 02, 2021 @11:25AM (#27016065)
If one really wants to do it the slow and hard way, it's possible to compute a random permutation of n elements one element at a time with n bits of storage (less with fairly generic compression techniques): just remember the set of numbers that have been produced so far and sequentially pick one of the remaining ones. You'll waste some combination of additional memory (for arithmetic decoding state) and random bits (for rejected samples), but materializing a large randomly permuted vector should be slower.
Re:Evolution of Random Number Generators by FabHK on Sunday May 02, 2021 @09:21AM (#27015065)
Good point. Storing a number of magnitude n! will take n log n bits, and storing n numbers up to n will also take n log n bit.

In other words, good old Fisher Yates, storing the resulting permutation, and a simple lookup is probably the way to go.