Attention

The formal proof contains an error. It is indicated by a footnote and still needs to be resolved. Thanks to my friend Robbert Hardin for spotting the mistake.

Poker, Although Not Quite

When I was younger, I used to play poker with friends. At some point, probably when two finalists were taking turns going all-in, I stumbled upon an interesting question.

Description

Consider the situation of a two-player game where both players keep going all-in. Suppose now that every round the playe with the fewest amount of chips wins. Does this game risk going on indefinitely and if so, under what conditions is this the case?

Immediately, this example proves that some games do not terminate.

The interesting question that remains and that I will be answering in this article is:

Under what conditions do games terminate?

Defining the Game

Of course this derived deterministic mini-game has little to do with poker (but it is a great excuse for some fun mathematical problem solving). Games need names, so I’ve decided to dub this game The Loser Doubles, since every round the player who is behind (the “loser”) is the one who wins that round and then doubles their amount of chips.

First, let’s define the game more rigorously, ditching the poker terminology as well.

  • There are exactly two players in this game. At no point during the game does this change.
  • Each player has points, the amount of which will vary per round.
  • The total amount of points in the game is fixed (never changes), only the distribution among the players changes (it’s a zero-sum game).
  • Each round the player with the least amount of points wins that round, meaning they receive that amount of points from the other player.
  • The game terminates if and only if one player has points.

The astute reader might realize there’s a problem with our definition: what if the players have the same amount of points? Then it would be ambiguous who wins. Luckily for us this game is so boring that nobody cares who wins. We only care under which conditions the game terminates.

Note that whenever either of the players has points, this means that in the previous round both of them must have had an equal amount of points. Make sure you convince yourself of the fact that this is necessarily the case. What follows from this is the knowledge that whenever (and only then) the two players get an equal amount of points, the game will terminate, and we can discard the ambiguity involved in how it will end (i.e. who will win).

Let’s amend the game’s termination condition to escape the aforementioned ambiguity:

  • The game terminates if and only if both players have the same amount of points.

Now, either both players have an equal amount of points, in which case the game will terminate, or one player has less points than the other, in which case we can advance our game another round. This time it seems we have well-defined behavior for our game.

This definition is informal, but it suffices.

Playing Around

Whenever you’re dealing with a problem like this, it’s a good idea to fiddle around with some examples. Earlier, we saw an example of a scenario which led to a game that never terminates. If you like to, try out examples of your own: which games terminate and which ones don’t? Can you identify any properties or patterns? Here’s an example of a game that does terminate: Alice has points, and Bob has . In the next round they’ll have and points respectively, and then both will have points, and thus the game terminates.

So yeah, I told you exploring examples is a good idea, and it is, but I doubt it will lead you to the discovery of the answer to this problem. If you can prove me otherwise though, make sure to share that with me!

We need to approach this more methodically.

Getting Methodical

As is quite clear, this game is deterministic: each round the game can advance in precisely one way. Or, to put in another way, any round is the successor of exactly two possible preceding rounds, each of which corresponds to a different player having doubled their points since. For example, if Alice has points, and Bob has , there’s two possible rounds that could have preceded this one, one in which Alice was the one who doubled her points, in which case she had points and Bob had , and one in which Bob was the one who doubled his points, meaning he had while Alice had .

Due to these deterministic properties, you can do something clever:

Start with a game you know will terminate, and from there, backtrack all possible preceding rounds.

Let’s explore.

The Binary Tree

A nice way to visually represent the possible rounds in games that (eventually) terminate is a binary tree. Before I elaborate on that any further though, let’s first make some more observations.

Firstly, what really matters in these games is not the actual amounts of points the players have, or even the absolute total. What matters are the ratios of the point distribution among the players. For example, whether both players have points or just is irrelevant. In both cases there’s a ratio, which is what matters.

Looking at it this way, we can normalize all possible ratios by dividing by all common divisors (essentially diving by the greatest common divisor), leaving a single representative pair. The pair will represent the ratios , , and so on.

So, any round can now be represented by a single pair of numbers which are coprime (i.e. don’t share any divisors). It’s time to build our tree.

Recall that backtracking from a given round leads to exactly two preceding rounds that could have happened. This is why the binary tree is a perfect visualization. On row , we have the root node , which means the game has terminated. On row , there’s two child nodes which each represent a possible preceding round. And so forth.

Here’s part of the beginning of the tree:

