Saturday, October 30, 2010

San Juan: Gold Mine Math

When I was writing up the post on Prospector related cards I wanted to quantify just how good the Gold Mine was but I didn't feel like I had time to really get the 'right' answer so I floated out a good enough answer by just ignoring the fact that cards were in play and that once a card was flipped up it couldn't be flipped up again. (A different copy of the same card, sure, but not the same card itself.) So I just worked out the odds of all different from a 110 card deck with no replacement and got:

  • 24% chance of getting any card
  • 15% chance of getting any 5
  • 11% chance of getting any 6
  • 20% chance of getting a 5 or a 6
  • 85% of the time when you get anything, you get a 5 or a 6

The way I obtained these numbers was to build a spreadsheet with every possible combination of the numbers 1 through 6. This gave me 1296 rows. I also counted how many of each cost exist in a fresh deck and used a vlookup command to bring those values over. Then it was a simple matter of multiplying the odds for each cost on each row to determine how many of those specific combinations existed. Sum all those numbers up to get 146,410,000 which is 110^4. Then it was a simple matter to write a couple formulae checking to see if that row matched any of my above criteria and summing the rows which did and dividing by the total number.

Now, part of my knows there's some way to do this with nPrs and nCrs and factorials. Knowing that such things exist is what made me think it would be hard/fun to work out preciser values taking account of the fact we don't have replacement and that order doesn't matter. However I had an idea while I was trying to go to sleep last night which I tried this morning and it seemed to have worked, giving the following numbers:

  • 25% chance of getting any card
  • 16% chance of getting any 5
  • 11% chance of getting any 6
  • 21% chance of getting a 5 or a 6
  • 86% of the time when you get anything, you get a 5 or a 6
The first thing I did was subtract 3 from my number of 1s in the deck. Each player starts with an Indigo and you've already built a Gold Mine. I'm ignoring any other possible buildings though if you cared about the odds from a given game state you could take that into account. For the general case this should work. I then slightly modified my vlookup formulae. Without loss of generality I assumed the card in the first column was pulled first. The second column then checked to see if it was pulling the same value as the first or not. If it was then I subtracted 1 from the count of such cards in the deck. The third column checked the first 2 for doubles. The fourth column checked all others for doubles.

The effect of doing this on the numbers is it didn't reduce the quantity of any of the good rows (they already had no duplicates so they could never have pulled the same card twice with replacement) but did decrease the chance of a given 'bad' row from occurring. (For example, the old table said pulling 4 6s at once happened 4096 times while the new one says 1680.) Doing this decreases our overall sum of possible outcomes down to 123,854,640. (107*106*105*104) Then it was a simple matter of redividing by the new denominator to get the new odds. I made the two changes, of course, but if I'd just made the replacement change then the odds of everything good happening would have gone up by 110*110*110/(109*108*107) or up by about 5.7%. 

What does this mean for how good Gold Mine actually is? Well, it'll hit a quarter of the time, so if you build it early you'll probably get 4 cards out of it. Of those 4 cards you can expect 3 of them to be very good (but possibly duplicating previous good pulls). You have no way to influence if you'll get those cards on the first pulls, or on the last ones, or every time, or never. But the cost is actually pretty small to build it and you have actually a pretty reasonable chance of winning the game from it as a result. Low risk, high reward? I think you have to go for that, sadly. Is it worth delaying a Library to build it? If you think your opponent is better than you then I think you have to. If you don't then maybe not.

1 comment:

kiseki said...

I find it to be fascinating that you calculate that you should get a card every 4 triggers or so.
I went through a shuffled deck, flipping 4 cards at a time, and got through 20 iterations without getting a unique set.

I must have gotten severely unlucky.