probability – Calculating the Expected Value of Sum of Cards in Probability Games

expected valuegamesprobability

If each card on a regular 52 deck card has points that corresponds to their number (like 2 of hearts is 2 points, 7 of clubs is 7 points), the Jack, Queen, King each being 10 points and you keep drawing without replacement until sum of all points is 10 or more….what's the mean of sum of points?

Best Answer

By your definition, you have $16$ cards ($10$, $\text{J}$, $\text{K}$, $\text{Q}$) that are worth $10$ points, so with probability $16/52$ you get $10$ points in a single draw. Since $9+\text{anything}=10$, then if we take into consideration that there is $4$ nines, than we instantly know that with probability greater than $20/52$ you finish in two draws. However, return of two draws is simple to obtain by enumerating all $52 \choose 2$ combinations of card pairs and summing their scores.

unique_cards <- c(1:10, 10, 10, 10)  # A, 1, 2, ..., 10, J, Q, K
unique_cards <- rep(unique_cards, 4) # each appears 4 times

comb <- combn(unique_cards, 2) # take all possible combinations of card pairs

what gives $79\%$ probability of obtaining score of at least $10$ in two draws

> sum(colSums(comb) >= 10)/choose(52, 2) # accepted / all combinations
[1] 0.7888386

Lazy solution for more than two draws can be obtained by a simple simulation, where whole deck is shuffled and then cards are drawn until their total score is at least $10$.

set.seed(123)

sim <- function(target = 10) {
  res <- cumsum(sample(unique_cards)) # shuffle, draw and sum
  n <- which.max(res >= target)       # take first score >= 10
  c(sum = res[n], n = n)
}

R <- 1e4
res <- replicate(R, sim())

and the result is that on average you have to draw two cards and the average total score is $12.77$

> apply(res, 1, summary)
          sum     n
Min.    10.00 1.000
1st Qu. 10.00 1.000
Median  12.00 2.000
Mean    12.77 1.946
3rd Qu. 15.00 2.000
Max.    19.00 6.000

Moreover, as expected, with approximately $30\%$ probability you finish with one draw, but with $79\%$ probability you finish with two draws and you rarely get over three draws:

 > cumsum(table(res[2,])/R)
     1      2      3      4      5      6 
0.3006 0.7910 0.9653 0.9968 0.9999 1.0000