The-Losing-Player-Doubles-Game---A-Mathematical-Proof-2024-04-22-20.17.35.excalidraw
Some observations and conventions:

  • Every row represents a round in the game. The rows are numbered, starting with row .
  • Note: since we’re backtracking, row is the round before row .
  • Every node in a row represents a possible state of the game, i.e. a distribution of points among the two players for a specific round.
  • For any node we will say that the parts belong to player , and the other parts to player .
  • The tree is mirrored over the axis, since we can consider only one half without losing any generality. It’s irrelevant for our purposes whether Alice has (for example) points and Bob has , or vice versa.

It might not be immediately obvious how to derive the pairs in the tree. Let’s work out an example to demonstrate how you can go about this.

In row we have the node . Let’s determine the possible preceding rounds. First, note that is equivalent with a ratio of . This will make the arithmetic easier. So, either:

  1. Player doubled their points in the last round, in which case they used to have part, meaning player must have lost one part, meaning they had parts. So, this corresponds to the node . Note that these numbers are coprime, and don’t need further normalization.
  2. Player doubled their points, so they had parts, and player must have had parts. This corresponds with the node .

Now that we have a neat visualization, it’s time to solve the puzzle.

The Solution

The binary tree we just constructed enables us to come up with a hypothesis quite easily.

The root node represents (and is the only node doing so) a terminating game. A game terminates if and only if the points ratio corresponds to this node. Then, from there, we can indefinitely carry on the recursive generation of all possible preceding ratios between the players’ points. This means that by definition, this tree covers the entire set of coprime normalized ratios (and nothing else). Put differently: if the players have points with a ratio corresponding to some node in this tree, the game will ultimately end. Reversely, if the ratio does not correspond to any node on the tree, the game will not end.

All that remains then is the question: how can I tell whether the ratio of certain game state corresponds with a node on the tree?

The Pattern

To answer that question, it would help if we could identify some property that holds for every node in the tree. And we’re in luck, because it’s not very hard to see:

Note

Given some row of the tree, it holds that for every node in that row, we have .

This makes sense, because row clearly has a sum of , and since the coprime normalization we apply requires us to multiply by every row we advance (see the example calculation earlier, with the ratio), this sum gets multipied by for the next row.

Anyways, how does this help us? It doesn’t immediately. However, if its reverse also holds, we would obtain a satisfactory result:

Conjecture

For any coprime :

For those unfamiliar with the double arrow symbol: it means “if and only if”, basically signifying logical equivalence between both sides, i.e. the left hand side implies the right hand side and vice versa.

If this is indeed true, then we can determine whether our game terminates as follows:

  1. Take the point counts of each player and divide them by the greatest common divisor. This way, all common divisors are factored out, and you end up with a coprime normalized pair.
  2. Add the obtained coprime numbers.
    • If they add up to some power of , this game will end.
    • Otherwise, the game will not end.

It is now time to get to actually proving the conjecture.

The Formal Proof

This is the part where the article gets quite technical. If you have no background in mathematics, it’s probably hard to follow along. Definitely feel free to try though.

First, let’s reiterate our conjecture:

The Proposed Solution

Given coprime :

Proof

We will use mathematical induction on .

For , there’s only one node, namely . Therefore, what needs to be proved is:

This is trivially true.

Then, assume the hypothesis holds for all . We will now show that then, it also holds for .

Let be coprimes. Without loss of generality, we can assume . Let’s apply the rules to advance the game to the next round. Afterwards, we’ll expose a relationship between the sums of the parts of subsequent rounds:

Giving us the ratio in the next round. Now note that since are coprime, they are odd1, and therefore are even. So we can safely divide by :

First let’s prove that the pair is coprime. I will prove this using a proof from contradiction.

Suppose are not coprime. Then:

So, for some :

We have a common divisor between and , which contradicts the fact that they are coprime. Therefore, our assumption that are not coprime must be wrong, and the conclusion is that they are coprime.

Since and are coprime, they are the coprime normalized representative pair for the row we just advanced. As promised earlier, let us finally proceed and relate the sums of and :

We will use this in the proof ahead. Let’s go back to proving the case . There’s two directions of implication we need to prove.

()

If is a node on row , then is a node on row . Using the induction assumption, that means . But we know , so it follows that . This implication holds.

()

Suppose . Since , this means . By the induction hypothesis, this means is in row . But that means the predecessor is in row . So, this implication holds as well.

Since both directions of the implication hold, we have proven the case for , thereby concluding this proof successfully.

Footnotes

  1. This is an error in the proof. However, I’ve been told by friends that using the Euclidean algorithm it can be shown quite straightforwardly that and are coprime.