GeekGold Bonus for All Supporters at year's end: 1000!
9,183 Supporters
$15 min for supporter badge & GeekGold bonus
18 Days Left

Support:

Recommend
5 
 Thumb up
 Hide
26 Posts
1 , 2  Next »   | 

BoardGameGeek» Forums » Board Game Design » Design Theory

Subject: Anyone feel like some math today? rss

Your Tags: Add tags
Popular Tags: [View All]
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
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?
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jason
Canada
Campbell River
British Columbia
flag msg tools
Avatar
mbmbmbmbmb
Does each spot hold only one card? Your wording indicates more than one, but you give no maximum.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
Yes, just one card. The card-drawer-person would discard any cards that can't be legally placed.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Thomas Brendel
United States
Dunwoody
Georgia
flag msg tools
designer
Avatar
mbmbmbmbmb
If the first card I draw is the 2 of spades, where do I put it?
6 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Bill Cook
United States
Massachusetts
flag msg tools
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.
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
Wherever you feel like. Though ideally it should be prioritized to the lower-probability 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.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
Writing a program might be the way to go. Maybe I won't get any actual work done today...
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
B C Z
United States
Reston
Virginia
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
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: Non-Spade-Face (9) + Spade-Face (3)
Set B: Non-Spade-A&4-10 (24) + Spade-A&4-10 (8) + Set C
Set C: Non-Spade-2-3 (6) + Spade-2-3 (2)
Set D: Spade-Face (3) + Spade-A&4-10 (8) + Spade-2-3 (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 Non-Spade)

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 2-spade is the first draw, you probably want to put it into slot C, but if the very next card is 2-hearts, 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 2-3 or a spade (or both).

2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
Cardzhee! That's a great analogy. Perhaps someone has written a journal article about yahtzee probabilities that would help.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Ashley Kennedy
United States
Cleveland
Tn
flag msg tools
Avatar
mbmbmbmbmb
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 1-10 card.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Scott Allen Czysz
United States
Freeport
IL
flag msg tools
designer
Avatar
mbmbmbmbmb
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.

1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Cheb
United Kingdom
flag msg tools
Avatar
mbmbmbmbmb
Quickly knocked up a model - I reckon around 12-13 cards, given all the assumed behaviours above
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
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.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jeremy Lennert
United States
California
flag msg tools
designer
Avatar
mbmbmbmbmb
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 changing--e.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.
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Ashley Kennedy
United States
Cleveland
Tn
flag msg tools
Avatar
mbmbmbmbmb
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 changing--e.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.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
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.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
B C Z
United States
Reston
Virginia
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
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 47-52).

I suspect 1000 tests isn't sufficient since you didn't even come close to that value.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Scott Allen Czysz
United States
Freeport
IL
flag msg tools
designer
Avatar
mbmbmbmbmb
snapdragon23 wrote:
Also worth noting, the minimum was 4 and the maximum was 29.



I knew the minimum would be 4!
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
This might sound better. I just ran a million sims and the results were as follows:

mean = 8.746
min = 4 (woohoo!)
max = 42
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Scott Allen Czysz
United States
Freeport
IL
flag msg tools
designer
Avatar
mbmbmbmbmb
byronczimmer wrote:
The worst possible stacking would be to have all 2s and 3s in the last 8 cards of the deck. (cards 47-52).


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.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
B C Z
United States
Reston
Virginia
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
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 47-52).


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.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Franz Kafka
United States
St. Charles
Missouri
flag msg tools
badge
Avatar
mbmbmbmbmb
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 47-52).


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!)
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Anna F.
United States
Mississippi
flag msg tools
Avatar
mbmbmbmbmb
Bonus: now I'm more or less set up to analyze any number of spots with any criteria.

Never ever delete your codes.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Cheb
United Kingdom
flag msg tools
Avatar
mbmbmbmbmb
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
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Mark Rickert
United States
Templeton
California
flag msg tools
mbmbmbmbmb
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.
4 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
1 , 2  Next »   | 
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.