Archive for the Kids Category

Le Monde puzzle [#1094]

Posted in Books, Kids, R with tags , , , , , , on April 23, 2019 by 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){
> 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. Among such numbers only x=11,12 lead to a solution as x³=1331,1728.

survivalists [a Riddler’s riddle]

Posted in Books, Kids, R, Statistics with tags , , , , , , on April 22, 2019 by 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, i.e. the Geometric with support the positive integers]

F(x)=\Bbb P(X\le x)=1-a^{x}

the probability that this happens has the nice (?!) representation

\sum_{x=2}^\infty a_1^{x-1}(1-a_1)\prod_{j\ge 2}(1-a_j^{x-1})=(1-a_1)G(a_1,\ldots,a_9)

which leads to an easy resolution by recursion since


and G(a)=a/(1-a)

and a value of 0.5207 returned by R (Monte Carlo evaluation of 0.5207 based on 10⁷ replications). The second question is quite similar, with solution

\sum_{x=2}^\infty a_1^{x-1}(1-a_1)\prod_{j\ge 1}(1-a_j^{x})=a^{-1}(1-a_1)G(a_1,\ldots,a_9)

and value 0.52596 (Monte Carlo evaluation of 0.52581 based on 10⁷ replications).

Gone…! [Ash Monday]

Posted in Books, Kids, pictures, Travel with tags , , , , , , , , , on April 15, 2019 by xi'an

Even stronger and farther-reaching a symbol of Paris than the Eiffel Tower, the Notre-Dame-de-Paris cathedral is now burning down. Only Hugo can make for the memory of this monumental loss:

“Sur la face de cette vieille reine de nos cathédrales, à côté d’une ride on trouve toujours une cicatrice. Tempua edax, homo edacior; ce que je traduirais volontiers ainsi: le temps est aveugle, l’homme est stupide.” Victor Hugo, Notre-Dame-de-Paris, 1831

“Notre-Dame est aujourd’hui déserte, inanimée, morte. On sent qu’il y a quelque chose de disparu. Ce corps immense est vide; c’est un squelette; l’esprit l’a quitté, on en voit la place, et voilà tout.” Victor Hugo, Notre-Dame-de-Paris, 1831

“Tous les yeux s’étaient levés vers le haut de l’église. Ce qu’ils voyaient était extraordinaire. Sur le sommet de la galerie la plus élevée, plus haut que la rosace centrale, il y avait une grande flamme qui montait entre les deux clochers avec des tourbillons d’étincelles, une grande flamme désordonnée et furieuse dont le vent emportait par moments un lambeau dans la fumée. ” Victor Hugo, Notre-Dame-de-Paris, 1831

The spire is gone. The roof is gone. What’s terrible is that it survived the French revolution, which wanted to tear it down, the 1870 siege of Paris by Prussian troops, the Commune de Paris, the 1914-1918 canon bombs from German guns, the 1944 air bombings by Allied planes. (Once again an accidental fire started by maintenance works. As in the Brazilian Museum of Natural History, Windsor Castle, Glasgow, Rennes, &tc.)

