java.util.random

Is java.util.Random really that random? How can I generate 52! (factorial) possible sequences?

我是研究僧i 提交于 2019-11-28 13:25:49
问题 I've been using Random (java.util.Random) to shuffle a deck of 52 cards. There are 52! (8.0658175e+67) possibilities. Yet, I've found out that the seed for java.util.Random is a long , which is much smaller at 2^64 (1.8446744e+19). From here, I'm suspicious whether java.util.Random is really that random ; is it actually capable of generating all 52! possibilities? If not, how can I reliably generate a better random sequence that can produce all 52! possibilities? 回答1: Selecting a random