## Posts by xi'an

# Author: xi'an

#### riddles on Egyptian fractions and Bernoulli factories

Feed: R-bloggers. Author: xi'an. Two fairy different riddles on the weekend Riddler. The first one is (in fine) about Egyptian fractions: I understand the first one as Find the Egyptian fraction decomposition of 2 into 11 distinct unit fractions that maximises the smallest fraction. And which I cannot solve despite perusing this amazing webpage on Egyptian fractions and making some attempts at brute force random exploration. Using Fibonacci’s greedy algorithm. I managed to find such decompositions 2 = 1 +1/2 +1/6 +1/12 +1/16 +1/20 +1/24 +1/30 +1/42 +1/48 +1/56 after seeing in this short note 2 = 1 +1/3 +1/5 ... Read More

#### A precursor of ABC-Gibbs

Feed: R-bloggers. Author: xi'an. Following our arXival of ABC-Gibbs, Dennis Prangle pointed out to us a 2016 paper by Athanasios Kousathanas, Christoph Leuenberger, Jonas Helfer, Mathieu Quinodoz, Matthieu Foll, and Daniel Wegmann, Likelihood-Free Inference in High-Dimensional Model, published in Genetics, Vol. 203, 893–904 in June 2016. This paper contains a version of ABC Gibbs where parameters are sequentially simulated from conditionals that depend on the data only through small dimension conditionally sufficient statistics. I had actually blogged about this paper in 2015 but since then completely forgotten about it. (The comments I had made at the time still hold, already ... Read More

#### an attempt at code golf

Feed: R-bloggers. Author: xi'an. Having discovered codegolf on Stack Exchange a few weeks ago, I spotted a few interesting puzzles since then but only got the opportunity at a try over a quiet and rainy weekend (and Robin being on vacation)! The challenge was to write an R code for deciding whether or not a given integer n is congruent or not, when congruent means that it is the surface of a rectangle triangle with all three sides rational. The question included a pointer to the Birch and Swinnerton-Dyer conjecture as a mean to check congruence although the real solution ... Read More

#### easy Riddler

Feed: R-bloggers. Author: xi'an. The riddle of the week is rather standard probability calculus If N points are generated at random places on the perimeter of a circle, what is the probability that you can pick a diameter such that all of those points are on only one side of the newly halved circle? Since it is equivalent to finding the range of N Uniform variates less than ½. And since the range of N Uniform variates is distributed as a Be(N-1,2) random variate. The resulting probability, which happens to be exactly , is decreasing exponentially, as shown below… Related ... Read More

#### a perfectly normally distributed sample

Feed: R-bloggers. Author: xi'an. When I saw this title on R-bloggers, I was wondering how “more perfect” a Normal sample could be when compared with the outcome of rnorm(n). Hence went checking the original blog on bayestestR in search of more information. Which was stating nothing more than how to generate a sample is perfectly normal by using the rnorm_perfect function. Still unsure of the meaning, I contacted one of the contributors who replied very quickly …that’s actually a good question. I would say an empirical sample having characteristics as close as possible to a cannonic gaussian distribution. and again ... Read More

#### visualising bias and unbiasedness

Feed: R-bloggers. Author: xi'an. A question on X validated led me to wonder at the point made by Christopher Bishop in his Pattern Recognition and Machine Learning book about the MLE of the Normal variance being biased. As it is illustrated by the above graph that opposes the true and green distribution of the data (made of two points) against the estimated and red distribution. While it is true that the MLE under-estimates the variance on average, the pictures are cartoonist caricatures in their deviance permanence across three replicas. When looking at 10⁵ replicas, rather than three, and at samples ... Read More

#### Le Monde puzzle [#1099]

Feed: R-bloggers. Author: xi'an. A simple 2×2 Le Monde mathematical puzzle: Arielle and Brandwein play a game out of two distinct even integers between 1500 and 2500, and y. Providing one another with either the pair (x/2,y+x/2) or the pair (x+y/2,y/2) until they run out of even possibilities or exceed 6 rounds. When x=2304, what is the value of y that makes Brandwein win? Which I solved by a recursive function (under the constraint of a maximum of 11 levels of recursion): nezt=function(x,y,i=1){ if ((i>11)||((is.odd(x)&is.odd(y)))){ return(-1) }else{ z=-1 if (is.even(x)) z=-nezt(x/2,y+x/2,i+1) if (is.even(y)) z=max(z,-nezt(y/2,x+y/2,i+1)) return(z)}} and checking all values of ... Read More

#### Le Monde puzzle [#1094]

Feed: R-bloggers. Author: xi'an. A rather blah number Le Monde mathematical puzzle: Find all integer multiples of 11111 with exactly one occurrence of each decimal digit.. Which I solved by brute force, by looking at the possible range of multiples (and borrowing stringr:str_count from Robin!) > combien=0 > for (i in 90001:900008){ j=i*11111 combien=combien+(min(stringr::str_count(j,paste(0:9)))==1)} > combien [1] 3456 And a bonus one: Find all integers y that can write both as x³ and (10z)³+a with 1≤a≤999. which does not offer much in terms of solutions since x³-v³=(x-v)(x²+xv+v²)=a shows that x² is less than 2a/3, meaning x is at most 25 ... Read More

#### survivalists [a Riddler’s riddle]

Feed: R-bloggers. Author: xi'an. A neat question from The Riddler on a multi-probability survival rate: Nine processes are running in a loop with fixed survivals rates .99,….,.91. What is the probability that the first process is the last one to die? Same question with probabilities .91,…,.99 and the probability that the last process is the last one to die. The first question means that the realisation of a Geometric G(.99) has to be strictly larger than the largest of eight Geometric G(.98),…,G(.91). Given that the cdf of a Geometric G(a) is [when counting the number of attempts till failure, included, ... Read More

#### BayesComp 20 [full program]

Feed: R-bloggers. Author: xi'an. The full program is now available on the conference webpage of BayesComp 20, next 7-10 Jan 2020. There are eleven invited sessions, including one j-ISBA session, and a further thirteen contributed sessions were selected by the scientific committee. Calls are still open for tutorials on Tuesday 07 January (with two already planed on Nimble and AutoStat) and for posters. Now is the best time for registering! Note also that travel support should be available for junior researchers. Related To leave a comment for the author, please follow the link and comment on their blog: R – ... Read More

## Recent Comments