Sunday 29 December 2013

Optimal Betting Strategy for Acey Deucey (card game)

In this post I develop a betting strategy for the popular card game Acey Deucey. Favourable situations where the player has a positive expectation are identified, and optimal bet sizes are determined using the Kelly criterion. Thus, the resulting strategy maximises the long-run growth rate of the player's wealth. Although full Kelly is optimal in the sense of growth rate maximisation, returns can be quite volatile in the short-term. One common approach to reduce volatility is to bet a fraction of full Kelly at the expense of a lower expected growth rate.

Having determined the optimal strategy, I carried out a numerical simulation to estimate the distribution of terminal wealth following a fixed number of rounds for a specified starting wealth. I replicated the project in Matlab and Python. Although the game is simple relative to a real world financial investment strategy, it serves as a very useful prototype for exploring the problem of position sizing and risk management.

Rules of the Game

The player is dealt two cards and bets that a third card is numerically between the first two. Cards 2 to 10 are numbered by their face value, while Jack, Queen, and King are numbered 11, 12, and 13, respectively. If card one is an Ace then the player can make this card low with a value of 1 or high with a value of 14. If an Ace is dealt for the second card then a high value of 14 is automatically assumed.

If the third card lands between the first two then the player takes an amount from the pot equal to the bet. In the case that the third card is equal to the first or second cards, the player must contribute an amount to the pot equal to twice the bet. Finally, if the third card is less than the first card or greater than the second card (cards one and two are always assumed to be in ascending order), then the player must contribute an amount to the pot equal to the bet. Thus, there are three possible outcomes for each round, assuming that the player makes a bet. At the beginning of each round the player contributes a fixed amount called an ante to the pot.

PS there are many variations on the rules for this game. The results presented below may vary when additional rules are included. I make the following assumptions:

  • Wealth is measured in dollars.
  • Dollars are infinitely divisible.
  • Infinite pot.
  • Infinite deck.
  • Ante of 1 dollar per round.

Expected Value

Each situation in the game is associated with an expected value. Let A be the event that the third card is between the first two cards. The probability of event A occurring is defined as  $ P(A) = \frac{j-i-1}{13} = \frac{g}{13} $, where i and j are the numerical values of the first and second cards, respectively. The payoff for this event is defined by $ Q(A)= x $, where x is the bet size. Let B be the event that the third card is outside the first two cards. The probability of B is defined as $ P(B)= \frac{13-g-2}{13} $ and the payoff is $ Q(B)= -x $. Finally, let C be the event that the third card is equal to either of the first two. This event occurs with probability $ P(C)= \frac{2}{13}$. The payoff for C is a loss equal to twice the bet and defined as $ Q(C)= -2x $. Thus, $ P(A)+P(B)+P(C) = 1$. The table below lists the event probabilities and the associated payoffs.


Event Probability P Payoff Q
A P(A)=$ \frac{g}{13} $ Q(A) = $x$
B P(B)=$ \frac{11-g}{13} $ Q(B) = $-x$
C P(C)=$ \frac{2}{13} $ Q(C) = $-2x$

The expected value of a round is generally defined as  $ EV = P(A)Q(A) + P(B)Q(B) + P(C)Q(C) $. Inserting the expressions from the table above, the expected value can be expressed as $ EV = \frac{g}{13} x - \frac{11-g}{13} x - \frac{4}{13} x $ and finally simplified to 

$$ EV = \frac{(2g-15)}{13} x $$

where g is the gap between the cards (j-i-1). For example, if the first card is a 3 and the second card is a Jack then g is 7. 

Favourable Situations

Favourable situations are those which offer positive expectation. The table below lists the expected value for each situation. It is clear that the player should only be betting when the gap is greater than seven.

