7 ms·
Also makes for a great interview question why a pseudo-random generator initialized with a 64 bit seed will not produce all possible shuffles of a card deck.
by fberger 15y ago
Also makes for a great interview question why a pseudo-random generator initialized with a 64 bit seed will not produce all possible shuffles of a card deck.
- guns 15y agoAnyone who's studied basic probability in high school should be able to answer that question. 52! > 2^64
- Confusion 15y agoThat depends on whether you use the first 52 values after the seed as the shuffle or are allowed to produce multiple shuffles from the same seed. In the latter case it also depends on the, unspecified, period of the PRNG.
- ajuc 15y agoIf the generator memory size is equal to seed size (64 bits), then period can't be larger than 2^64, and that's probably what grand-parent meant. But generator can have states that are not possible to be set directly by seeding (like when generator has for example 1024 bits of state, but can be seeded from 64 bit int). Then period is larger than 2^64, and grand-parent thesis don't hold.