Archive for The Riddler

[maximin] geometric climbing

Posted in Books, R with tags , , , , , on October 5, 2021 by xi'an

A puzzle from The Riddler this week returning to the ranking of climbing competitors in Tokyo. And asking for the maximin score, that is, the worst possible absolute score guaranteeing victory. In the case of eight competitors, a random search for a maximin over 10⁶ draws leads to a value of 48=1x7x8, for a distribution of ranks as follows

[1,]    1    8    8
[2,]    2    6    4
[3,]    3    4    5
[4,]    4    2    6
[5,]    5    5    2
[6,]    6    3    3
[7,]    7    7    1
[8,]    8    1    7

while over seven competitors (the case with men this year, since one of the brothers Mawem got hurt during the qualification), the value is 35=1x5x7, for a distribution of ranks as follows

[1,]    1    7    5
[2,]    2    3    6
[3,]    3    4    3
[4,]    4    5    2
[5,]    5    2    4
[6,]    6    1    7
[7,]    7    6    1

exhibiting a tie in the later case (and no first position for the winners!).

top of the top

Posted in Statistics with tags , , , on August 19, 2021 by xi'an

An easy-peasy riddle from The Riddler about the probability that a random variable is the largest among ten iid variates, conditional on the event that this random variable is larger than the upper decile. This writes down easily as

10\int_{q_{90}}^\infty F^9(x) f(x)\,\text d x

if F and f are the cdf and pmf, respectively, which is equal to 1-.9¹⁰, approximately 1-e⁻¹, no matter what F is….

more breaking sticks

Posted in Statistics with tags , , on July 19, 2021 by xi'an

A quick riddle from The Riddler that, when thinned to the actual maths problem, ends up asking for

\mathbb P(\max(U_1,U_2,U_3)=U_3)+\mathbb P(\min(U_1,U_2,U_3)=U_3)

which is equal to 2/3…. Anticlimactic.

multinomial but unique

Posted in Kids, R, Statistics with tags , , , , , , on July 16, 2021 by xi'an

A quick riddle from the Riddler, where the multinomial M(n¹,n²,100-n¹-n²) probability of getting three different labels out of three possible ones out of three draws is 20%, inducing a single possible value for (n¹,n²) up to a permutation.

Since this probability is n¹n²(100-n¹-n²)/161,700, there indeed happens to be only one decomposition of 32,340 as 21 x 35 x 44. The number of possible values for the probability is actually 796, with potential large gaps between successive values of n¹n²(100-n¹-n²) as shown by the above picture.

almost reversed 2-lag Markov chain

Posted in Kids, R, Statistics with tags , , , , on July 7, 2021 by xi'an

Another simple riddle from the Riddler: take a binary sequence and associate to this sequence a score vector made of the numbers of consecutive ones from each position. If the sequence is ten step long and there are 3 ones located at random, what is the expected total score? (The original story is much more complex and involves as often strange sports!)

Adding two zeroes at time 11 and 12, this is quite simple to code, e.g.

f=0*(1:10) #frequencies
for(v in 1:1e6){
 for(t in s)r[t]=1+((t+1)%in%s)*(1+((t+2)%in%s))

and the outcome recovers the feature that the only possible scores are 1+1+1=3 (all ones separated), 1+1+2=4 (two ones contiguous),  and 1+2+3=6 (all ones contiguous). With respective frequencies 56/120, 56/120, and 8/120. With 120 being the number of possible locations of the 3 ones.

%d bloggers like this: