Morra gambling for fun and profit

Eric Soderstrom
6 min readSep 30, 2019

--

I recently learned a two-player betting variant of the ancient game of Morra. The rules are simple — about as complicated as Rock Paper Scissors — but figuring out how to win the most money isn’t initially obvious. In fact, after explaining the rules and asking someone which player is favored, most people seem to guess wrong.

The book in which I found I found the description of this game, The Little Book of Mathematical Principles, Theories, & Things, presented the rules and the solution without much in the way of analysis. I thought this game was cute enough to be worth sharing, along with some explanation about why the solution is optimal.

Rules of the game

  • There are two players: let’s call them player A and player B.
  • In each round, both players simultaneously choose to hold up either one finger or two fingers.
  • If both players hold up one finger, player A pays $1 to player B.
  • If one player holds up one finger, while the other holds up two, B pays $2 to A.
  • If both players hold up two fingers, A pays $3 to B.

Which player is favored? And what is the best strategy?

Figure 1: Payoff matrix for player A. (B’s payoff matrix looks the same, with the signs reversed)

Analysis

On first glance, the game seems like it might be completely even. If both players randomly select between one and two fingers with a 50% chance for each, then the expected value per round for player A is:

0.25*(-$1) + 0.25*($2) + 0.25*($2) — 0.25*($3) = $0

We can see this by just multiplying the outcome of each cell in figure 1 by the probability of ending up in the cell. In this scenario, each outcome has the same likelihood (25%), so the expected outcome is that neither player will gain nor lose money in aggregate.

But what if B can figure out that A is simply choosing between one and two fingers with a 50% probability for each? Can B take advantage of this fact? If B decides to always hold up two fingers, then B’s expected value per round becomes:

0.5*(-$2) + 0.5*($3) = $0.50

Things aren’t looking good for player A! If A always holds up one finger, B can do the same and win $1 per round. If A holds up two fingers every time, again B will do the same and win $3 per round. And even if A chooses between the two options uniformly at random, B can still expect to win $0.50 per round by always holding up two fingers. Is there any strategy A can follow to not lose money?

Solution

First let’s write down some assumptions about the problem.

Assumption 1: Player A reveals her strategy to B.
Assumption 2: Using knowledge of A’s strategy, B plays to maximize his own expected winnings (and thereby minimize B’s expected winnings).

If A reveals her strategy to B, then A’s optimal strategy cannot be deterministic. The game has no hidden information and each round is independent, so if A’s strategy is deterministic then B can perfectly predict A’s actions and win every round.

If A’s strategy is non-deterministic, then it can be defined by the likelihood of holding up one finger and the corresponding likelihood of holding up two fingers.

Definitions
======
* P₁ is the probability that player A holds up one finger.
* P₂ is the probability that player A holds up two fingers.

These are the only two options, so the sum of these two probabilities is 1.
P₁ + P₂
= 1

From assumption 1, it follows that B knows the values of P₁ and P₂.

A’s expected value when B holds up 1 finger: EV₁ = P₁*(-$1) + P₂*($2)
A’s expected value when B holds up 2 fingers: EV₂ = P₁*($2) + P₂*(-$3)

Because the game is zero-sum (meaning one player’s loss is the other player’s gain), then if B aims to maximize his own winnings that is the same as B playing to minimize A’s winnings. So B’s optimal play is then to always hold up one finger if EV₁ < EV₂. And to always hold up two fingers if EV₂ > EV₁. If the two expected values are equal, then B is agnostic as to how many fingers to hold up.

A’s expected winnings per round are then the minimum of EV₁ and EV₂.

min(EV₁, EV₂) = min(P₁*(-$1) + P₂*($2), P₁*($2) + P₂*(-$3))

Because P₁ + P₂ = 1, we can rewrite this equation purely in terms of P₁.

min(P₁*(-$1) + (1 — P₁)*($2), P₁*($2) + (1 — P₁)*(-$3))
= min(2–3P₁, 5P₁-3)

By graphing the two linear equations 2–3P₁ and 5P₁-3, we can see that min(2–3P₁, 5P₁-3) is maximized where the two lines intersect.

Figure 2: A’s expected value as a function of P₁. Line 2–3P₁ shows A’s EV if B always holds up one finger. And line 5P₁-3 shows A’s EV if B always holds up two fingers.

The two lines intersect when 2–3P₁=5P₁-3

Which gives us P₁ = 5/8, P₂ = 3/8.

Therefore EV₁ = EV₂ = $0.125

By holding up one finger 5/8 of the time and two fingers 3/8 of the time, player A’s expected winnings are 12.5¢ per round. Interestingly, it doesn’t matter what strategy B follows. Regardless of how B plays, he will expect to lose 12.5¢ per round in the long run. You could even offer to play the game as A with your eyes closed (as long as a friendly third party can keep track of your winnings).

This solution is a simple example of linear programming — a general technique for finding maxima and minima subject to linear constraints. A thorough explanation of linear programming can be found for free online in Chapter 7: Linear programming and the theory of games of Introduction to Finite Mathematics.

Coda 1: Playing in real life

If you decide to play this game in person, the main challenge is to choose between one and two fingers randomly such that you hold up one finger 62.5% of the time, and two fingers 37.5% of the time.

Humans are bad at mentally producing random numbers. So your best bet as player A is to generate and memorize a long string of random bits where one bit appears 62.5% of the time, and the other bit appears 37.5% of the time. Then play each round according to this pre-computed random string.

Or if you’ve already memorized many digits from a transcendental number (E.g. π or φ), you can use that as your random string. Say you take the digits 1–5 to mean “hold up one finger”, the digits 6–8 to mean “hold up two fingers”, and skip over 0s and 9s. The first ten digits of the golden ratio φ (1.618033988) would be interpreted as ☝️✌️☝✌☝☝✌✌️️(12121122).

Coda 2: Extensions

  • Wasn’t our selection of player A’s perspective for the analysis completely arbitrary? Would we have gotten a different result if we’d done the analysis from B’s perspective instead? I’ll leave this as an exercise for the reader.
  • What if we remove assumption 1? Does that change the optimal strategy?
  • Why did we assume P₁ and P₂ to be fixed values? Would it ever make sense for a player to change P₁ and P₂ over time, or in response to the moves that their opponent makes?

--

--