ERC panel [step #2]

Posted in Kids, pictures, Statistics, Travel, University life with tags , , , , , , , , , on April 2, 2019 by xi'an

Another post that was written ages ago, about the second round of the European Research Council (ERC) panel on starting grants for mathematics in which I took part as an expert and not as an applicant. While anonymity possibly fell apart for the several dozens of applicants who were shortlisted for interview, in particular more like those few from my own field, the official list of the panel only came out much later. The interviews were quite interesting, obviously, with a strict attention to time and questions to make all interviews as “equal” as possible. And sometimes painful to attend as the candidates were visibly stressed and more over-prepared than not. Which did not necessarily help as the preparation, presumably with the help of local consultants out of maths, had removed some of the enthusiasm behind the project and too much of the maths. I think we all stopped breathing when one applicant broke mid-sentence, as in a theatre play when one actor forgets one’s lines… The rehearsal does not work so well for later questions, even though preparing for these is also essential,  and some upgrading or downgrading may then occur because of a single answer. An unavoidable limitation of the exercise.

Overall I remain impressed by the quality of the collective work of the panel [despite a gruelling schedule on interview days] and of the overall selection of eleven projects, even though it sounds like more theoretical and abstract topics seem privileged, in a bias that seems difficult to counteract. And [not because no statistics proposal was selected this time] making me (and others) wonder whether or not a separate statistics section of the ERC would not be more appropriate, since statistics proposals are not uniquely and solely centred on the maths aspects.

Metropolis gets off the ground

Posted in Books, Kids, Statistics with tags , , , , , , , on April 1, 2019 by xi'an

An X validated discussion that toed-and-froed about an incomprehension of the Metropolis-Hastings algorithm. Which started with a blame of George Casella‘s and Roger Berger’s Statistical Inference (p.254), when the real issue was the inquisitor having difficulties with the notation V ~ f(v), or the notion of random variable [generation], mistaking identically distributed with identical. Even (me) crawling from one iteration to the next did not help at the beginning. Another illustration of the strong tendency on this forum to jettison fundamental prerequisites…

no country for old liars

Posted in Kids, R with tags , , , , , on March 30, 2019 by xi'an

A puzzle from the Riddler about a group of five persons, A,..,E, where all and only people strictly older than L are liars, all making statements about others’ ages:

  1. A: B>20 and D>16
  2. B: C>18 and E<20
  3. C: D<22 and A=19
  4. D: E≠20 and B=20
  5. E: A>21 and C<18

The Riddler is asking for the (integer value of L and the ranges or values of A,…,E. After thinking about this puzzle over a swimming session, I coded the (honest) constraints and their (liar) complements as many binary matrices, limiting the number of values of L to 8 from 0 (15) to 7 (22) and A,…,E to 7 from 1 (16) to 7 (22):

A[2,1:(20-15)]=A[4,1]=0 #A honest
CA[2,(21-15):7]=CA[4,2:7]=0 #A lying
C[1,-(19-15)]=C[4,7]=0 #C honest
CC[1,(19-15)]=CC[4,-7]=0 #C lying

since the term-wise product of these five matrices expresses all the constraints on the years, as e.g.


if A,D≤L and B,C,E>L, and I then looked by uniform draws [with a slight Gibbs flavour] for values of the integers that suited the constraints or their complement, the stopping rule being that the collection of A,…,E,L is producing an ABCDE binary matrix that agrees with all statements modulo the lying statuum of their authors:

for (i in 1:5) yar[i]=sample(1:7,1)
while (min(diag(ABCDE[,yar]))==0){ 
   if (max(ABCDE[idx,])==1) yar[idx]=sample(which(ABCDE[idx,]>0),1)

which always produces L=18,A=19,B=20,C=18,D=16 and E>19 as the unique solution (also reported by The Riddler).

     [,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]    0    0    0    1    0    0    0
[2,]    0    0    0    0    1    0    0
[3,]    0    0    1    0    0    0    0
[4,]    1    0    0    0    0    0    0
[5,]    0    0    0    0    1    1    1

Le Monde puzzle [#1088]

Posted in Books, Kids, R with tags , , , , , , , , on March 29, 2019 by xi'an

A board (Ising!) Le Monde mathematical puzzle in the optimisation mode, again:

On a 7×7 board, what is the maximal number of locations that one can occupy when imposing at least two empty neighbours ?

Which I tried to solve by brute force and simulated annealing (what else?!), first defining a target


on a 9×9 board where I penalise prohibited configuration by a factor 1.2 (a wee bit more than empty nodes). The perimeter of the 9×9 board is filled with ones and never actualised. (In the above convoluted products, the goal is to count how many neighbours of the entries equal to one are also equal to one. More than 2 is penalised.) The simulated annealing move is then updating the 9×9 grid gridz:

for (t in 1:1e3){
  for (v in 1:1e4){
    if (log(runif(1))<temp*(newarg-curarg)){

and calls to the procedure always return 28 entries as the optimum, as in

     [,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]    1    0    1    0    1    0    1
[2,]    0    1    1    0    1    1    0
[3,]    1    1    0    1    0    1    1
[4,]    0    0    1    0    1    0    0
[5,]    1    1    0    1    0    1    1
[6,]    0    1    1    0    1    1    0
[7,]    1    0    1    0    1    0    1

As it happens, I had misread the wording of the original puzzle, which considered a dynamic placement of the units on the board, one at a time with two free neighbours imposed.