g 0 1 2 3 4 5 6 7 8 9 10 11 12
EV $-\frac{15}{13} x$ $-x$ $-\frac{11}{13} x$ $-\frac{9}{13} x$ $-\frac{7}{13} x$ $-\frac{5}{13} x$ $-\frac{3}{13} x$ $-\frac{1}{13} x$ $+\frac{1}{13} x$ $+\frac{3}{13} x$ $+\frac{5}{13} x$ $+\frac{7}{13} x$ $+\frac{9}{13} x$

 Optimal Bet Size


So, we will only bet when the gap is greater than seven. However, we still haven't addressed the question of how much to bet for each of the five favourable situations identified. Maximising the expected value of our decision is not sensible as this would result in betting all of our wealth and run a substantial risk of ruin (wealth going to zero). Instead, our goal should be to maximise the growth rate of our wealth over the long-run. Thus, there is a trade off between aggressiveness and probability of ruin. We want to maximise the following function with respect to the bet size x:
$$ f(x) = p_1 \text{ln} (1 + x) + p_2 \text{ln}(1-x) + p_3 \text{ln}(1-2x) $$
where $p_1$, $p_2$, and $p_3$ are $P(A)$, $P(B)$, and $P(C)$, respectively. The five figures below illustrate the concavity of this function over the maximisation region, which varies depending on the gap g. The value of x which maximises this function is the optimal Kelly bet. Intuitively, the recommended bets are proportional to the gap. 






We can obtain the maximum of f(x) algebraically by setting the first derivative equal to zero and solving for x. This results in the following expression for the optimal bet, denoted $x^*$

$$ x^* = \frac{ 3p_1-p_2-\sqrt{p_1^2-6p_1p_2+8p_1p_3+9p_2^2+24p_2p_3+16p_3^2} } { 4(p_1+p_2+p_3)} $$

The figure below shows the value of $x^*$ for each of the favourable situations. 


Likely Range in Wealth

Assuming one follows the optimal strategy outlined above, what range might one expect in one's wealth over a specific number of rounds? To address this question I implemented an application to simulate the game. In the two figures below the equity curves for 30 simulations are presented, each consisting of 300 rounds. A starting wealth of 100 dollars is assumed. As expected, the returns in the second figure, which uses quarter Kelly, are less volatile than the first, which uses full Kelly.



However, we can't tell a lot from the above figures as the number of simulations is too small to make an accurate estimate of the distribution. To do this I simulate 50 thousand paths and for each round I plot an empirical estimate of the mean (in red) and the 10th to 90th percentiles (in green). For these simulations I assume a starting wealth of 1000 dollars. Thus, Assuming full Kelly betting, we expect to turn 1000 dollars into about 6000 dollars over 300 rounds. However, the difference between the 10th and 90th percentiles is about 16000.


In contrast, quarter Kelly results in a lower expected wealth of about 1200 dollars, with a difference of about 1000 dollars between the 10th and 90th percentiles.


I have many ideas for extending this analysis and I may post again on this topic in the future. Thanks for reading - and don't forget to apply this strategy the next time you sit down to play Acey Deucey with friends ;)

7 comments:

  1. This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information... 안전놀이터

    ReplyDelete
  2. This is the type of information I’ve long been trying to find. Thank you for writing this information.
    토토사이트

    ReplyDelete
  3. I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot! apostas online

    ReplyDelete
  4. This is a appropriate weblog for everyone who is would like to find out about this topic. You already know much its virtually hard to argue to you (not that I really would want…HaHa). You actually put a whole new spin with a topic thats been revealed for decades. Great stuff, just excellent! เล่นบาคาร่าขั้นต่ำ20

    ReplyDelete
  5. I really like your wp web template, wherever do you get a hold of it through? สมัครแทงบอลขั้นต่ำ10บาท

    ReplyDelete
  6. I conceive other website proprietors should take this internet site as an model, very clean and superb user friendly design and style. สมัครแทงบอล

    ReplyDelete
  7. This is a good post. This post gives truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. Thank you so much. Keep up the good works. 먹튀사이트

    ReplyDelete