I'm afraid I can't help you with 1 or 2, but regarding 3: How about
computing the probability of a poker, the brute force way? You have to
check the time it takes in your computer, I used a 40 card deck and it
took a few seconds:
def poker(hand):
ranks=[n for n,m in hand]
#The ranks are ordered
return ranks[0]==ranks[3] or ranks[1]==ranks[4]
total=0
pokers=0
for hand in combinations_iterator(deck,5):
total+=1
if poker(hand):
pokers+=1
print 'The probability of poker is %d/%d'%(pokers,total)
--
You received this message because you are subscribed to the Google Groups
"sage-edu" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-edu?hl=en.