Chapter 162
Rock, Paper, Scissors, Double Scissors
Riddler Express
In rock-paper-scissors-double-scissors, the three classical moves interact in the standard way, double scissors defeat regular scissors, and double scissors cut paper and are smashed by rock. A match is the first to two wins (ties replay the throw). One exception: if your opponent throws paper and you throw regular scissors, you immediately win the match regardless of the score. What is the optimal mixed strategy at each possible score ? What is your chance of winning from a lead with both players optimal?
The Riddler, FiveThirtyEight, September 29, 2017(original post)
Solution
The game is symmetric, so any score with has equal value for both players, that is . The score is even simpler: there is exactly one throw left, and double scissors dominates regular scissors for the leading player. This holds at any score where the special paper-scissors rule cannot help. Once a player already has one win, the auto-win bonus is irrelevant (one more throw and the match is over), and double scissors beats everything that scissors does plus regular scissors itself. So at neither player throws regular scissors, and the game reduces to ordinary rock-paper-double-scissors, with equilibrium on rock, paper, double scissors and value .
That leaves (your lead) and . Write for your winning chance from with optimal play on both sides, so that is your chance from . We will compute from a single matrix game.
The subgame. You already have one win, so double scissors dominates regular scissors for you: you choose among rock , paper , double scissors . Your opponent still trails and may benefit from throwing regular scissors (against your paper it auto-wins the match), so the opponent chooses among . Each throw resolves one of three ways:
A tie returns to and is worth .
You win the throw and reach , worth .
Your opponent wins the throw, ties the match at , worth .
The auto-win exception applies in two cells: if you throw paper and the opponent throws scissors, the opponent auto-wins (value ). The full payoff matrix is given below, rows for the opponent’s throw and columns for yours:
| R | P | DS | |
|---|---|---|---|
| R | |||
| P | |||
| S | |||
| DS |
Both players randomise. The value of this matrix game (you maximising over the columns, the opponent minimising over the rows) must equal by self-consistency. Solving the linear-programming equilibrium and self-consistently fixing gives
Equilibrium strategies at . The same LP returns the mixing probabilities. Your optimal mix on is and your opponent’s optimal mix on is Two features of the opponent’s mix are worth pausing on. First, the trailing opponent should never throw double scissors here: at a tie at is the best outcome of the round, and double scissors only ties when you throw double scissors. Second, regular scissors gets a healthy weight (), driven entirely by the auto-win against your paper.
The subgame. Both players use all four throws. Each round’s outcome is one of: tie (replay, worth by symmetry); you win the throw and lead , worth ; opponent wins and you trail , worth ; or the auto-win exception fires. The matrix is symmetric in the sense that swapping your throw and the opponent’s throw transposes the payoffs around , so the value of the matrix game is exactly . Solving the matrix LP gives the equilibrium mix on , Both players use the same mix by symmetry. Double scissors gets weight zero at . This is the puzzle’s neat observation: nobody should ever open with double scissors, and nobody should ever play regular scissors after gaining a win. Regular scissors stays in the toolkit only when the auto-win exception is in reach, and double scissors only when the special rule is dead.
The computation
Encode the recursive matrix games and solve them as linear programs. We fix self-consistently for the matrix (the only one whose value is itself ), then solve the matrix to read off its equilibrium.
Build the payoff matrix for the subgame as a function of .
Solve the LP for the value as a function of .
Iterate until convergence.
Build the payoff matrix for the subgame using the converged .
Solve its LP and read off the equilibrium mix and value.
import numpy as np
from scipy.optimize import linprog
def solve_max(M): # value & col-strategy
rows, cols = M.shape
c = np.zeros(cols + 1); c[-1] = -1
A_ub = np.hstack([-M, np.ones((rows, 1))])
b_ub = np.zeros(rows)
A_eq = np.zeros((1, cols + 1)); A_eq[0, :cols] = 1
res = linprog(c, A_ub=A_ub, b_ub=b_ub, A_eq=A_eq, b_eq=[1.0],
bounds=[(0, 1)] * cols + [(None, None)], method="highs")
return -res.fun, res.x[:cols]
def M10(X): # rows opp(R,P,S,DS), cols you(R,P,DS)
return np.array([
[X, 1, 0.5],
[0.5, X, 1.0],
[1, 0, 1.0],
[1, 0.5, X ],
])
X = 0.5
for _ in range(200):
v, _ = solve_max(M10(X)); X = v
print(f"X = {X:.4f}") # 0.7267
v10, you10 = solve_max(M10(X))
print("you 1-0 (R,P,DS):", you10.round(2)) # [0.40 0.27 0.33]
The same routine, applied to the matrix at (entries for your-throw wins, for opp-throw wins, for ties, for your-scissors-vs-opp-paper, for opp-scissors-vs-your-paper), returns value and mix , exactly the values quoted above.
Riddler Classic
Two coins look and feel identical. One is fair (heads with probability ); the other is doctored (heads with probability ). You flip both at once, one per hand, the same number of times. How many flips do you need to give yourself a chance of correctly identifying the doctored coin? Extra credit: replace by a general .
The Riddler, FiveThirtyEight, September 29, 2017(original post)
Solution
After paired flips, let be the number of heads on the doctored coin and the number on the fair coin. The rule is the obvious one: declare the coin with more heads to be the doctored one. We are correct exactly when (ties go against you in the worst case; the official solution treats them as failures, and we follow suit), so the question becomes the smallest for which The joint distribution is the product of binomials, so This is a finite sum with no clean closed form, but evaluating it as grows shows where the threshold sits.
For intuition before the computation, the difference has mean and variance , so a normal approximation gives Setting gives , so . The exact threshold is a little higher because the normal approximation overshoots when the per-flip mean is small; running the exact sum lands on At the probability is ; at it crosses to .
Extra credit. For a general doctored bias , the same calculation gives the threshold The normal approximation gives flips, which scales roughly like . A doctored coin with takes about four times as many flips as one with ; one with takes about a quarter as many. The smaller the doctoring, the brutally slower the detection.
The computation
Evaluate the exact sum for and walk upward until it crosses .
For each , compute exactly using binomial coefficients.
Return the smallest with sum .
from math import comb
def p_correct(n, P=0.6):
pk = [comb(n, k) * P**k * (1 - P)**(n - k) for k in range(n + 1)]
pj = [comb(n, j) * 0.5**n for j in range(n + 1)]
return sum(pk[k] * sum(pj[:k]) for k in range(1, n + 1))
n = 1
while p_correct(n) < 0.95:
n += 1
print(n, round(p_correct(n), 4)) # 143 0.9501
print(141, round(p_correct(141), 4)) # 141 0.9488
print(142, round(p_correct(142), 4)) # 142 0.9495
The threshold sits at , with , confirming the boxed answer. Running the same routine over a grid of values gives the curve flips at , at , at , at , and at . The doubling-when-you-halve-the-edge rule of thumb is steep: a coin biased by half a percentage point takes nearly two orders of magnitude more flips than one biased by ten.