Skip to content
Vamshi Jandhyala

Books · The Riddler

Chapter 73

Can You Systematically Solve A Friday Crossword?

Riddler Express

You are on 1818 points and must reach exactly 2121 (going over loses) with four bean-bag tosses. Each toss you choose: aggressive (0.40.4 in the hole for +3+3, 0.30.3 on the board for +1+1, 0.30.3 miss), conservative (0.10.1, 0.80.8, 0.10.1), or a deliberate waste (+0+0 for sure). Playing optimally, what is your probability of finishing on exactly 2121?

Solution

You need exactly 33 more points and must never exceed them. Work backwards over the throws, tracking how many points you still have in hand. Let Pk(x)P_k(x) be your best chance of finishing on 33 when you have xx points and kk tosses left. Any score above 33 is an instant loss (P=0P = 0), and with no tosses left you succeed only if x=3x = 3. Otherwise you pick the best of the three throws (aggressive, conservative, waste, top to bottom), Pk(x)=max ⁣{0.4Pk1(x+3)+0.3Pk1(x+1)+0.3Pk1(x)0.1Pk1(x+3)+0.8Pk1(x+1)+0.1Pk1(x)Pk1(x).P_k(x) = \max\!\begin{cases} 0.4\,P_{k-1}(x{+}3) + 0.3\,P_{k-1}(x{+}1) + 0.3\,P_{k-1}(x)\\ 0.1\,P_{k-1}(x{+}3) + 0.8\,P_{k-1}(x{+}1) + 0.1\,P_{k-1}(x)\\ P_{k-1}(x). \end{cases} The waste option matters: once you reach 33 you simply waste the rest and lock in the win. Evaluating P4(0)P_4(0) gives 21372500=85.48%.\frac{2137}{2500} = \boxed{85.48\%}. The optimal play opens aggressively while there is room for a +3+3, then turns conservative or wastes throws to protect a reachable exact total.

The computation

Recurse over (tosses left, points), taking the best throw at each state and treating any overshoot as a loss.

from fractions import Fraction as F
from functools import lru_cache
A = (F(4,10), F(3,10), F(3,10)); C = (F(1,10), F(8,10), F(1,10))
@lru_cache(None)
def P(k, x):
    if x > 3: return F(0)
    if k == 0: return F(1) if x == 3 else F(0)
    throw = lambda h, b, m: h*P(k-1, x+3) + b*P(k-1, x+1) + m*P(k-1, x)
    return max(throw(*A), throw(*C), P(k-1, x))
print(P(4, 0), float(P(4, 0)))                 # 2137/2500, 0.8548