Archive for the Kids Category

Le Monde puzzle [#1000…1025]

Posted in Kids, R with tags , , , , , , on March 28, 2017 by xi'an

Le Monde mathematical puzzle launched a competition to celebrate its 1000th puzzle! A fairly long-term competition as it runs over the 25 coming puzzles (and hence weeks). Starting with puzzle #1001. Here is the 1000th puzzle, not part of the competition:

Alice & Bob spend five (identical) vouchers in five different shops, each time buying the maximum number of items to get close to the voucher value. In these five shops, they buy sofas at 421 euros each, beds at 347 euros each, kitchen appliances at 289 euros each, tables at 251 euros each and bikes at 211 euros each, respectively. Once the buying frenzy is over, they realise that within a single shop, they would have spent exactly four vouchers for the same products. What is the value of a voucher?

Le Monde puzzle [#1001]

Posted in Kids, R with tags , , , , on March 27, 2017 by xi'an

After a long lag (due to my missing the free copies distributed at Paris-Dauphine!), here is a Sudoku-like Le Monde mathematical puzzle:

A grid of size (n,n) holds integer values such that any entry larger than 1 is the sum of one term in the same column and one term in the same row. What is the maximal possible value observed in such a grid when n=3,4?

This can be solved in R by a random exploration of such possible grids in a simulated annealing spirit:

mat=matrix(1,N,N)
goal=1

targ=function(mat){ #check constraints
  d=0
  for (i in (1:(N*N))[mat>1]){
    r=(i-1)%%N+1;c=(i-1)%/%N+1
    d=d+(min(abs(mat[i]-outer(mat[-r,c],mat[r,-c],"+")))>0)} 
  return(d)}

cur=0
for (t in 1:1e6){
  i=sample(1:(N*N),1);prop=mat
  prop[i]=sample(1:(2*goal),1)
  d=targ(prop)
  if (10*log(runif(1))/t<cur-d){ 
      mat=prop;cur=d} 
  if ((d==0)&(max(prop)>goal)){
     goal=max(prop);maxx=prop}}

returning a value of 8 for n=3 and 37 for n=4. However, the method is quite myopic and I tried instead a random filling of the grid, using each time the maximum possible sum for empty cells:

goal=1
for (v in 1:1e6){
  mat=matrix(0,N,N)
  #one 1 per row/col
  for (i in 1:N) mat[i,sample(1:N,1)]=1
  for (i in 1:N) if (max(mat[,i])==0) mat[sample(1:N,1),i]=1
  while (min(mat)==0){
   parm=sample(1:(N*N)) #random order
   for (i in parm[mat[parm]==0]){
    r=(i-1)%%N+1;c=(i-1)%/%N+1
    if ((max(mat[-r,c])>0)&(max(mat[r,-c])>0)){
      mat[i]=max(mat[-r,c])+max(mat[r,-c])
      break()}}}
    if (goal<max(mat)){
    goal=max(mat);maxx=mat}}

which recovered a maximum of 8 for n=3, but reached 48 for n=4. And 211 for n=5, 647 for n=6… For instance, here is the solution for n=4:

[1,]    1    5   11   10
[2,]    2    4    1    5
[3,]   48    2   24    1
[4,]   24    1   22   11

Continue reading

GG Day in Rouen

Posted in Kids, pictures, Statistics, Travel, University life with tags , , , , , , , , , , , , on March 26, 2017 by xi'an

[Notice: This post is fairly “local” in that it is about a long-time friend being celebrated by his university. Nice poster though and an opportunity to stress his essential contributions to the maths department there!]

Next June, I will spend the day in Rouen for a conference celebrating the career and dedication of Gérard Grancher to mathematics and the maths department there. (When I got invited I had not realised I was to give the research talk of the day!) Gérard Granger is a CNRS engineer and a statistician who is indissociable from the maths department in Rouen, where he spent his whole career, now getting quite close to [mandatory] retirement! I am very happy to take part in this celebration as Gérard has always been an essential component of the department there, driving the computer structure, reorganising the library, disseminating the fun of doing maths to high schools around and to the general public, and always a major presence in the department,  whom I met when I started my PhD there (!) Working on the local computers in Pascal and typing my thesis with scientific word (!!)

EU turns 60!

Posted in Kids, pictures with tags , , , , on March 25, 2017 by xi'an

The Hanging Tree

Posted in Books, Kids, Travel with tags , , , , , , , on March 25, 2017 by xi'an

This is the fifth sixth volume of Ben Aaronovitch’s Rivers of London series. Which features PC Peter Grant from the London’s Metropolitan Police specialising in paranormal crime. Joining a line of magicians that was started by Isaac Newton. And with the help of water deities. Although this English magic sleuthing series does not compare with the superlative Jonathan Strange & Mr. Norrell single book, The Hanging Tree remains highly enjoyable, maybe more for its style and vocabulary than for the detective story itself, which does not sound completely coherent (unless I read it too quickly during the wee hours in Banff last week). And does not bring much about this part of London. Still a pleasure to read as the long term pattern of Aaronovitch’s universe slowly unravels and some characters get more substance and depth.

and it only gets worse…

Posted in Kids, pictures, Travel, University life with tags , , , , , , , , on March 23, 2017 by xi'an

“Trump wants us to associate immigrants with criminality. That is the reason behind a weekly published list of immigrant crimes – the first of which was made public on Monday. Singling out the crimes of undocumented immigrants has one objective: to make people view them as deviant, dangerous and fundamentally undesirable. ” The Guardian, March 22, 2017

“`I didn’t want this job. I didn’t seek this job,’ Tillerson told the Independent Journal Review (IJR), in an interview (…) `My wife told me I’m supposed to do this.'” The Guardian, March 22, 2017

“…under the GOP plan, it estimated that 24 million people of all ages would lose coverage over 10 years (…) Trump’s plan, for instance, would cut $5.8 billion from the National Institutes of Health, an 18 percent drop for the $32 billion agency that funds much of the nation’s research into what causes different diseases and what it will take to treat them.” The New York Times, March 5, 2017

truth or truthiness [book review]

Posted in Books, Kids, pictures, Statistics, University life with tags , , , , , , , , , , , , on March 21, 2017 by xi'an

This 2016 book by Howard Wainer has been sitting (!) on my desk for quite a while and it took a long visit to Warwick to find a free spot to quickly read it and write my impressions. The subtitle is, as shown on the picture, “Distinguishing fact from fiction by learning to think like a data scientist”. With all due respect to the book, which illustrates quite pleasantly the dangers of (pseudo-)data mis- or over- (or eve under-)interpretation, and to the author, who has repeatedly emphasised those points in his books and tribunes opinion columns, including those in CHANCE, I do not think the book teaches how to think like a data scientist. In that an arbitrary neophyte reader would not manage to handle a realistic data centric situation without deeper training. But this collection of essays, some of which were tribunes, makes for a nice reading  nonetheless.

I presume that in this post-truth and alternative facts [dark] era, the notion of truthiness is familiar to most readers! It is often based on a misunderstanding or a misappropriation of data leading to dubious and unfounded conclusions. The book runs through dozens of examples (some of them quite short and mostly appealing to common sense) to show how this happens and to some extent how this can be countered. If not avoided as people will always try to bend, willingly or not, the data to their conclusion.

There are several parts and several themes in Truth or Truthiness, with different degrees of depth and novelty. The more involved part is in my opinion the one about causality, with illustrations in educational testing, psychology, and medical trials. (The illustration about fracking and the resulting impact on Oklahoma earthquakes should not be in the book, except that there exist officials publicly denying the facts. The same remark applies to the testing cheat controversy, which would be laughable had not someone ended up the victim!) The section on graphical representation and data communication is less exciting, presumably because it comes after Tufte’s books and message. I also feel the 1854 cholera map of John Snow is somewhat over-exploited, since he only drew the map after the epidemic declined.  The final chapter Don’t Try this at Home is quite anecdotal and at the same time this may the whole point, namely that in mundane questions thinking like a data scientist is feasible and leads to sometimes surprising conclusions!

“In the past a theory could get by on its beauty; in the modern world, a successful theory has to work for a living.” (p.40)

The book reads quite nicely, as a whole and a collection of pieces, from which class and talk illustrations can be borrowed. I like the “learned” tone of it, with plenty of citations and witticisms, some in Latin, Yiddish and even French. (Even though the later is somewhat inaccurate! Si ça avait pu se produire, ça avait dû se produire [p.152] would have sounded more vernacular in my Gallic opinion!) I thus enjoyed unreservedly Truth or Truthiness, for its rich style and critical message, all the more needed in the current times, and far from comparing it with a bag of potato chips as Andrew Gelman did, I would like to stress its classical tone, in the sense of being immersed in a broad and deep culture that seems to be receding fast.