'SP4' or 'DI11'
. Evaluation of a hand of 5 cards proceeds by testing first for pairs or higher (using a dictionary keyed by the card ranks), then a test for straights and finally flush.Here is are the results from 1E6 trials:
The total number of possible hands is:
A simulation of 1E7 hands should be enought to test the statistics. For the run of 1E6 above, we saw 14 straight flushes where the expected number is 8*4 / 2.6 = 12. (Note: I didn't bother to explicitly mark a royal flush---two are seen in the output, also about as expected).
Python scripts are so simple to write, and this is seductive but dangerous. It is a temptation to put as little effort into testing as you did programming. I showed the demo 6 months ago, but only this morning found a bug in my code to test for straights!
Here is the whole listing: