User:Smesworld/sandbox

(From https://en.wikipedia.org/wiki/Goofspiel)

Goofspiel, also known as The Game of Pure Strategy or GOPS, is a card game for two or more players. It was invented by Merrill Flood while at Princeton University in the 1930s, and Alex Randolph describes a similar game as having been popular with the 5th Indian Army during the Second World War.

The game is simple to learn and play, but has some degree of strategic depth. It is commonly used as an example of multi-stage simultaneous move game in game theory and artificial intelligence.

Game play
Goofspiel is played using cards from a standard deck of cards, and is typically a two-player game, although more players are possible. Each suit is ranked A (low), 2, ..., 10, J, Q, K (high).
 * 1) One suit is singled out as the "prizes"; each of the remaining suits becomes a hand for one player, with one suit discarded if there are only two players, or taken from additional decks if there are four or more.  The prizes are shuffled and placed between the players with one card turned up.
 * 2) Play proceeds in a series of rounds.  The players make "closed bids" for the top (face up) prize by selecting a card from their hand (keeping their choice secret from their opponent). Once these cards are selected, they are simultaneously revealed, and the player making the highest bid takes the competition card. Rules for ties in the bidding vary, possibilities including the competition card being discarded, or its value split between the tied players (possibly resulting in fractional scores).  Some play that the current prize may "roll over" to the next round, so that two or more cards are competed for at once with a single bid card.
 * 3) The cards used for bidding are discarded, and play continues with a new upturned prize card.
 * 4) After 13 rounds, there are no remaining cards and the game ends.  Typically, players earn points equal to sum of the ranks of cards won (i.e. ace is worth one point, 2 is two points, etc., jack 11, queen 12, and king 13 points).  Players may agree upon other scoring schemes.

Mathematical analysis
Goofspiel (or variants of it) has been the subject of mathematical study. For example, Sheldon Ross considered the case when one player plays his cards randomly, to determine the best strategy that the other player should use. Using a proof by induction on the number of cards, Ross showed that the optimal strategy for the non-randomizing player is to match the upturned card, i.e. if the upturned card is the Jack, he should play his Jack, etc. In this case, the expected final score is 59½ - 31½, for a 28-point win.

The game as defined by Ross, where payoffs are point differences, was solved using linear and dynamic programming in 2012.

Strategy of GOPS
Any pure strategy in this game has a simple counter-strategy where the opponent bids one rank higher, or as low as possible against the King bid. As an example, consider the strategy of matching the upturned card value mentioned in the previous section. The final score will be 78 - 13 with the King being the only lost prize.

In general, making a very low bid can be advantageous if the player has correctly guessed that the opponent is making a high bid; despite losing a (presumably high-scoring) prize, the player gains an advantage in bidding power that can last for multiple turns. In the variant in which tie bids cause prizes to accumulate, the player with a bidding advantage might make bids that are more likely to tie, knowing that he can then use his uncontested high-bid card to win the accumulated group.