Probability question - my head hurts

3 replies [Last post]
Aerjen
Offline
Joined: 08/28/2008

Hi math wizards,

I've got a probability question that I can't wrap my head around. I'm trying to balance decks size so that the number of rounds in my game is 10 or less regardless of the numbers of players. Below is a breakdown of how cards are drawn. Is there anyone that can help me with a formula to solve this?

The game is a 2 to 6 player game and I currently have a deck of 54 cards, with the following distribution

- 23 imps
- 16 spiders
- 10 snakes
- 5 dragons

For the first 1/3rd of the deck players draw cards equal to the number of players +1
The rest of the game players draw nests (will explain) equal to the number of players +1

A nest happens when the same monster gets drawn consecutively (they stack) and has a max stack size of 3 monsters.

Let's pretend the following cards are (in order) on top of the deck: imp, spider, spider, spider, spider, spider, dragon, dragon, imp

In a 2 player game you draw the following cards on 1 turn:
- Imp
- Spider, Spider, Spider
- Spider, Spider

In a 3 player game you draw the following cards on 1 turn:
- Imp
- Spider, Spider, Spider
- Spider, Spider
- Dragon, Dragon

etc...

I'm trying to get the game average under a maximum of 10 rounds, but am a bit clueless as to how a formula for this work. Right now I'm using brute force analysis, meaning playtesting the heck out of it and writing down what happens. It would be great if someone can save me the time and educate me on math & stats :)

pelle
Offline
Joined: 08/11/2008
script

What does "third of the game" mean? "Third of the deck"?

EDIT: sorry, reread and it says "deck"

So first third each of n players draw n cards.
After that each player draw n times, and each time can draw up to three cards, as long as they are the same? What happens if player draws first a spider and then a dragon? Is the dragon put back for the next player to grab, or discarded from the game, or kept by the player (hm... I guess the latter two are equivalent for deciding the length of the game)?

Unless there is a pattern here I don't see, the by far easiest thing to do is probably to script this up in eg python and run a few million simulations with different numbers of players and see how many turns of cards there is.

pelle
Offline
Joined: 08/11/2008
Very quick and not very

Very quick and not very well-tested attempt (would be surprised if there are no one-off errors or worse):
https://gist.github.com/lifelike/6770967

2 players [15, 15, 15, 16, 14, 15, 16, 15, 15, 15]
3 players [12, 12, 12, 12, 11, 12, 13, 11, 11, 11]
4 players [9, 10, 10, 9, 9, 9, 9, 9, 9, 10]
5 players [9, 8, 8, 8, 8, 8, 8, 8, 8, 8]
6 players [7, 6, 6, 6, 7, 7, 6, 7, 7, 7]

Only played 10 games for each number of players as the number of turns seemed to be very stable. I had expected to see more variance really (maybe there is a bug, or my intuition plays tricks on me).

But if it really is that stable, a few manual playtest will be enough to settle this. If you see more variance in practice, my script is wrong.

EDIT: BTW, the first card not in a nest is put back. This mimics how I interpret your examples. But I'm not sure if you intended that card to also be put back when player's turn ends. I assumed it do, so if a player draws spider,spider,dragon, he keeps the two spiders, and the next player will start with drawing the dragon. It will probably not make a huge difference if the dragon is kept by first player or discarded though.

Aerjen
Offline
Joined: 08/28/2008
That's interesting...

That's interesting... Apparently I wasn't clear in conveying the rules, but the results you get from your script amount to the same as I'm getting from playtesting. I think I've got enough to go on though, so thanks for the help!