Does shuffle() produce uniform result ?

tooru honda tooru_honda at fast-mail.org
Fri Aug 24 22:43:42 EDT 2007


Hi, First of all, my thanks to all of you who replied.

I am writing a gamble simulation to convince my friend that his "winning 
strategy" doesn't work.  I use shuffle method from a random.SystemRandom 
instance to shuffle 8 decks of cards.

As the number of cards is quite small (number of cards is 416), the 
nonuniformity doesn't matter as most of you have already said.  Just to 
avoid argument from my friend, I am considering writing my own randint 
and shuffle methods based on os.urandom() though.

-tooru honda



More information about the Python-list mailing list