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

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
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:

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

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

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

Essential resources for IB students:

Revision Village has been put together to help IB students with topic revision both for during the course and for the end of Year 12 school exams and Year 13 final exams.  I would strongly recommend students use this as a resource during the course (not just for final revision in Y13!) There are specific resources for HL and SL students for both Analysis and Applications.

There is a comprehensive Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and then provides a large bank 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!

The Practice Exams section takes you to a large number of ready made quizzes, exams and predicted papers.   These all have worked solutions and allow you to focus on specific topics or start general revision.  This also has some excellent challenging questions for those students aiming for 6s and 7s.

Each course also has a dedicated video tutorial section which provides 5-15 minute tutorial videos on every single syllabus part – handily sorted into topic categories.

I’ve put together four comprehensive pdf guides to help students prepare for their exploration coursework and Paper 3 investigations. The exploration guides talk through the marking criteria, common student mistakes, excellent ideas for explorations, technology advice, modeling methods and a variety of statistical techniques with detailed explanations. I’ve also made 17 full investigation questions which are also excellent starting points for explorations.  The Exploration Guides can be downloaded here and the Paper 3 Questions can be downloaded here.

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.

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.

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.

Essential resources for IB students:

Revision Village has been put together to help IB students with topic revision both for during the course and for the end of Year 12 school exams and Year 13 final exams.  I would strongly recommend students use this as a resource during the course (not just for final revision in Y13!) There are specific resources for HL and SL students for both Analysis and Applications.

There is a comprehensive Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and then provides a large bank 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!

The Practice Exams section takes you to a large number of ready made quizzes, exams and predicted papers.   These all have worked solutions and allow you to focus on specific topics or start general revision.  This also has some excellent challenging questions for those students aiming for 6s and 7s.

Each course also has a dedicated video tutorial section which provides 5-15 minute tutorial videos on every single syllabus part – handily sorted into topic categories.

I’ve put together four comprehensive pdf guides to help students prepare for their exploration coursework and Paper 3 investigations. The exploration guides talk through the marking criteria, common student mistakes, excellent ideas for explorations, technology advice, modeling methods and a variety of statistical techniques with detailed explanations. I’ve also made 17 full investigation questions which are also excellent starting points for explorations.  The Exploration Guides can be downloaded here and the Paper 3 Questions can be downloaded here.

### Website Stats

• 8,464,876 views

All content on this site has been written by Andrew Chambers (MSc. Mathematics, IB Mathematics Examiner).

### New website for International teachers

I’ve just launched a brand new maths site for international schools – over 2000 pdf pages of resources to support IB teachers.  If you are an IB teacher this could save you 200+ hours of preparation time.

Explore here!

### Free HL Paper 3 Questions

P3 investigation questions and fully typed mark scheme.  Packs for both Applications students and Analysis students.