I would like to use php to create a collection of random bridge hands. I thought that I could encode an ordered pack of cards as the string $deal
below (I like it that there are 52 letters when considering both upper and lower case). I discovered the php function str_shuffle
. So I thought that I could do the following:
$pack = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$shuffledPack = str_shuffle($pack);
This gives me the desired output.
My question is: does str_shuffle
give output that follows a uniform distribution for each and every possible permutation?