Open Side Menu Go to the Top
Register
Using random binary #s to select random item from odd-numbered list Using random binary #s to select random item from odd-numbered list

10-17-2014 , 01:41 PM
Ha. Just found this Pokerstars page where they describe their method of taking the binary stream and converting it to cards. Works the same way as we've been talking:

Quote:
To convert random bit stream to random numbers within a required range without bias, we use a simple and reliable algorithm. For example, if we need a random number in the range 0-25:
we take 5 random bits and convert them to a random number 0-31
if this number is greater than 25 we just discard all 5 bits and repeat the process
This method is not affected by biases related to modulus operation for generation of random numbers that are not 2n, n = 1,2,..
To perform an actual shuffle, we use another simple and reliable algorithm:
first we draw a random card from the original deck (1 of 52) and place it in a new deck - now original deck contains 51 cards and the new deck contains 1 card
then we draw another random card from the original deck (1 of 51) and place it on top of the new deck - now original deck contains 50 cards and the new deck contains 2 cards
we repeat the process until all cards have moved from the original deck to the new deck
This algorithm does not suffer from "Bad Distribution Of Shuffles" described in [1].
Using random binary #s to select random item from odd-numbered list Quote

      
m