GeekGold Bonus for All Supporters at year's end: 1000!
9,183 Supporters
$15 min for supporter badge & GeekGold bonus
18 Days Left
Support:
Please select a support frequency
Anna F.
United States Mississippi

It's a fine day for a thorny probability problem. This type of analysis is not super intuitive to me on a good day, but the answer is probably more obvious than I think.
Say you have a deck of traditional cards. You also have four spots to put them in: Spot A can only hold face cards. Spot B can only hold numbers Ace through 10. Spot C can only hold 2s or 3s. Spot D can only hold spades.
As you fill them up, obviously the higher probability spots will fill up first and you may be stuck drawing cards for a while. What is the expected number of cards (without replacement) that you will draw before all the spots are filled?
Individually, the probabilities are as follows: A  23% B  77% C  15% D  25%
I think you can just do 1 divided by the probability to get the expected number of cards individually (e.g. you would draw about 4 cards before you get a spade).
But how would you set that up to compute the whole thing?


Jason
Canada Campbell River British Columbia

Does each spot hold only one card? Your wording indicates more than one, but you give no maximum.


Anna F.
United States Mississippi

Yes, just one card. The carddrawerperson would discard any cards that can't be legally placed.


Thomas Brendel
United States Dunwoody Georgia

If the first card I draw is the 2 of spades, where do I put it?


Bill Cook
United States Massachusetts

There are two problems with your questions.
The first is that it is not fully defined. The expected number of cards will depend upon the players strategy. As someone just posted, what does the player do if the first card is 2S? Depending upon how the player plays the expected number of cards will change.
Even if you define the strategy, the problem is really complicated because the probabilities change after each card is dealt. Even if we grossly simplify the problem (2 spots, one for red cards, one for black) the math is pretty messy. For your four spots, the math is atrocious.
Luckily, if you just want the answer, you can write a simple program, run through 100,000 trials and get an answer that will be within a tiny percentage of the actual mathematical answer.
TL;DR: The answer isn't more obvious than you think.


Anna F.
United States Mississippi

Wherever you feel like. Though ideally it should be prioritized to the lowerprobability spot. If you prioritize, the order would be C, A, D, B.
The first card drawn can always be placed. The probability of a successful placement goes down with every card, but the cumulative probability approaches 1.


Anna F.
United States Mississippi

Writing a program might be the way to go. Maybe I won't get any actual work done today...


B C Z
United States Reston Virginia

Squidd wrote: If the first card I draw is the 2 of spades, where do I put it?
One presumes in any legal spot, but then that spot is taken.
Put another way, I feel that the question is asking us to play "cardzhee", where each slot can hold some specific set of cards.
Further, we can break the set down to: Set A: NonSpadeFace (9) + SpadeFace (3) Set B: NonSpadeA&410 (24) + SpadeA&410 (8) + Set C Set C: NonSpade23 (6) + Spade23 (2) Set D: SpadeFace (3) + SpadeA&410 (8) + Spade23 (2)
Set C is a strict subset of Set B Set D, introduces intersections (and thus why A,B,C are slit into Spade and NonSpade)
Set C is clearly the hardest to fill (8) followed by Sets A, D and B in order.
Because choice is present, this isn't a strict probability question. If a 2spade is the first draw, you probably want to put it into slot C, but if the very next card is 2hearts, then that was an error. Thus any given order of the 52 cards will have a 'fastest to fill given perfect knowledge' and 'fastest to fill given probabilistic choice', where the choice is a 23 or a spade (or both).


Anna F.
United States Mississippi

Cardzhee! That's a great analogy. Perhaps someone has written a journal article about yahtzee probabilities that would help.


Ashley Kennedy
United States Cleveland Tn

I apologize because I'm giving you an instinctive answer rather than a thorough mathematical one. If your game system prioritizes the filling of all four slots above other incentives, my instinctive answer is 6 cards. In this system, you would prioritize fulfilling the lowest probability slots first.
In this order: Slot C Slot A Slot D Slot B
However, slot C could compete with Slots D and B for cards, and so this could push the likelihood further out to say 8 cards.
Your design could be set to incentivize filling the higher probability slots with cards that match other slots. (the 2 of spades in Spot B for example would be more beneficial than just any other 110 card.


Scott Allen Czysz
United States Freeport IL

I predict the answer is around 8 cards, but I'm not smart enough to do the math.
In 5 trials, I achieved the end result in 9, 7, 6, 8, and 10 cards.




Quickly knocked up a model  I reckon around 1213 cards, given all the assumed behaviours above


Anna F.
United States Mississippi

I'm not smart enough either (don't tell my boss) but working backwards from 8 might get us somewhere.
Interestingly, I get around 8 with the following math.
The probability of NOT drawing any of the following: A 76% B 23% C 84% D 75%
Taking the reciprocal of those sums to 8.


Jeremy Lennert
United States California

