Publications by xi'an
Le Monde puzzle [#1158]
A weekly puzzle from Le Monde on umbrella sharing: Four friends, Antsa, Cyprien, Domoina and Fy, are leaving school to return to their common housing. It is raining and they only have one umbrella with only room for two. Given walking times, x¹, x², x³ and x⁴, find the fastest time by which all of the four will be home, assuming they all ag...
860 sym R (752 sym/2 pcs) 2 img
another electoral map
Related To leave a comment for the author, please follow the link and comment on their blog: R – Xi'an's Og. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want to share your content on R-bloggers? click here i...
397 sym 2 img
on arithmetic derivations of square roots
An intriguing question made a short-lived appearance on the CodeGolf section of Stack Exchange, before being removed, namely the (most concise possible) coding of an arithmetic derivation of the square root of an integer, S, with a 30 digit precision and using only arithmetic operators. I was not aware of the myriad of solutions available, as dem...
1924 sym R (319 sym/3 pcs) 4 img
Le Monde puzzle [#1164]
The weekly puzzle from Le Monde is quite similar to older Diophantine episodes (I find myself impossible to point out): Give the maximum integer that cannot be written as 105x+30y+14z. Same question for 105x+70y+42z+30w. These are indeed Diophantine equations and the existence of a solution is linked with Bézout’s Lemma. Take the first equat...
2063 sym R (309 sym/1 pcs) 2 img
the riddle(r) of the certain winner losing in the end
Considering a binary random walk, starting at zero, what is the probability of being almost sure of winning at some point only to lose at the end? This is the question set by the post-election Riddler, with almost sure meaning above 99% and the time horizon set to n=101 steps (it could have been 50 or 538!). As I could not see a simple way to com...
1732 sym 2 img
Bernoulli factory in the Riddler
“Mathematician John von Neumann is credited with figuring out how to take a p biased coin and “simulate” a fair coin. Simply flip the coin twice. If it comes up heads both times or tails both times, then flip it twice again. Eventually, you’ll get two different flips — either a heads and then a tails, or a tails and then a heads, with e...
2719 sym R (360 sym/1 pcs) 6 img
around the table
The Riddler has a variant on the classical (discrete) random walk around a circle where every state (but the starting point) has the same probability 1/(n-1) to be visited last. Surprising result that stems almost immediately from the property that, leaving from 0, state a is visited couterclockwise before state b>a is visited clockwise is b/a+b....
1778 sym R (317 sym/2 pcs) 2 img
how many Friday 13th?
A short Riddler’s riddle on the maximum number of Fridays 13th over a calendar year, of which I found 9 by a dumb exploration : bi=c(1:31,1:29,1:31,1:30,1:31,1:30,1:31,1:31,1:30,1:31,1:30,1:31) oy=bi[-60] for(j in 0:(length(cy<-c(bi,oy,oy,oy))-1)){#any day in quartade dy=c(cy[(j+1):length(cy)],cy[1:j]) for(i in 0:6){ dz=(i+(1:length(cy)))...
1022 sym 2 img
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