by lancehoch on Mon Mar 10, 2008 11:01 am
I have been looking at the card set estimate and I have come up with some ideas to update it.
Yeti has mentioned that he would like to see separate code for the "Chance of a +2 bonus" but with a better name and the "Chance of a set"
The probability of having a set is: (# of cards-2)/3*(# of cards>2)
where (# of cards>2) is a boolean statement, 1 if true and 0 if false. This is a strict probability calculation: if you have 5 cards the probability is 1 since you must turn in, if you have 8 the probability is 2 since you must turn in twice. For 3 cards, you have a 1/3 chance of having a set since based on the first 2 cards, the third card must be a specific color. For 4 cards, the probability is 2/3 since only one color for the fourth card will not give you a set (it will give you two pairs).
For the "Chance of a +2 bonus", the code should be 3*(integer of probability+1)*(countries owned/total countries)*(# of cards >2). This takes no calculation of whether or not you can turn in a set, only if you turn in, what are the odds that you will turn in a card of a country that you own. The 3 is the number of cards being turned in. The integer of probability+1 looks at how many sets will be turned in. As shown above, any value greater than 1 means that more than 1 set can be turned in (mid turn). For any fractional value, this is strictly looking at if the set is turned in. The (countries owned/total countries) calculates the chance that the card is an owned territory. The (# of cards>2) is a boolean statement, 1 if true and 0 if false, to make sure that there is a chance of a set.
For a flat rate game, the probability of having a set should be multiplied by the average redemption value [(4+6+8+10)/4=7]. This gives you:
Card Set Estimate=7*(# of cards-2)/3*(# of cards>2)
For an escalating, standard game you must count how many sets will be turned in between now and your turn.
Example: 6 player, sequential, escalating; you have just taken the last turn in round 5, no one has turned in a set yet
A has 5 cards, B has 4 cards, C has 4 cards, D has 3 cards, E has 5 cards, F (you) has 5 cards
Probability that each will have a set: A 1, B 2/3, C 2/3, D 1/3, E 1, F 1
Since anyone who has 5 cards must turn in, you cannot redeem for those values. The code should call and disregard next x redemption values where x= the sum of the integers of the probabilities of the other people from the active player through the player before you (n players), here x=2. Take the remainder modulo 1 of the probabilities of all these players having a set and calculate the probability that none of them redeem cards, then that 1 redeems, …, they all redeem; multiply the probability that none redeem times the x+1 redemption value, the probability that 1 redeems by the x+2 redemption value, …, that they all redeem by the x+n redemption value. Take the sum of these products and multiply the quantity by the probability that you have a set. The code for this will be long an complicated, but will give a more true representation of the value that you will likely turn in at, if you were to turn in on this turn.
For an escalating, freestyle game the values are not based on the other players, because you cannot be sure who will start their turn first. Using similar notation to the above example, x is based strictly on the integer of your cards (a max of 1 to start a turn, but could be higher if you eliminate people). However, instead of disregarding the redemption values, they are added to the following: remainder of probability modulo 1 (fractional value) times redemption value of the x+1 set.
If anyone has any suggestions for this or questions because it is too confusing, let me know. Hopefully this will clear up some of the questions that people have with the card set estimate.