To test whether the preceding
algorithm (or for that matter any card shuffling algorithm) is truly random you should perform a few tests:
- Over a number of shufflings (100,000 lets say) what is the percentage of a particular card appearing first?
- From the same pool, what is the percentage of a particular suit appearing first?
- What is the percentage of particular rank appearing first?
If over significantly large number of games the results approach the mathetmatically predicted ones (that is 1/52 is a chance of first draw being ace of diamonds, etc) then we can safely conclude that it's really random.
Note that the algorithm should also work for
multiple card deck games.