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?
probability – Calculating the Expected Value of Sum of Cards in Probability Games
expected valuegamesprobability
Related Solutions
The easiest way is just to simulate the game lots of times. The R code below simulates a single game.
nplayers = 4
#Create an empty data frame to keep track
#of card number, suit and if it's magic
empty.hand = data.frame(number = numeric(52),
suit = numeric(52),
magic = numeric(52))
#A list of players who are in the game
players =list()
for(i in 1:nplayers)
players[[i]] = empty.hand
#Simulate shuffling the deck
deck = empty.hand
deck$number = rep(1:13, 4)
deck$suit = as.character(rep(c("H", "C", "S", "D"), each=13))
deck$magic = rep(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), each=4)
deck = deck[sample(1:52, 52),]
#Deal out five cards per person
for(i in 1:length(players)){
r = (5*i-4):(5*i)
players[[i]][r,] = deck[r,]
}
#Play the game
i = 5*length(players)+1
current = deck[i,]
while(i < 53){
for(j in 1:length(players)){
playersdeck = players[[j]]
#Need to test for magic and suit also - left as an exercise!
if(is.element(current$number, playersdeck$number)){
#Update current card
current = playersdeck[match(current$number,
playersdeck$number),]
#Remove card from players deck
playersdeck[match(current$number, playersdeck$number),] = c(0,
0, 0)
} else {
#Add card to players deck
playersdeck[i,] = deck[i,]
i = i + 1
}
players[[j]] = playersdeck
#Has someone won or have we run out of card
if(sum(playersdeck$number) == 0 | i > 52){
i = 53
break
}
}
}
#How many cards are left for each player
for(i in 1:length(players))
{
cat(sum(players[[i]]$number !=0), "\n")
}
Some comments
- You will need to add a couple of lines for magic cards and suits, but data structure is already there. I presume you didn't want a complete solution? ;)
- To estimate the average game length, just place the above code in a function and call lots of times.
- Rather than dynamically increasing a vector when a player gets a card, I find it easier just to create a sparse data frame that is more than sufficient. In this case, each player has a data frame with 52 rows, which they will never fill (unless it's a 1 player game).
- There is a small element of strategy with this game. What should you do if you can play more than one card. For example, if 7H comes up, and you have in your hand 7S, 8H and the JC. All three of these cards are "playable".
This one might be easier to think of from the other direction.
What is the probability of choosing 4 cards without any pairs (this is the complimentary set to seeing at least 1 pair).
To see 0 pairs there are 12 possibilities for the 1st card, but only 10 for the second card (since the 1st chosen card is no longer possible and the card that matches the 1st would form a pair) and 8 cards for the 3rd and 6 for the 4th, this multiplies to 5760. The total number of possible hands (with order mattering) is $12 \times 11 \times 10 \times 9 = 11880$, so the complimentary number which is the number of (ordered) hands that contain at least 1 pair is $11880 - 5760 = 6120$, divide that by 11880 and it reduces to $17/33$. We could also do this with order not mattering, but that would be more complicated and the extra pieces would all end up cancelling each other.
I think the 10 choose 2 may be throwing you off, I don't see where that comes into any version.
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.
what gives $79\%$ probability of obtaining score of at least $10$ in two draws
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$.
and the result is that on average you have to draw two cards and the average total score is $12.77$
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: