Which Deck wins the most?

242 Views Asked by At

I have two decks of cards, both shuffled randomly and placed face-down.

Deck A has 40 cards. 10 are red, while the remaining 30 are black. Deck B has 80 cards. 20 are red, while the remaining 60 are black.

I am asked to pick one deck and draw 20 cards from the top of it, scoring 1 point for each red card I draw.

Which deck should I choose?

Edit: The question is: "Which Deck, A or B, would win in a game where you're drawing 20 cards randomly?" Said another way, which deck, A or B would win in a head to head game?

When I worked it out, it seems that both Decks have an expected value of 5 points.

So, if I did the work right, then on average, there should not be any advantage to picking either deck. To confirm this, I ran a monte carlo simulation and it seems that my long running average has A with a slight advantage over deck B.

I wrote this up in R to check it out.

BDeckWins <- 0
ADeckWins <- 0
ties <- 0
trials <- 100000
deckApts <- vector(mode = 'numeric', length = trials)
deckBpts <- vector(mode = 'numeric', length = trials)
for(i in 1:trials)
{
  deckA <- rep(0, 40) # make all blacks
  deckA[sample(1:40,10)] <- 1 #randomly pick 10 reds
  handA <- sample(deckA, 20)
  pntsA <- sum(handA)
  deckApts[i] <- pntsA
  #print(stringr::str_c("Deck A points:", pntsA))
  
  deckB <- rep(0, 80) # make all blacks
  deckB[sample(1:80,20)] <- 1 #randomly pick 20 reds
  handB <- sample(deckB, 20)
  pntsB <- sum(handB)
  deckBpts[i] <- pntsB
  #print(stringr::str_c("Deck B points:", pntsB))
  
  if(pntsB != pntsA)
  {
    if(pntsB > pntsA)
    {
      #print("Deck B wins")
      BDeckWins <- BDeckWins + 1
    }
    else
    {
      #print("Deck A wins")
      ADeckWins <- ADeckWins + 1
    }
  }
  else
  {
    #print("Tie, no winner")
    ties <- ties + 1
  }
}

mean(deckApts)
mean(deckBpts)

print(ADeckWins)
print(BDeckWins)
print(ties)

print(ADeckWins + BDeckWins + ties)

The code to calculate the expected values is as follows:

ev_a <- vector(mode = 'numeric', length = 10)
for(i in 0:10)
{
    ev_a[i+1] <- i*(choose(10, i)*choose(30, 20 - i) / choose(40,20))
}
sum(ev_a)

ev_b <- vector(mode = 'numeric', length = 20)
for(i in 0:20)
{
  ev_b[i+1] <- i*(choose(20, i)*choose(60, 20 - i) / choose(80,20))
}
sum(ev_b)

So...I checked that the simulation agrees that 5 is the long run expected value. I don't know what I am not seeing.

2

There are 2 best solutions below

0
On

Intuition alone is sufficient to conclude that the expected value is the same for each deck.

Consider the deck of 40 cards, 10 of which are black. Assume that you and a partner will each each select 20 cards. You will select the first 20, and your partner will select the next 20.

Clearly, since you and your partner collectively select all 40 cards, then you and your partner will collectively garner 10 points. Further, since there is no reason to believe that the first 20 cards will contain more red cards than the last 20 cards, you can expect that you and your partner will each have an individual expectation of 5 points.

Very similar reasoning pertains to drawing 20 cards from a deck of 80 cards, 20 of which are red. That is, instead of 1 partner, assume that you have 3 partners. You draw the first 20 cards, then one of your partners draws the next 20 cards, and so on. Collectively, the 4 of you must garner 20 points, since the 80 card deck has 20 red cards. Further, by analysis similar to that used for the 20 card deck, you should each expect to garner 5 points.

The above analysis is nothing more than a re-expression of linearity of expectation which has already been referred to in the comments.

1
On

All of your calculations are correct. Both of the decks have a mean of $5$, and also deck A is better in a head-to-head contest.

The exact probability distributions are given by the hypergeometric distribution

pA <- dhyper(0:20, 10, 30, 20)
pB <- dhyper(0:20, 20, 60, 20)

which you can plot

M <- rbind(pA, pB)
colnames(M) <- 1:20
barplot(M, beside=T)

enter image description here

As you can see, the distribution of $A$ (the white bars) has higher variance.

The probability that $A$ wins is

sum(outer(pA, pB) * lower.tri(outer(pA, pB)))

which is approximately 0.4136, while the probability of a tie is

sum(diag(outer(pA, pB)))

which is 0.1815. Finally, the probability that $B$ wins is 0.4049.

I guess the simplest way to explain why this doesn't agree with your intuition is because the distributions are not symmetric. A similar situation would be if you had a standard six-sided die and a second die with the faces labelled 7, 8, 9, 10, 11 and -24. Both dice have expected value 3.5. But which one is more likely to win in a head-to-head?