Expected numbers of cards of a last color remaining

WMDhamnekar
MHB
Messages
381
Reaction score
30
TL;DR
Expected numbers of cards of a last color remained if all cards of other 2 colors in a deck of 100 cards of 3 colors are drawn randomly one by one.
In a deck, we have 35 green cards, 25 blue cards and 40 red cards. The cards are shuffled randomly. And the cards are drawn one by one without replacement until only one color remains in the deck. What is the expected number of cards remaining?

I am working on this question. If any one knows the correct answer may reply with all the explanations.
 
Physics news on Phys.org
That would be the same as drawing N cards without replacement that match the first color.
 
  • Like
  • Skeptical
Likes   Reactions: Hornbein and FactChecker
Dale said:
That would be the same as drawing N cards without replacement that match the first color.
That was my first thought, and it still might be valid. But an abundance of one color certainly changes the odds of the last card whereas that is not true for the first card. I don't see a clear way to handle that.
 
FactChecker said:
That was my first thought, and it still might be valid. But an abundance of one color certainly changes the odds of the last card whereas that is not true for the first card. I don't see a clear way to handle that.
My thinking was that when you have shuffled a deck there is no statistical difference between drawing from the top of the deck and drawing from the bottom of the deck.
 
I did a Monte Carlo simulation of 100000 shuffles with drawing from the front and got a mean value of 1.514 and a simulation of 100000 shuffles with drawing from the back and got a mean value of 1.517
 
  • Informative
Likes   Reactions: berkeman and FactChecker
Dale said:
My thinking was that when you have shuffled a deck there is no statistical difference between drawing from the top of the deck and drawing from the bottom of the deck.
That's what I initially thought and, IMO, your simulation proves that is the final answer.
I guess is that, if there are more of one color towards the end, they are more likely to be picked before the last of the other colors are picked.
I don't really see how to make that logic solid.
 
FactChecker said:
I don't really see how to make that logic solid.
I am not sure either. But probably it would be something like there are as many permutations of the deck with 3 greens at the beginning as there are with 3 greens at the end.
 
  • Like
Likes   Reactions: FactChecker
Chance of one or more cards of same color = .35^1 + .25^1 + .40^1 = 1
Chance of two cards or more cards of same color = .35^2 + .25^2 + .40^2
etc.

The answer is the sum over n from 1 to 35 of .35^n + sum over n from 1 to 25 of .25^n + sum over n from 1 to 40 of .40^n
 
Dale said:
I am not sure either. But probably it would be something like there are as many permutations of the deck with 3 greens at the beginning as there are with 3 greens at the end.
Of course! I think that does it.
 
  • #10
Hornbein said:
Chance of one or more cards of same color = .35^1 + .25^1 + .40^1 = 1
Chance of two cards or more cards of same color = .35^2 + .25^2 + .40^2
etc.

The answer is the sum over n from 1 to 35 of .35^n + sum over n from 1 to 25 of .25^n + sum over n from 1 to 40 of .40^n
That would be true for sampling with replacement.
 
  • #11
Dale said:
That would be the same as drawing N cards without replacement that match the first color.
Only if you add the condition that the next card is a different colour.
 
  • Like
Likes   Reactions: Dale
  • #12
Dale said:
That would be true for sampling with replacement.
Ooh that's right.
 
  • #13
WMDhamnekar said:
I am working on this question. If any one knows the correct answer may reply with all the explanations.
## P(X=g) ## - probability that we have g green cards remaining
## P(X=b) ## - probability that we have b blue cards remaining
## P(X=r) ## - probability that we have r red cards remaining
## E ## - expected number of cards remaining
$$ P(X=g)=\frac{40!\cdot25!\cdot35!}{100!}\binom{65}{40}\binom{99-g}{35-g} $$
$$ P(X=b)=\frac{35!\cdot40!\cdot25!}{100!}\binom{75}{35}\binom{99-b}{25-b} $$
$$ P(X=r)=\frac{25!\cdot35!\cdot40!}{100!}\binom{60}{25}\binom{99-r}{40-r} $$
$$ E=\sum_{g=1}^{35}gP(X=g)+\sum_{b=1}^{25}bP(X=b)+\sum_{r=1}^{40}rP(X=r)=\frac{35}{66}+\frac{25}{76}+\frac{40}{61}\approx1,515 $$
 
  • Informative
Likes   Reactions: Dale
  • #14
Gavran said:
$$ E=\sum_{g=1}^{35}gP(X=g)+\sum_{b=1}^{25}bP(X=b)+\sum_{r=1}^{40}rP(X=r)=\frac{35}{66}+\frac{25}{76}+\frac{40}{61}\approx1,515 $$
I also calculated it to be 1.515 using a different but related method. What the OP is asking for is modeled by the negative hypergeometric distribution. Or rather, a mixture distribution of three negative hypergeometric distributions.

So calculating the same number with two different methods and that number being right in the Monte Carlo range gives pretty good confidence in the value.
 
  • #15
My Answer:

There are 100 cards in total.

a)35 green (G)

b) 25 blue (B)

c) 40 red (R)

After a random shuffle, label positions ##\{1,2, \dots, 100\}##

Define
d) LG = Position of the last green card.

e)LB = Position of the last blue card.

f)LR= Position of the last red card.

The process stops when the second-largest of ##\{L_G, L_B, L_R\}## is reached.

So, the number of cards remaining is:

## X= 100 - second largest (L_G, L_B,L_R)##

Every individual card is equally likely to be the last card in the deck.

So,
##\mathbb{P}(L_G = max)= \displaystyle\frac{35}{100} , \mathbb{P}(L_B = max) =\displaystyle\frac{25}{100}, \mathbb{P} (L_R = max) = \displaystyle\frac{40}{100}##

If Green survives, then all 35 green cards remains.

##\mathbb{E}\left[ X | G survives \right] =35##

##\mathbb{E}\left[ X | B survives \right] = 25 ##

## \mathbb{E}\left[ X | R survives \right] =40 ##

##\mathbb{E}\left[X\right] = 35 \cdot \displaystyle\frac{35}{100} + 25\cdot \displaystyle\frac{25}{100} + 40\cdot \displaystyle\frac{40}{100} = \displaystyle\frac{35^2 + 25^2 + 40^2}{100} = \boxed{34.5}##
 
  • #16
That is very far off. The correct answer is 1.515

Your concept of “green survives” appears to be the problem.
 
  • #17
Second-largest corresponds to the second colour to be exhausted.
 
  • #18
FactChecker said:
That was my first thought, and it still might be valid. But an abundance of one color certainly changes the odds of the last card whereas that is not true for the first card. I don't see a clear way to handle that.
If you lay the 100 cards out in a row, there is a statistical symmetry going first to last or last to first.
 
  • Like
Likes   Reactions: FactChecker
  • #19
You could crunch a precise answer using a program. Calculate the probability of the last card being 1-40 red, then 1-35 blue and 1-25 green. E.g. the probability that the last two (and only the last two) are Red is:
$$(40/100)(39/99)(60/98)$$
 
  • #20
PS multiply the probability in each case by the relevant number to get the contribution to the expected value.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
Replies
31
Views
7K
  • · Replies 22 ·
Replies
22
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 20 ·
Replies
20
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
2
Views
1K
Replies
2
Views
2K