card dealer

Tim Roberts timr at probo.com
Sat Sep 28 20:04:50 EDT 2013


Antoon Pardon <antoon.pardon at rece.vub.ac.be> wrote:
>
>Op 28-09-13 12:31, Ned Batchelder schreef:
>>
>> I've thought that way about it too: there are so many shuffles any way,
>> it won't be a problem.  But think about it like this:  if you shuffle a
>> deck of 52 cards with a default Python random object, then once you have
>> dealt out only 28 cards, the entire rest of the deck is completely
>> determined.  That is, given the sequence of the first 28 cards, there's
>> only one choice for how the remaining 24 will be dealt.  Depending on
>> what you need from your deck of cards, that could be a complete disaster.
>
>I don't see it. Unless given those 28 cards you can actually predict
>those 24 other cards or at least can devise some betting strategy that
>will allow you to beat the odds I don't see how this could lead to a
>disaster.

That's exactly the problem.  Because the number of permutations is limited,
once you know the first 28 cards, you can uniquely identify the permutation
you started with, and that's enough to get the entire sequence.

Now, it's going to take a hell of a lot of memory to store that
information, so I'm not sure it is a disaster in a practical sense.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list