Publications by xi'an

Le Monde puzzle [#1051]

17.05.2018

A combinatoric Le Monde mathematical puzzle of limited size: When the only allowed move is to switch two balls from adjacent boxes, what is the minimal number of moves to return all balls in the above picture to their respective boxes? Same question with six boxes and 12 balls. The question is rather interesting to code as I decided to use recur...

1798 sym R (1155 sym/3 pcs) 4 img

maximal spacing around order statistics [#2]

07.06.2018

The proposed solution of the riddle from the Riddler discussed here a few weeks ago is rather approximative, in that the distribution of when the n-sample is made of iid Normal variates is (a) replaced with the distribution of one arbitrary minimum and (b) the distribution of the minimum is based on an assumption of independence between the abso...

1049 sym 4 img

a chain of collapses

19.06.2018

A quick riddler resolution during a committee meeting (!) of a short riddle: 36 houses stand in a row and collapse at times t=1,2,..,36. In addition, once a house collapses, the neighbours if still standing collapse at the next time unit. What are the shortest and longest lifespans of this row? Since a house with index i would collapse on its own...

1365 sym 2 img

Le Monde puzzle [#1053]

20.06.2018

An easy arithmetic Le Monde mathematical puzzle again: If coins come in units of 1, x, and y, what is the optimal value of (x,y) that minimises the number of coins representing an arbitrary price between 1 and 149?  If the number of units is now four, what is the optimal choice? The first question is fairly easy to code coinz <- function(x,y)...

1793 sym R (498 sym/3 pcs) 2 img

Bayesian GANs [#2]

26.06.2018

As an illustration of the lack of convergence of the Gibbs sampler applied to the two “conditionals” defined in the Bayesian GANs paper discussed yesterday, I took the simplest possible example of a Normal mean generative model (one parameter) with a logistic discriminator (one parameter) and implemented the scheme (during an ISBA 2018 sessio...

1291 sym 6 img

hitting a wall

04.07.2018

Once in a while, or a wee bit more frequently (!), it proves impossible to communicate with a contributor of a question on X validated. A recent instance was about simulating from a multivariate kernel density estimate where the kernel terms at x¹,x²,… are Gaussian kernels applied to the inverses of the norms |x-x¹|, |x-x²|,… rather than ...

1986 sym 2 img

seven digit addition

05.07.2018

Another quick riddle from the riddler: solve the equation EXMREEK + EHKREKK = ?K?H?X?E which involves every digit between 0 and 9. While the puzzle can be unravelled by considering first E and K, which must be equal to 6 and 3, a simple R code also leads to the conclusion isok <- function(a,b){ s=as.numeric(unlist(strsplit(as.character(sum(10^(...

693 sym R (647 sym/1 pcs)

a thread to bin them all [puzzle]

08.07.2018

The most recent riddle on the Riddler consists in finding the shorter sequence of digits (in 0,1,..,9) such that all 10⁴ numbers between 0 (or 0000) and 9,999 can be found as a group of consecutive four digits. This sequence is obviously longer than 10⁴+3, but how long? On my trip to Brittany last weekend, I wrote an R code first constructing...

1236 sym R (978 sym/2 pcs) 6 img

Hamiltonian tails

16.07.2018

“We demonstrate HMC’s sensitivity to these parameters by sampling from a bivariate Gaussian with correlation coefficient 0.99. We consider three settings (ε,L) = {(0.16; 40); (0.16; 50); (0.15; 50)}” Ziyu Wang, Shakir Mohamed, and Nando De Freitas. 2013 In an experiment with my PhD student Changye Wu (who wrote all R codes used below), we...

1993 sym 14 img

Le Monde puzzle [#1061]

19.07.2018

A griddy Le Monde mathematical puzzle: On a 4×5 regular grid, find how many nodes need to be turned on to see all 3×4 squares to have at least one active corner in case of one arbitrary node failing.  Repeat for a 7×9 grid. The question is open to simulated annealing, as in the following R code: n=3;m=4;np=n+1;mp=m+1 cvr=function(grue){ ...

748 sym R (949 sym/2 pcs) 2 img