Publications by xi'an
puzzles & riddles
A rather simplistic game on the Riddler of 18 December: …two players, each of whom starts with a whole number of points. Players take turns “attacking” each other, which involves subtracting their own number of points from their opponent’s until one of the players is out of points. Easy to code in R: g=function(N,M)ifelse(N<M,-g(M-N,N),...
1455 sym R (147 sym/2 pcs) 6 img
Kempner Fi
A short code-golf challenge led me to learn about the Kempner series, which is the series made of the inverted integers, excluding all those containing the digit 9. Most surprisingly this exclusion is enough to see the series converging (close to 23). The explanation for this convergence is that, citing Wikipedia, “The number of n-digit positiv...
1446 sym R (65 sym/1 pcs) 4 img
wrong algebra for slice sampler
Once more, and thrice alas!, I became aware of a typo in our “Use R!” book through a question on X validated from a reader unable to reproduce the slice of a basic 2D slice sampler for a logistic regression with coefficients (a,b). Indeed, our slice reads as the incorrect set (missing the i=1,…,n) which is the version I found in my LaTeX fi...
1067 sym 8 img
easy and uneasy riddles
On 15 January, The Riddler had both a straightforward and a challenging riddles. The first one was to optimise the choice of a real number d with the utility function U(d,θ)=d ℑ(θ>d), when θ is Uniform(0,100). Leading unsurprisingly to d=50… The tough(er) one was to solve a form of sudoku where the 24 entries of a 8×3 table are integers i...
1667 sym R (358 sym/2 pcs)
hard birthday problem
Click to access birthday.pdf From an X validated question, found that WordPress now allows for direct link to pdf documents, like the above paper by my old friend Anirban Das Gupta! The question is about estimating a number M of individuals with N distinct birth dates over a year of T days. After looking around I could not find a simpler represen...
1487 sym R (72 sym/1 pcs) 6 img
new order
The latest riddle from The Riddler was both straightforward: given four iid Normal variates, X¹,X²,X³,X⁴, what is the probability that X¹+X² I posted the question on math.stackexchange, then on X validated, but received no hint at a possible simplification of the probability. And then erased the questions. Given the shape of the domain wh...
992 sym R (558 sym/1 pcs) 4 img
love thy command line [Bourne again]
“Prebuilt into macOS and Unix systems (…) the command line (also called the shell) is a powerful text-based interface in which users issue terse instructions to create, find, sort and manipulate files, all without using the mouse. There are actually several distinct (…) shell systems, among the most popular of which [sic?] is Bash, an acron...
1455 sym 2 img
folded Normals
While having breakfast (after an early morn swim at the vintage La Butte aux Cailles pool, which let me in free!), I noticed a letter to the Editor in the Annals of Applied Statistics, which I was unaware existed. (The concept, not this specific letter!) The point of the letter was to indicate that finding the MLE for the mean and variance of a f...
1581 sym 2 img
more, please!
As The Riddler proposed for several weeks a CrossProduct puzzle when 3 x n one-digit integers have to be deduced from their rowwise and columnwise products, I attempted at writing an R solver by applying a few basic rules repeatedly, which worked for the first two puzzles, if not for the earlier one I solved by paper & pen (mostly) a few weeks ag...
997 sym 4 img
stack overload
The Riddle this week is rather straightforward to explain: stacking identical objects (bars of length and mass two, say) on top of one another so that the center of each new bar is uniformly distributed along the previous bar, what is the distribution of the number of bars when the stack collapses? If I am not confused, the stack collapses the fi...
907 sym 6 img