Publications by xi'an
multinomial but unique
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 decomposit...
934 sym 2 img
likelihood inference with no MLE
“In a regular full discrete exponential family, the MLE for the canonical parameter does not exist when the observed value of the canonical statistic lies on the boundary of its convex support.” Daniel Eck and Charlie Geyer just published an interesting and intriguing paper on running efficient inference for discrete exponential families whe...
1484 sym 2 img
1 / duh?!
An interesting case on X validated of someone puzzled by the simulation (and variance) of the random variable 1/X when being able to simulate X. And being surprised at the variance of the ratio being way larger than the variances of both numerator and denominator. Related To leave a comment for the author, please follow the link and comment on ...
661 sym 2 img
[maximin] geometric climbing
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,]...
1006 sym R (180 sym/2 pcs) 2 img
Xing glass bridges [or not]
A riddle from the Riddler surfing on Squid Games. Evaluating the number of survivors (out of 16 players) able to X the glass bridge, when said bridge is made of 18 consecutive steps, each involving a choice between a tempered and a non-tempered glass square. Stepping on a non-tempered square means death, while all following players are aware of t...
2099 sym R (115 sym/2 pcs) 4 img
dice and sticks
A quick weekend riddle from the Riddler about the probability of getting a sequence of increasing numbers from dice with an increasing number of faces, eg 4-, 6-, and 8-face dice. Which happens to be 1/4. By sheer calculation (à la Gauss) or simple enumération (à la R): > for(i in 1:4)for(j in (i+1):6)F=F+(8-j) > F/4/6/8 [1] 0.25 The less-...
1200 sym R (64 sym/1 pcs) 2 img
triple ruin
The Riddler involving a triple gambler’s ruin: Dawn competes against three players Alessandra, Berenike, and Chinue, with probabilities of winning one round ¾, ½, and ¼, respectively, until the cumulated score reaches ±15, ±30, and ±45, for the first, second, and third games. What is Dawn’s optimal sequence of adversaries? First, a brut...
1178 sym R (594 sym/2 pcs) 1 img
blind monty hall
As I was waiting for my boat on a French Guiana beach last week, I thought back about a recent riddle from The Riddler where an item does a random walk over a sequence of N integers. Behind doors. The player opens a door at the same rate as the item, door that closes immediately after. What is the fastest strategy to catch the item? With a small ...
1087 sym R (505 sym/1 pcs) 2 img
spiral matrix [X-validated]
One recent code-golf challenge was to write the shortest possible code representing the first n² integers in a spiral progression, e.g., 0 1 2 3 4 15 16 17 18 5 14 23 24 19 6 13 22 21 20 7 12 11 10 9 8 While I did not come close to the best R code (with 67 bytes), this proved an interesting coding exercise, looking for a way to rotat...
967 sym R (521 sym/3 pcs)