Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Generating all 5-card hands

by Limbic~Region (Chancellor)
on Mar 31, 2006 at 20:30 UTC ( #540550=note: print w/ replies, xml ) Need Help??


in reply to Re: Generating all 5-card hands
in thread Generating all 5-card hands

merlyn,
For generating all combinations of 52 cards taken 5 at a time....But are you really ready to process all 2598960 iterations? At 100 per second, that's still about a third of a day.

In cribbage, order is important contrary to what thor said earlier. The position of 1 card determines its eligibility for "right-jack" so there really are 12,994,800 hands that need to be considered. Even still, it is possible to both generate and score all those hands in under 15 minutes using pure perl. This would encompass everything thor wanted to do and a lot more.

Cheers - L~R


Comment on Re^2: Generating all 5-card hands
Re^3: Generating all 5-card hands
by thor (Priest) on Mar 31, 2006 at 22:40 UTC
    In cribbage, order is important contrary to what thor said earlier.
    While you're correct in that order matters, you and I are not disagreeing. My original problem was to prove that all hands that contained a 5 had at least two points. If knobs is obtained, then a jack was cut. With at least one 5 in the hand, this will yield 2 points for the fifteen, thus satisfying the original problem.

    thor

    The only easy day was yesterday

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://540550]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2014-10-24 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (133 votes), past polls