Skip to content
Vamshi Jandhyala

Books · The Riddler

Chapter 34

Who Wants To Be A Riddler Millionaire?

Riddler Express

On the $1 million question with choices A,B,C,DA,B,C,D, you are 70%70\% sure the answer is BB, with the other three equally plausible. You use the 50:5050{:}50, which removes two wrong answers and always keeps the correct one. BB survives. How confident are you now that BB is correct?

Solution

Let LL be the event that BB is one of the two answers the 50:5050{:}50 leaves. The lifeline always keeps the correct answer and one of the three wrong answers at random. If BB is correct (prior 0.70.7) it certainly survives, so Pr(LB)=1\Pr(L\mid B) = 1. If BB is wrong (prior 0.30.3), it survives only as the lone wrong answer kept, one of three, so Pr(Lnot B)=13\Pr(L\mid \text{not }B) = \tfrac13. By Bayes, Pr(BL)=10.710.7+130.3=0.70.8=78=0.875.\Pr(B \mid L) = \frac{1\cdot 0.7}{1\cdot 0.7 + \tfrac13\cdot 0.3} = \frac{0.7}{0.8} = \boxed{\tfrac78} = 0.875. Seeing BB survive nudges your confidence from 70%70\% up to 87.5%87.5\%, because a wrong BB would often have been removed.

The computation

Simulate the lifeline: place the correct answer (BB with probability 0.70.7, else one of the others), keep it plus a random wrong answer, and among the trials where BB survives, measure how often BB was right.

import numpy as np
rng = np.random.default_rng(0); runs = 4_000_000
survived = correct = 0
for _ in range(runs):
    truth = 'B' if rng.random() < 0.7 else rng.choice(['A', 'C', 'D'])
    wrong = [c for c in 'ABCD' if c != truth]
    kept = {truth, rng.choice(wrong)}        # 50:50 keeps truth + one wrong
    if 'B' in kept:
        survived += 1; correct += (truth == 'B')
print(correct / survived)                    # ~0.875

Riddler Classic

The classic birthday problem needs only 23 people for better-than-even odds that two share a birthday. How many people do you need for better-than-even odds that at least three share a birthday? (Ignore leap years.)

Solution

Work with the complement: no birthday is shared by three or more people, meaning every day is used at most twice. Among nn people, the number of birthday assignments with no day used three or more times, divided by 365n365^n, gives Pr(no triple)\Pr(\text{no triple}). There is no tidy closed form, but the count is built up day by day: process the 365365 days one at a time, and for each decide whether 00, 11, or 22 of the remaining people land on it, in (nkj)\binom{n-k}{j} ways.

Running this for growing nn, the probability of at least three sharing first passes one half at n=88,Pr(3 share)0.511.n = \boxed{88}, \qquad \Pr(\ge 3 \text{ share}) \approx 0.511. So 8888 people suffice, well above the 2323 of the two-person version, since coincidences of three are much rarer.

The computation

For each nn, count the assignments with every day used at most twice (a dynamic program over the days), divide by 365n365^n for the no-triple probability, and report the first nn whose complement exceeds one half.

from fractions import Fraction as F
from math import comb
def no_triple(n, D=365):
    dp = [0] * (n + 1); dp[0] = 1            # dp[k]: ways for k people
    for _ in range(D):                       # add one day at a time
        nd = [0] * (n + 1)
        for k in range(n + 1):
            if dp[k]:
                for j in (0, 1, 2):          # 0, 1 or 2 people on this day
                    if k + j <= n:
                        nd[k + j] += dp[k] * comb(n - k, j)
        dp = nd
    return F(dp[n], D**n)
n = 80
while 1 - no_triple(n) <= F(1, 2):
    n += 1
print(n)                                      # 88