Riddler Classic
Congratulations, youβve made it to the finals of the Riddler Ski Federationβs winter championship! Thereβs just one opponent left to beat, and then the gold medal will be yours.
Each of you will complete two runs down the mountain, and the times of your runs will be added together. Whoever skis in the least overall time is the winner. Also, this being the Riddler Ski Federation, you have been presented detailed data on both you and your opponent. You are evenly matched, and both have the same normal probability distribution of finishing times for each run. And for both of you, your time on the first run is completely independent of your time on the second run.
For the first runs, your opponent goes first. Then, itβs your turn. As you cross the finish line, your coach excitedly signals to you that you were faster than your opponent. Without knowing either exact time, whatβs the probability that you will still be ahead after the second run and earn your gold medal?
Extra credit: Over in the snowboarding championship, there are 30 finalists, including you (apparently, youβre a dual-sport threat!). Again, you are the last one to complete the first run, and your coach signals that you are in the lead. What is the probability that youβll win gold in snowboarding?
Solution
Let the finishing times for the two rounds of the two players be denoted by and which are independent and identically distributed normal random variables. We are given that . For player to win the gold medal, . If we define two new random variables and , the required probability is given by . As and are independent identically distributed normal random variables, and are also independent normal random variables with mean . The joint probability density function of and , is symmetric in and . The probability can be obtained by integrating the joint density function over the darker region in the figure below: Using the symmetry of the joint density function, it is easy to see that the probability is .
Therefore, the required probability is given by
The above value matches with that obtained by simulation using the code below. When you have players the probability of you winning the gold given that you finished with the lowest time in the first run is .
Computational Solution
from numpy.random import normal
runs = 1000000
def prob_gold(n):
num, den = 0, 0
for _ in range(runs):
firstrun_times = normal(0,1,n)
total_times = firstrun_times + normal(0,1,n)
if min(firstrun_times) == firstrun_times[n-1]:
den += 1
if min(total_times) == total_times[n-1]:
num += 1
return num/den
print("Probability of gold when number of players=%i is %f" % (2, prob_gold(2)))
print("Probability of gold when number of players=%i is %f" % (30, prob_gold(30)))