Books · The Fiddler: Solutions
Chapter 88
Can You Hack Gymnastics?
Gymnast has a difficulty score of and gymnast a difficulty score of . Each receives an independent execution score drawn uniformly at random from to . What is the probability that the two gymnasts end up in the same relative order whether their two subscores are added or multiplied?
The Fiddler, Zach Wissner-Gross, August 9, 2024(original post)
Solution
Write for the two execution scores, each uniform on . Adding puts ahead when ; multiplying puts ahead when . The two methods give the same order exactly when these share a sign, that is when lies on the same side of both lines and . Those lines cross at , inside the square, so the only disagreement is the pair of thin slivers between them. Integrating the agreement region over the square gives area , hence probability
The computation
Encode the agreement condition itself and integrate it: the region where both gaps are positive, plus the region where both are negative, over the square.
import sympy as sp
a, b = sp.symbols('a b')
f1, f2 = 1 + a - b, 6 * a - 5 * b # added gap, multiplied gap
def region(cond): # area where both gaps satisfy cond
return sp.integrate(sp.Piecewise((1, cond), (0, True)), (b, 0, 10), (a, 0, 10))
agree = region((f1 > 0) & (f2 > 0)) + region((f1 < 0) & (f2 < 0))
print(sp.Rational(agree, 100)) # 577/600
Extra Credit
Now let both difficulty scores also be independent and uniform on . What is the probability the ranking agrees under adding and multiplying?
Solution
With all four scores random, write the difficulties and executions , all uniform on . Adding and multiplying agree when and share a sign. Averaging over the four-dimensional cube, the probability falls to about It drops from the of the fixed-difficulty case because random difficulties make near-ties far more common, and near-ties are exactly where adding and multiplying can disagree. (There is no tidy closed form; this is the simulated value.)
The computation
Sample the four scores uniformly and measure how often the two orderings agree.
import numpy as np
rng = np.random.default_rng(0); n = 20_000_000
dA, dB, a, b = rng.random((4, n)) * 10
agree = (np.sign((dA + a) - (dB + b)) == np.sign(dA * a - dB * b)).mean()
print(agree) # ~0.9168