# Can You Hack Gymnastics?

## This Week's Fiddler

Say gymnast A has difficulty score 6 and gymnast B has difficulty score 5. Let their execution scores be $a$ and $b$, respectively. Then A wins both scoring methods if $a>\frac{5}{6}b$ and $a>b-1$, and B wins with both scoring methods if $b>\frac{6}{5}a$ and $b>a+1$.

For A's victory, multiplicative scoring is a stronger requirement up until $b=6$, where additive scoring becomes a stronger requirement. So we can set up the following integral to represent the probability of a decisive result for A, where the additive and multiplicative scoring methods agree:

$\frac{1}{100}\biggl( \int_0^6(10-\frac{5}{6}b)\ db + \int_6^{10}(11-b)\ db \biggl)$For B's victory, additive is stronger up until $a=5$, where multiplicative scoring becomes a stronger requirement. Note though that $a\lt10\cdot\frac{5}{6}=\frac{25}{3}$ because $b$ can no longer fit the multiplicative requirement beyond that. So the following integral is made for B:

$\frac{1}{100}\biggl( \int_0^5(9-a)\ da + \int_5^{\frac{25}{3}}(10-\frac{6}{5}a)\ da \biggl)$And their sum is the final probability, which is $\frac{577}{600}$, or about 96.17%.

**Answer**: 577/600

## Extra Credit

Monte-Carlo simulation:

```
import random
random.seed(12)
T = 10**7
success = 0
for t in range(T):
a, b = 10 * random.random(), 10 * random.random()
alpha, beta = 10 * random.random(), 10 * random.random()
if (alpha + a > beta + b) == (alpha * a > beta * b):
success += 1
print(success / T)
```

Output:

```
0.9166818
```

Though I suspect an exact integral could work here too 🤔

**Answer**: 91.7%