**A** truly terrible graph in Le Monde about overweight and obesity in the EU countries (and Switzerland). The circle presentation makes no logical sense. Countries are ordered by 2030 overweight percentages, which implies the order differs for men and women. (With a neat sexist differentiation between male and female figures.) The allocation of the (2010) grey bar to its country is unclear (left or right?). And there is no uncertain associated with the 2030 predictions. There is no message coming out of the graph, like the massive explosion in the obesity and overweight percentages in EU countries. Now, given that the data is available for women and men, ‘Og’s readers should feel free to send me alternative representations!

## Archive for Le Monde

## terrible graph of the day

Posted in Books, Kids, R, Statistics with tags bad graph, EU, Le Monde, obesity, OMS, overweight, prediction on May 12, 2015 by xi'an## Le Monde puzzle [#910]

Posted in Books, Kids, Statistics, University life with tags Le Monde, mathematical puzzle, recursive function on May 8, 2015 by xi'an**A**n game-theoretic Le Monde mathematical puzzle:

A two-person game consists in choosing an integer N and for each player to successively pick a number in {1,…,N} under the constraint that a player cannot pick a number next to a number this player has already picked. Is there a winning strategy for either player and for all values of N?

for which I simply coded a recursive optimal strategy function:

gain=function(mine,yours,none){ fine=none if (length(mine)>0) fine=none[apply(abs(outer(mine,none,"-")), 2,min)>1] if (length(fine)>0){ rwrd=0 for (i in 1:length(fine)) rwrd=max(rwrd,1-gain(yours,c(mine,fine[i]), none[none!=fine[i]])) return(rwrd)} return(0)}

which returned a zero gain, hence no winning strategy for all values of N except 1.

> gain(NULL,NULL,1) [1] 1 > gain(NULL,NULL,1:2) [1] 0 > gain(NULL,NULL,1:3) [1] 0 > gain(NULL,NULL,1:4) [1] 0

Meaning that the starting player is always the loser!

## Le Monde puzzle [#909]

Posted in Books, Kids, R with tags integers, Le Monde, mathematical puzzle on May 1, 2015 by xi'an**A**nother of those “drop-a-digit” Le Monde mathematical puzzle:

Find allintegers n with 3 or 4 digits, no exterior zero digit, and a single interior zero digit, such that removing that zero digit produces a divider of x.

As in puzzle #904, I made use of the digin R function:

digin=function(n){ as.numeric(strsplit(as.character(n),"")[[1]])}

and simply checked all integers up to 10⁶:

plura=divid=NULL for (i in 101:10^6){ dive=rev(digin(i)) if ((min(dive[1],rev(dive)[1])>0)& (sum((dive[-c(1,length(dive))]==0))==1)){ dive=dive[dive>0] dive=sum(dive*10^(0:(length(dive)-1))) if (i==((i%/%dive)*dive)){ plura=c(plura,i) divid=c(divid,dive)}}}

which leads to the output

> plura 1] 105 108 405 2025 6075 10125 30375 50625 70875 > plura/divid [1] 7 6 9 9 9 9 9 9 9

leading to the conclusion there is no solution beyond 70875. (Allowing for more than a single zero within the inner digits sees many more solutions.)

## Le Monde puzzle [#905]

Posted in Books, Kids, R, Statistics, University life with tags Le Monde, mathematical puzzle, R, recursive function on April 1, 2015 by xi'an**A** recursive programming Le Monde mathematical puzzle:

Given n tokens with 10≤n≤25, Alice and Bob play the following game: the first player draws an integer1≤m≤6 at random. This player can then take 1≤r≤min(2m,n) tokens. The next player is then free to take1≤s≤min(2r,n-r) tokens. The player taking the last tokens is the winner. There is a winning strategy for Alice if she starts with m=3 and if Bob starts with m=2. Deduce the value of n.

Although I first wrote a brute force version of the following code, a moderate amount of thinking leads to conclude that the person given n remaining token and an adversary choice of m tokens such that 2m≥n always win by taking the n remaining tokens:

optim=function(n,m){ outcome=(n<2*m+1) if (n>2*m){ for (i in 1:(2*m)) outcome=max(outcome,1-optim(n-i,i)) } return(outcome) }

eliminating solutions which dividers are not solutions themselves:

