Thread Rating:
May 11th, 2018 at 2:22:47 PM
permalink
Just wondering what the odds are of getting a numerical total of 21 on 5 card poker?
No swapping cards. Exchanging, buying, whatever. Just five cards straight from the shuffle machine, using a standard 52 card deck.
Cheers.
No swapping cards. Exchanging, buying, whatever. Just five cards straight from the shuffle machine, using a standard 52 card deck.
Cheers.
May 11th, 2018 at 3:55:25 PM
permalink
what are the value of the cards in the deck?Quote: piroukayJust wondering what the odds are of getting a numerical total of 21 on 5 card poker?
It makes a difference.
and why 5 card poker?
do the suits matter as to the rank of the card??
why not just draw 5 from 52?
for example
the ranks (and suits mean nothing) could be 1 to 13
A, 2:10,J,Q,K
or
are J and Q and K worth 10 like in Blackjack?
that would not be 5 card poker
please be very specific!
I have data for many different ranks, that is why I ask!
Sally
added as I had this already
where the values are 1 to 13, Ace being 1
I get using R and excel
where J,Q,K = 10 points
I get using R and excel
+ }else sprintf("Probability sums %g through %g: %.9g",minSum,maxSum,rangeProb)
[1] "Probability of sum 21: 0.0116569705"
> print(ways <- sum(minSum <= hands.sums & hands.sums <= maxSum))
[1] 30296
> choose(52,5)
[1] 2598960
>
>
> 3635520 / 311875200 #permutations in Excel
[1] 0.01165697
where J,Q,K = 10 points
> start_time <- Sys.time()
>
> #define range or sum(both values equal)
> minSum <- 21
> maxSum <- 21
> draw=5
>
> cards = c(rep(1:9,4),rep(10,16))
> hands = combn(cards,draw)
> hands.sums <- colSums(hands)
>
> mean(hands.sums)
[1] 32.69231
> rangeProb <- mean(minSum <= hands.sums & hands.sums <= maxSum)
> end_time <- Sys.time()
> end_time - start_time
Time difference of 3.554184 secs
>
> if(minSum == maxSum){sprintf("Probability of sum %g: %.9g",minSum,rangeProb)
+ }else sprintf("Probability sums %g through %g: %.9g",minSum,maxSum,rangeProb)
[1] "Probability of sum 21: 0.0141241112"
> print(ways <- sum(minSum <= hands.sums & hands.sums <= maxSum))
[1] 36708
> choose(52,5)
[1] 2598960
Last edited by: mustangsally on May 11, 2018
I Heart Vi Hart
May 14th, 2018 at 9:10:50 AM
permalink
looking at this using Blackjack card values (faces = 10 points and Ace = 1 or 11)Quote: mustangsallyfor example
I get
37,312 / 2,598,960
about 0.014356512
or about 1 in 70
I looked at all 1993 unique draws
and separated them into how many Aces were present {4,3,2,1,0}
as only one Ace could be used as 11 and the others as 1
I used R (for the unique draws) then Excel to finish
(as I can see better in Excel using my reading glasses)
hope i did it all correctly,
some basic R code is here for distribution of sums with Ace=1 only.
maybe you want a different sum instead of 21?
that is in the data below
#R code used
require(plyr)
start.time <- Sys.time()
draw <- 5
#deck of cards - values only
cards <- c(rep(1:10,4),rep(10,12))
hands <- combn(cards,draw)#lists all combos
hands.sums <- colSums(hands)#get the sum of all
data <- count(hands.sums)
colnames(data) <- list("sum","freq")
#####
dataProb = function(x)
{
x$prob = x$freq/sum(x$freq)
x$cumulative = cumsum(x$prob)
return(x)
}
options(scipen=999, digits=6)
dataProb(data)
mean(hands.sums)
end.time <- Sys.time()
end.time - start.time
################
returned
> dataProb(data)
sum freq prob cumulative
1 6 4 0.00000153908 0.00000153908
2 7 28 0.00001077354 0.00001231262
3 8 92 0.00003539877 0.00004771139
4 9 240 0.00009234463 0.00014005602
5 10 484 0.00018622834 0.00032628436
6 11 920 0.00035398775 0.00068027211
7 12 1552 0.00059716194 0.00127743405
8 13 2492 0.00095884508 0.00223627913
9 14 3784 0.00145596700 0.00369224613
10 15 5724 0.00220241943 0.00589466556
11 16 8344 0.00321051498 0.00910518053
12 17 11988 0.00461261428 0.01371779481
13 18 16520 0.00635638871 0.02007418352
14 19 22144 0.00852033121 0.02859451473
15 20 28948 0.01113830147 0.03973281620
16 21 36708 0.01412411118 0.05385692739
17 22 45584 0.01753932342 0.07139625081
18 23 55712 0.02143626681 0.09283251762
19 24 67600 0.02601040416 0.11884292178
20 25 79416 0.03055683812 0.14939975990
21 26 92416 0.03555883892 0.18495859882
22 27 103808 0.03994213070 0.22490072952
23 28 115520 0.04444854865 0.26934927817
24 29 125188 0.04816849817 0.31751777634
25 30 134052 0.05157909318 0.36909686952
26 31 140224 0.05395388925 0.42305075877
27 32 146936 0.05653646074 0.47958721950
28 33 149268 0.05743374273 0.53702096223
29 34 147784 0.05686274510 0.59388370733
30 35 143676 0.05528211285 0.64916582017
31 36 136344 0.05246098439 0.70162680457
32 37 127484 0.04905192846 0.75067873303
33 38 116832 0.04495336596 0.79563209899
34 39 105176 0.04046849509 0.83610059408
35 40 92548 0.03560962847 0.87171022255
36 41 82176 0.03161880137 0.90332902392
37 42 65532 0.02521470127 0.92854372518
38 43 52556 0.02022193493 0.94876566011
39 44 40436 0.01555853110 0.96432419121
40 45 31216 0.01201095823 0.97633514944
41 46 22496 0.00865577000 0.98499091944
42 47 16720 0.00643334257 0.99142426201
43 48 10640 0.00409394527 0.99551820728
44 49 7280 0.00280112045 0.99831932773
45 50 4368 0.00168067227 1.00000000000
>
> mean(hands.sums)
[1] 32.6923
> end.time <- Sys.time()
> end.time - start.time
Time difference of 4.01516 secs
>
have fun!
Sally
I Heart Vi Hart
May 16th, 2018 at 10:19:51 PM
permalink
J, Q and K would be worth 10, like in blackjack.
May 16th, 2018 at 11:24:02 PM
permalink
that was one method I had.Quote: piroukayJ, Q and K would be worth 10, like in blackjack.
that is in the spoiler button where the Ace = 1 point only.
IF Ace = 11 or 1 then that is above this post.
Hope my data and code helped out!
is this for a side bet for an existing game?
like video poker maybe?
Sally
I Heart Vi Hart