Mark:
RE POKER HANDS
Final solution with fixes:
high card: {C(13,5) * [C(4,1)^5 - C(4,1)] - (14-5+1) * [C(4,1)^5 - C(4,1)]} / C(52,5) = 1302540 / 2598960 = 0.501178
1 pair: C(13,1) * C(4,2) * C(12,3) * C(4,1)^3 / C(52,5) = 1098240 / 2598960 = 0.422569
2 pairs: C(13,2) * C(4,2)^2 * C(11,1) * C(4,1) / C(52,5) = 123552 / 2598960 = 0.047539
3 of a kind: C(13,1) * C(4,3) * C(12,2) * C(4,1)^2 / C(52,5) = 54912 / 2598960 = 0.021128
straight: (14-5+1) * [C(4,1)^5 - C(4,1)] / C(52,5) = 10200 / 2598960 = 0.003925
flush: {C(13,5) * C(4,1) - [(14-5+1) * C(4,1)]} / C(52,5) = 5108 / 2598960 = 0.001965
full house: P(13,2) * C(4,3) * C(4,2) / C(52,5) = 3744 / 2598960 = 0.001441
4 of a kind: C(13,1) * C(4,4) * C(12,1) * C(4,1) / C(52,5) = 624 / 2598960 = 0.000240
straight flush: [(14-5+1) * C(4,1) - C(4,1)] / C(52,5) = 36 / 2598960 = 0.000014
royal flush: C(4,1) / C(52,5) = 4 / 2598960 = 0.000002
I think we can safely say you cracked that problem!
Below are the probabilities of drawing the following hands, without discarding:
Code:
Approximate
Hand Exact Probability Probability
--------------- ---------------------- ------------
Royal Flush: 4 in 2,598,960 1 in 649,740
Straight Flush: 36 in 2,598,960 1 in 72,193
Four of a Kind: 624 in 2,598,960 1 in 4,165
Full House: 3,744 in 2,598,960 1 in 694
Flush: 5,108 in 2,598,960 1 in 509
Straight: 10,200 in 2,598,960 1 in 255
Three of a Kind: 54,912 in 2,598,960 1 in 47
Two Pair: 123,552 in 2,598,960 1 in 21
One Pair: 1,098,240 in 2,598,960 1 in 2.4
Nothing: 1,302,540 in 2,598,960 1 in 2.0
Derivations
If you are not familiar with the factorial function, the factorial of a number is the product of every integer from one to itself. For example five factorial, denoted 5!, is 1*2*3*4*5 = 120.
If you had x cards and chose y of them, the number of unique sets you could create would be x!/(y!*(x-y)!). For the purposes of this document I shall notate this is (x:y).
The number of ways to arrange 5 cards out of 52 is (52:5) = 2,598,960. The odds of drawing any given hand are the number of ways it can be arranged divided by the total number of ways to arrange five cards above. Below are the number of ways to arrange each hand.
Royal Flush
The number of different royal flushes are four (one for each suit).
Straight Flush
The highest card in a straight flush can be 5,6,7,8,9,10,Jack,Queen, or King. Thus there are 9 possible high cards, and 4 possible suits, creating 9 * 4 = 36 different possible straight flushes.
Four of a Kind
There are 13 different possible ranks of the 4 of a kind. The fifth card could be anything of the remaining 48. Thus there are 13 * 48 = 624 different four of a kinds.
Full House
There are 13 different possible ranks for the three of a kind, and 12 left for the two of a kind. There are 4 ways to arrange three cards of one rank (4 different cards to leave out), and (4:2) = 6 ways to arrange two cards of one rank. Thus there are 13 * 12 * 4 * 6 = 3,744 ways to create a full house.
Flush
There are 4 suits to choose from and (13:5) = 1,287 ways to arrange five cards in the same suit. Then subtract the royal and straight flushes to avoid double counting. The total number of flushes is 4 * 1,287 - 4 - 36 = 5,108.
Straight
The highest card in a straight flush can be 5,6,7,8,9,10,Jack,Queen,King, or Ace. Thus there are 10 possible high cards. Each card may be of four different suits. Then subtract the royal and straight flushes to avoid double counting. Thus the number of ways to arrange a straight is 10 * 45 - 4 - 36 = 10,200.
Three of a Kind
There are 13 ranks to choose from for the three of a kind and 4 ways to arrange 3 cards among the four to choose from. There are (12:2) = 66 ways to arrange the other two ranks to choose from for the other two cards. In each of the two ranks there are four cards to choose from. Thus the number of ways to arrange a three of a kind is 13 * 4 * 66 * 42 = 54,912.
Two Pair
There are combine(13,2)=78 ways to choose 2 ranks out of 13 for the two pair. Then there are 11 ranks left for the singleton. For each pair there are combine(4,2)=6 ways to choose 2 suits out of 4. For the singleton there are 4 possible suits to choose from. So the total two pair combinations are 78*11*6*6*4 = 123,552.
One Pair
There are 13 ranks to choose from for the pair and (4:2) = 6 ways to arrange the two cards in the pair. There are (12:3) = 220 ways to arrange the other three ranks of the singletons, and four cards to choose from in each rank. Thus there are 13 * 6 * 220 * 43 = 1,098,240 ways to arrange a pair.
Nothing
There must be five different ranks represented, of which there are (13:5) = 1,287 possible combinations. Each rank has four cards to choose from. Finally subtract the number of straights, flushes, straight flushes, and royal flushes, to avoid double counting. Thus the number of ways to arrange nothing is 1,287 * 45 - 4 - 36 - 5,108 - 10,200 = 1,302,540.
Mark/Cont-
Where C(n,k) = n! / [k! * (n-k)!]
and P(n,k) = n! / (n-k)!
Sorry buddy but you lost me; is this cards or the Baby problem?
Lzzie wrote, "
cheeky GIT smiling!"
Do you mean; Great International Traveler? Any suggestions as to what: GIT stands for are warmly welcome!
Slippy, good to see you are still coming up with questions I can't answer!
Thoh wrote, "
problem 56"
This is only a science/math/logic thread where the seemingly impossible is explained and proved. Don't tell me that since 03 you thought me and a team of ghost writers came up with 1000's of totally original questions!
What is amusing is; there are only about six of us on this thread; yet the views are 216000+ and although the questions here get copied and changed (names, colors etc) before reposting: Mark's answers are copied verbatim.