sol=lowa=plura[plura<100] for (i in 3:6){ sli=plura[(plura>10^(i-1))&(plura<10^i)] ace=sli-10^(i-1)*(sli%/%10^(i-1)) lowa=sli[apply(outer(ace,lowa,FUN="=="), 1,max)==1] lowa=sort(unique(lowa)) sol=c(sol,lowa)}

which leads to the output

> subs=rep(0,16) > for (n in 10:25) subs[n-9]=optim(n,3) > for (n in 10:25) if (subs[n-9]==1) subs[n-9]=1-optim(n,2) > subs [1] 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 > (10:25)[subs==1] [1] 18

Ergo, the number of tokens is 18!

## Le Monde puzzle [#904.5]

Posted in Books, Kids, R, Statistics, University life with tags arithmetics, Le Monde, mathematical puzzle, strsplit() on March 25, 2015 by xi'an**A**bout this #904 arithmetics Le Monde mathematical puzzle:

Find all pluralintegers, namely positiveintegers such that (a) none of their digits is zero and (b) removing their leftmost digit produces a dividing plural integer (with the convention that one digit integers are all plural).

a slight modification in the R code allows for a faster exploration, based on the fact that solutions add one extra digit to solutions with one less digit:

First, I found this function on Stack Overflow to turn an integer into its digits:

pluri=plura=NULL #solutions with two digits for (i in 11:99){ dive=rev(digin(i)[-1]) if (min(dive)>0){ dive=sum(dive*10^(0:(length(dive)-1))) if (i==((i%/%dive)*dive)) pluri=c(pluri,i)}} for (n in 2:6){ #number of digits plura=c(plura,pluri) pluro=NULL for (j in pluri){ for (k in (1:9)*10^n){ x=k+j if (x==(x%/%j)*j) pluro=c(pluro,x)} } pluri=pluro}

which leads to the same output

> sort(plura) [1] 11 12 15 21 22 24 25 31 32 33 35 36 [13] 41 42 44 45 48 51 52 55 61 62 63 64 [25] 65 66 71 72 75 77 81 82 84 85 88 91 [37] 92 93 95 96 99 125 225 312 315 325 375 425 [49] 525 612 615 624 625 675 725 735 825 832 912 [61] 915 925 936 945 975 1125 2125 3125 3375 4125 [70] 5125 5625 [72] 6125 6375 7125 8125 9125 9225 9375 53125 [80] 91125 95625

## Le Monde puzzle [#904]

Posted in Books, Kids, Statistics, University life with tags Le Monde, mathematical puzzle, strsplit() on March 25, 2015 by xi'an**A**n arithmetics Le Monde mathematical puzzle:

Find all pluralintegers, namely positiveintegers such that (a) none of their digits is zero and (b) removing their leftmost digit produces a dividing plural integer (with the convention that one digit integers are all plural).

An easy arithmetic puzzle, with no real need for an R code since it is straightforward to deduce the solutions. Still, to keep up with tradition, here it is!

First, I found this function on Stack Overflow to turn an integer into its digits:

digin=function(n){ as.numeric(strsplit(as.character(n),"")[[1]])}

then I simply checked all integers up to 10⁶:

plura=NULL for (i in 11:10^6){ dive=rev(digin(i)[-1]) if (min(dive)>0){ dive=sum(dive*10^(0:(length(dive)-1))) if (i==((i%/%dive)*dive)) plura=c(plura,i)}}

eliminating solutions which dividers are not solutions themselves:

sol=lowa=plura[plura<100] for (i in 3:6){ sli=plura[(plura>10^(i-1))&(plura<10^i)] ace=sli-10^(i-1)*(sli%/%10^(i-1)) lowa=sli[apply(outer(ace,lowa,FUN="=="), 1,max)==1] lowa=sort(unique(lowa)) sol=c(sol,lowa)}

which leads to the output

> sol [1] 11 12 15 21 22 24 25 31 32 33 35 36 [13] 41 42 44 45 48 51 52 55 61 62 63 64 [25] 65 66 71 72 75 77 81 82 84 85 88 91 [37] 92 93 95 96 99 125 225 312 315 325 375 425 [49] 525 612 615 624 625 675 725 735 825 832 912 [61] 915 925 936 945 975 1125 2125 3125 3375 4125 [70] 5125 5625 [72] 6125 6375 7125 8125 9125 9225 9375 53125 [80] 91125 95625

leading to the conclusion there is no solution beyond 95625.