snapdragon23 wrote: I think you can just do 1 divided by the probability to get the expected number of cards individually (e.g. you would draw about 4 cards before you get a spade). You could do that if the probability wasn't changinge.g. if you shuffled an infinite number of identical decks of cards together. If you are using just one deck of cards, and drawing without replacement, then every card you draw changes the probabilities for future cards.
For instance, if you wanted to draw until you find one specific card (e.g. the ace of spades), the probability of getting it on the first draw is 1 in 52. Therefore, if you thoroughly reshuffled the entire deck after every single draw, the expected number of draws before you get it is 52. But if you shuffle once and keep drawing new cards from a single deck, the expected number of draws before you get it is only 26.5 (average of 1 and 52, 2 and 51, 3 and 50...)
As Bill Cook says, this is not a simple problem, and a computer simulation is probably your best choice.


Ashley Kennedy
United States Cleveland Tn

Antistone wrote: snapdragon23 wrote: I think you can just do 1 divided by the probability to get the expected number of cards individually (e.g. you would draw about 4 cards before you get a spade). You could do that if the probability wasn't changinge.g. if you shuffled an infinite number of identical decks of cards together. If you are using just one deck of cards, and drawing without replacement, then every card you draw changes the probabilities for future cards. For instance, if you wanted to draw until you find one specific card (e.g. the ace of spades), the probability of getting it on the first draw is 1 in 52. Therefore, if you thoroughly reshuffled the entire deck after every single draw, the expected number of draws before you get it is 52. But if you shuffle once and keep drawing new cards from a single deck, the expected number of draws before you get it is only 26.5 (average of 1 and 52, 2 and 51, 3 and 50...) As Bill Cook says, this is not a simple problem, and a computer simulation is probably your best choice.
It depends on how precise of a model you need. The probabilities do not shift much when a single player draws a card from a unique deck. I would intuit that they do not change enough to adjust the probability more than a single card at most.
However, if multiple players (say 4) are drawing from the same deck, the model could change significantly. What was improbable may become impossible without a way to mitigate luck of the draw built into the game system or accepted as possible player loss.


Anna F.
United States Mississippi

Hey y'all,
I am the world's slowest programmer but I did the simulation, and over 1000 tests the answer is:
: drumroll please :
8.841
Yay for intuition!!
Also worth noting, the minimum was 4 and the maximum was 29.
Matlab code available upon request.


B C Z
United States Reston Virginia

snapdragon23 wrote: Hey y'all,
I am the world's slowest programmer but I did the simulation, and over 1000 tests the answer is:
: drumroll please :
8.841
Yay for intuition!!
Also worth noting, the minimum was 4 and the maximum was 29.
Matlab code available upon request.
The worst possible stacking would be to have all 2s and 3s in the last 8 cards of the deck. (cards 4752).
I suspect 1000 tests isn't sufficient since you didn't even come close to that value.


Scott Allen Czysz
United States Freeport IL

snapdragon23 wrote: Also worth noting, the minimum was 4 and the maximum was 29.
I knew the minimum would be 4!


Anna F.
United States Mississippi

This might sound better. I just ran a million sims and the results were as follows:
mean = 8.746 min = 4 (woohoo!) max = 42


Scott Allen Czysz
United States Freeport IL

byronczimmer wrote: The worst possible stacking would be to have all 2s and 3s in the last 8 cards of the deck. (cards 4752).
Quick, someone smarter than me, what is the odds of ALL the 2s and 3s being in say the last 10 cards? I bet very, very tiny.
I came up with a probability of 5.94x10**8. Am I close?
That would be about 1 in 16 million times ALL the 2s and 3s would be in the last 10 cards of a deck.


B C Z
United States Reston Virginia

Narrow Gate Games wrote: byronczimmer wrote: The worst possible stacking would be to have all 2s and 3s in the last 8 cards of the deck. (cards 4752). Quick, someone smarter than me, what is the odds of ALL the 2s and 3s being in say the last 10 cards? I bet very, very tiny.
Claim was maximum was 29 cards drawn.
This means that the 'final' card was in position 29.
So the real question is what are the odds of all of the magic cards (most likely being a 2 or 3) being all in the final 23 cards AND one of the magic cards being in position 29. Then extrapolate to final 22 cards, 21, etc...
I accept a high water mark of 42 as being a more correct monte carlo.


Franz Kafka
United States St. Charles Missouri

Narrow Gate Games wrote: byronczimmer wrote: The worst possible stacking would be to have all 2s and 3s in the last 8 cards of the deck. (cards 4752). Quick, someone smarter than me, what is the odds of ALL the 2s and 3s being in say the last 10 cards? I bet very, very tiny. I came up with a probability of 5.94x10**8. Am I close? That would be about 1 in 16 million times ALL the 2s and 3s would be in the last 10 cards of a deck. I came up with about 5.98x10**8, so maybe one of us has a rounding error.
(44! * 10!)/(52! * 2!)


Anna F.
United States Mississippi

Bonus: now I'm more or less set up to analyze any number of spots with any criteria.
Never ever delete your codes.




Disregard my last results  for some reason i forgot to code for "2s or 3s", I only coded for 2s ha.
My numbers now line up with everyone else's 8.741 after 1 million iterations


Mark Rickert
United States Templeton California

I wrote a python program to compute the exact probability.
I got 119713451744053 / 13687282997388 which is approximately 8.74632692017.
Edit: The program assumes that a drawn card will be placed in the spot that has the lowest probability of being drawn. That should be the minimizing strategy over all possible deck arrangements.



