You are currently browsing the tag archive for the ‘gambling’ tag.

poker

This post is based on the fantastic PlusMaths article on bluffing– which is a great introduction to this topic.  If you’re interested then it’s well worth a read.  This topic shows the power of mathematics in solving real world problems – and combines a wide variety of ideas and methods – probability, Game Theory, calculus, psychology and graphical analysis.

You would probably expect that there is no underlying mathematical strategy for good bluffing in poker – indeed that a good bluffing strategy would be completely random so that other players are unable to spot when a bluff occurs.  However it turns out that this is not the case.

As explained by John Billingham in the PlusMaths article, when considering this topic it helps to really simplify things first.  So rather than a full poker game we instead consider a game with only 2 players and only 3 cards in the deck (1 Ace, 1 King, 1 Queen).

The game then plays as follows:
1) Both players pay an initial £1 into the pot.
2) The cards are dealt – with each player receiving 1 card.
3) Player 1 looks at his card and can:
(a) check
(b) bet an additional £1
4) Player 2 then can respond:
a) If Player 1 has checked, Player 2 must also check.  This means both cards are turned over and the highest card wins.
b) If Player 1 has bet £1 then Player 2 can either match (call) that £1 bet or fold.  If the bets are matched then the cards are turned over and the highest card wins.

So, given this game what should the optimal strategy be for Player 1? An Ace will always win a showdown, and a Queen always lose – but if you have a Queen and bet, then your opponent who may only have a King might decide to fold thinking you actually have an Ace.

In fact the optimal strategy makes use of Game Theory – which can mathematically work out exactly how often you should bluff:

poker2

This tree diagram represents all the possible outcomes of the game.  The first branch at the top represents the 3 possible cards that Player 2 can be dealt (A,K,Q) each of which have a probability of 1/3.  The second branch represents the remaining 2 possible cards that Player 1 has – each with probability 1/2.  The numbers at the bottom of the branches represent the potential gain or loss from betting strategies for Player 2 – this is calculated by comparing the profit/loss relative to if both players had simply shown their cards at the beginning of the game.

For example, Player 2 has no way of winning any money with a Queen – and this is represented by the left branch £0, £0.  Player 2 will always win with an Ace.  If Player 1 has a Queen and bluffs then Player 2 will call the bet and so will have gained an additional £1 of his opponents money relative to a an initial game showdown (represented by the red branch).  Player 1 will always check with a King (as were he to bet then Player 2 would always call with an Ace and fold with a Queen) and so the AK branch also has a £0 outcome relative to an initial showdown.

So, the only decisions the game boils down to are:

1) Should Player 1 bluff with a Queen? (Represented with a probability of b on the tree diagram )
2) Should Player 2 call with a King?  (Represented with a probability of c on the tree diagram ).

Now it’s simply a case of adding the separate branches of the tree diagram to find the expected value for Player 2.

The right hand branch (for AQ and AK) for example gives:

1/3 . 1/2 . b . 1
1/3 . 1/2 . (1-b) . 0
1/3 . 1/2 . 0

So, working out all branches gives:

Expected Value for Player 2 = 0.5b(c-1/3) – c/6
Expected Value for Player 1 = -0.5b(c-1/3) + c/6

(Player 1’s Expected Value is simply the negative of Player 2’s. This is because if Player 2 wins £1 then Player 1 must have lost £1). The question is what value of b (Player 1 bluff) should be chosen by Player 1 to maximise his earnings?  Equally, what is the value of c (Player 2 call) that maximises Player 2’s earnings?

It is possible to analyse these equations numerically to find the optimal values (this method is explained in the article), but it’s more mathematically interesting to investigate both the graphical and calculus methods.

Graphically we can solve this problem by creating 2 equations in 3D:

z = 0.5xy-x/6 – y/6

poker7

z = -0.5xy+x/6 + y/6

poker8

In both graphs we have a “saddle” shape – with the saddle point at x = 1/3 and y = 1/3.  This can be calculated using Wolfram Alpha. At the saddle point we have what is known in Game Theory as a Nash equilibrium – it represents the best possible strategy for both players.   Deviation away from this stationary point by one player allows the other player to increase their Expected Value.

Therefore the optimal strategy for Player 2 is calling with precisely c = 1/3 as this minimises his loses to -c/6 = -£1/18 per hand.  The same logic looking at the Expected Value for Player 1 also gives b = 1/3 as an optimal strategy.  Player 1 therefore has an expected value of +£1/18 per hand.

We can arrive at the same conclusion using calculus – and partial derivatives.

z = 0.5xy-x/6 – y/6

For this equation we find the partial derivative with respect to x (which simply means differentiating with respect to x and treating y as a constant):

zx = 0.5x – 1/6

and also the partial derivative with respect to y (differentiate with respect to y and treat x as a constant):

zy = 0.5y -1/6

We then set both of these equations to 0 and solve to find any stationary points.

0 = 0.5x – 1/6
0 = = 0.5y -1/6
x = 1/3 y = 1/3

We can then see that this is a saddle point by using the formula:

D = zxx . zyy – (zxy)2

(where zxx means the partial 2nd derivative with respect to x and zxy means the partial derivative with respect to x followed by the partial derivative with respect to y. When D < 0 then we have a saddle point).

This gives us:

D = 0.0 – (0.5)2 = -0.25

As D < 0 then we have a saddle point – and the optimal strategy for both players is c= 1/3 and b = 1/3.

We can change the rules of the game to see how this affects the strategy.  For example, if the rules remain the same except that players now must place a £1.50 bet (with the initial £1 entry still intact) then we get the following equation:

Player 2 Expected Value = b/12(-1+7c) – 3c/12

This has a saddle point at b = 3/7, c = 1/7.  So the optimal strategy is 3/7 bluffing and 1/7 calling.  If Player 2 calls more than 3/7 then Player 1 can never bluff (b = 0), leaving Player 2 with a negative Expected Value.  If Player 2 calls less than 3/7 then Player 1 can always bluff (b = 1).

If you enjoyed this you might also like:

The Gambler’s Fallacy and Casino Maths – using maths to better understand casino games

Game Theory and Tic Tac Toe – using game theory to understand games such as noughts and crosses

IB Revision

Screen Shot 2018-03-19 at 4.35.19 PM

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

Screen Shot 2018-03-19 at 4.42.05 PM.pngThe Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial.  Really useful!

Screen Shot 2019-07-27 at 10.02.40 AM

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions.  This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.

The Gambler’s Fallacy

The above video is an excellent introduction to the gambler’s fallacy.  This is the misconception that prior outcomes will have an effect on subsequent independent events.  The classic example for this is the gambler who watches a run of 9 blacks on a roulette wheel with only red and black, and rushes to place all his money on red.  He is sure that red must come up – after all the probability of a run of 10 blacks in a row is 1/1024.  However, because the prior outcomes have no influence on the next spin actually the probability remains at 1/2.

 gambling2

Maths is integral to all forms of gambling – the bookmakers and casino owners work out the Expected Value (EV) for every bet that a gambler makes.  In a purely fair game where both outcome was equally likely (like tossing a coin) the EV would be 0.  If you were betting on the toss of a coin, the over the long run you would expect to win nothing and lose nothing.  On a game like roulette with 18 red, 18 black and 2 green, we can work out the EV as follows:

$1 x 18/38 represents our expected winnings
-$1 x 20/38 represents our expected losses.

Therefore the strategy of always betting $1 on red has an EV of -2/38.  This means that on average we would expect to lose about 5% of our money every stake.

Expected value can be used by gamblers to work out which games are most balanced in their favour – and in games of skill like poker, top players will have positive EV from every hand.  Blackjack players can achieve positive EV by counting cards (not allowed in casinos) – and so casino bosses will actually monitor the long term fortunes of players to see who may be using this technique.

gambling3

Understanding expected value also helps maximise winnings.  Say 2 people both enter the lottery – one chooses 1,2,3,4,5,6 and the other a randomly chosen combination.  Both tickets have exactly the same probability of winning (about 1 in 14 million in the UK) – but both have very different EV.  The randomly chosen combination will likely be the only such combination chosen – whereas a staggering 10,000 people choose 1,2,3,4,5,6 each week.  So whilst both tickets are equally likely to win, the random combination still has an EV 10,000 times higher than the consecutive numbers.

Incidentally it’s worth watching Derren Brown (above). Filmed under controlled conditions with no camera trickery he is still able to toss a coin 10 times and get heads each time.  The question is, how is this possible?  The answer – that this short clip was taken from 9 hours of solid filming is quite illuminating about our susceptibility to be manipulated with probability and statistics.  This  particular technique is called data mining (where multiple trials are conducted and then only a small portion of those trials are honed in on to show patterns) and is an easy statistical manipulation of scientific and medical investigations.

If you liked this post you might also like:

Does it Pay to be Nice? Game Theory and Evolution. How understanding mathematics helps us understand human behaviour

Premier League Finances – Debt and Wages. An investigation into the finances of Premier League clubs.

Screen Shot 2018-03-19 at 5.29.06 PM

IB Revision

Screen Shot 2018-03-19 at 4.35.19 PM

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

Screen Shot 2018-03-19 at 4.42.05 PM.pngThe Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial.  Really useful!

Screen Shot 2019-07-27 at 10.02.40 AM

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions.  This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.

Website Stats

  • 6,824,291 views

Recent Posts

Follow IB Maths Resources from British International School Phuket on WordPress.com