Archive for December, 2011

Pinnacle cidre de glace/icecider

Posted in pictures, Travel, Wines with tags , , , , , on December 31, 2011 by xi'an

Le Monde on E. Wegman

Posted in Statistics with tags , , , , , , on December 31, 2011 by xi'an

In addition to the solution to the wrong problem, Le Monde of last weekend also dedicated a full page of its Science leaflet to the coverage of Michael Mann’s hockey curve of temperature increase and the hard time he has been given by climato-skeptics since its publication in 1998… The page includes an insert on Ed Wegman’s 2006 [infamous] report for the U.S. Congress, amply documented on Andrew’s blog. And mentions the May 2011 editorial of Nature on the plagiarism investigation. (I reproduce it above as it is not available on the Le Monde website.)

Mom on a tablet!

Posted in Kids, pictures with tags , , , , on December 30, 2011 by xi'an

This X’mas, we decided to connect my mother to the Internet, as she was getting increasingly bothered by various local and national administrations for not filling forms on-line and for preferring agent-based to web-based support… She was also complaining of not seeing our family pictures any longer, except when we were sending her a USB key for her digital photo frame. So we got an Internet connection package from the local provider, along with a Samsung tablet that was offered as part of the package. Terrific! The connection started working almost instantly, using the tablet proved very manageable for my mother who had never touched a computer before (and who cannot handle the DVD player on her own!), and she sent the first email of her life! As well as looked on google map for a restaurant on a local beach town for the first time! (Sadly most restaurants were closed for the winter… We still managed to have a superb shellfish lunch in Ouistreham, near the ferry harbour.) I think this was a better solution than providing my mother with a computer, since she will only use the browsing, Skyping, and emailing facilities of the machine, relying on USB keys to download photographs. A few hours after starting the whole process, I am still amazed at how easily she got into the thing.

Magical Mathematics [and the converse]

Posted in Books, Kids, Mountains, Travel, University life with tags , , , , , , , , , on December 29, 2011 by xi'an

The two of us have been mixing entertainment with mathematics for most of our lives.” (page xi)

When I learned that Persi Diaconis and Ron Graham had co-authored a book on the mathematics of magic, the Book Editor of CHANCE immediately asked Princeton University Press for a copy! Even though I am not at all interested in card tricks. Nor in juggling. (The title is a wee confusing to [a non-native speaker like] me as it sounds as focussing on the magics of mathematics rather than the converse.)

Once the book had arrived, I showed the book to my wife and she started reading it right away, going over the first chapter prior to giving it back. Later, on a plane trip between Phoenix and Minneapolis, I happened to sit next to a professional magician, The Amazing Hondo!, who started chatting with me and telling me about his work and some of his tricks. He knew about Persi as a magician but was surprised he was equally famous among mathematicians. Hondo showed me a few (impressive) sleights of hand and explained a nice mathematical trick (based on creating apparent randomness while always extracting the same number of cards from the pile). As I happened to have the book with me, he took a look at it, commenting on one trick, and wrote down the reference. I have had a few other occurrences of how the book attracted the attention of non-magicians and/or non-mathematicians: this illustrates the appeal of the concept of this book for a very wide audience and, of course, once one starts reading the book, the attaction is increased manyfold. It is indeed a very entertaining book, with a fairly easy mathematical level, and it is also a beautiful product, with wide margins, fancy (but readable) fonts, photographs, and graphs or tables in the margins.

Both of our worlds have a dense social structure: thousands of players turning ideas over and over.” (page xi)

The entertaining and cosy style of Mathematical Magics (oops, Magical Mathematics!) does not mean it is an easy read. First, conceptualising the card manipulations requires a good analytic mind if one does not have a deck of cards available. Second, the connections with mathematics involve several subfields and not only combinatorics. Like de Bruijn sequences and graphs, the Mandelbrot set, Penrose tiling. And even Bayesian analysis for reversible Markov chains (p.42) and the I Ching… The last chapters are however less directly related to maths (even though Chapter 10 about great mathematical magicians includes connections with topology).

Interestingly (for us academics), the book mentions a (Banff) BIRS 2004 workshop relating to magics via de Bruijn sequences and Gray codes. With the traditional picture in front of the (old) BIRS building. (Another item of information, IBM stands for International Brotherhood of Magicians!)

We hope that our book will shine a friendly light on the corners of the world that are our homes.” (page xii)

One of the complaints I share with my wife about Magical Mathematics is that some of the tricks are not explained in full enough detail. At least for some non-native speakers like us. For instance, during my skiing break in the Alps, Paul my nephew and I tried the Gilbreath principle and could not make it work without forcing the perfect riffle-shuffle one card at a time. The sentence “the shuffle doesn’t have to be carefully done” (p.63) set us on the wrong track. On pages 106 and 107, two 1500’s books in French are quoted with one typo (sont versus font, but at the time s and f were typed quite similarly), a missing s in Inventions, and without the accents:  I wonder whether or not accents existed at the time. (It seems they did not, as seen on the originals here and there.) The comment on Heeffer’s 1624 (French) book is confusing [to me] in that Heeffer is a current math historian working on a 1624 book by Jean Leurechon. (The accents are not there in the 1624 edition.)

Overall, this is a wonderful book, potentialy enjoyable by a large range of individuals. (Precision: I read half of it flying over the beauty of sunsetted Greenland and the other half in a chalet next to the ski slopes. So I was in a mellow spirit!) The order behind the apparent randomness of card tricks becomes clearer and clearer to the naïve reader like me.And the warmth and communal spirit of the magician community transpires through the last chapters. (Note there is a $1000 reward posted within the book!)

art brut

Posted in Mountains, pictures, Travel with tags , , on December 28, 2011 by xi'an

Pluss[ki]es and minuss[ki]es

Posted in Kids, Mountains, pictures, Travel with tags , , , on December 27, 2011 by xi'an

Among the plus[ki]ses of our traditional skiing trip this year, the great company of both extended family and my daughter’s friend,  Julia, some days of superbly warm and sunny weather, skiing black diamonds with my daughter, loads of snow, the reward of the white ridges encasing the valley, my wife’s zen approach to skiing, glimpses of La Meije in good weather, great water, bread and cheese, very few people on the runs, with hardly any short-skier, no queues, a terrific first home-made X’mas dinner (thanks to Jean-Michel et François for their contributions!), rekindling skiing feelings from Park City [after a few days], watching my nephew Paul learning to ski in his analytical way, starting a new book purchased in Provo and unexpectedly mixing fantasy and climbing, playing chess with Paul on evenings and narrowly reaching a stalemate once, a record-time for putting the chains on my car (as opposed to last year!), reading the end of Persi’s book in an Alpine chalet, …

Among the minus[ki]ses, the choice of a terrible rental apartment company and of a mediocre hotel, facing frozen water in one apartment, leading to over-heated apartments the rest of the stay, first days of grey and white weather, straining my thumb in a mound of powdery snow the day before last, loosing any feeling of what’s horizontal and what’s not and falling in a hole as a result [with non-lasting effects!], taking the wrong advice from the instructor during a short course and loosening my ski shoes too much for the first days, watching an appalling movie on the final night about a blogging cashier, my wife’s zen approach to skiing, getting my new book stolen by my son, having to change apartments three times in 8 days,  the wifi at the apartment being incompatible with wordpress,  a not-so-terrific second X’mas dinner at the hotel, wasting 15mn taking my chains off, the final traffic-jam when reaching Paris, …

Le Monde puzzle [#754]

Posted in Mountains, R, Statistics, University life with tags on December 26, 2011 by xi'an

The pre-X’mas puzzle in Le Monde weekend edition is about “magical numbers” having as digits all digits between 0 and n (at least once) and being multiple of all digits between 1 and (n+1). Easy, isn’t it?! I thought so while driving down to the Alps on Saturday and (on Monday early morning) I tried a brute force solution

magi=function(n){
prdct=prod(1:(n+1))

for (t in 1:10^6){
num=sum(sample(0:n)*10^(0:n))
if (num==prdct*trunc(num/prdct)){
print(num)
break()}
}
}

which worked for n=2,3, but failed for n=4. Maybe too brute-force? So I imposed the basic divisibility by 2×5=10 from the start, namely the last digit had to be 0:

magi=function(n){
 prdct=prod(1:(n+1))
 if (n>3){
 for (t in 1:10^6){
 num=sum(sample(0:n)*10^(0:n))
 if (num==prdct*trunc(num/prdct)){
 print(num)
 break()}
 }
 }else{
 for (t in 1:10^6){
 num=10*sum(sample(1:n)*10^(0:(n-1)))
 if (num==prdct*trunc(num/prdct)){
 print(num)
 break()}
 }
 }
 }

Still did not work for n=4… Actually, there was a mistake in prdct in both of the above, in that the solution number only needs to be divided by the largest powers to the prime numbers between 2 and n+1, as implemented below.

I thought a wee more on the conditions and realised that any random permutation of the digits {1,…,4} could not be divided by 3, since their sum is 10. Therefore, the solution for n=4 must have at least 6 digits. This led me to a more general R function which works for the cases n=4,5,6 and has a second parameter, k, namely the number of digits in the proposed solution. It also includes imposing a correct second digit based on the divisibility by 4:

magi456=function(n,k){

proo=3*4*5*(1+6*(n==6)) #only required divisors
digi=10^(0:(k+1))
sol=rep(9,k+2)*digi
for (t in 1:10^6){

a0=0 #multiple of 2*5
a1=sample(2*(1:trunc(n/2)),1) #multiple of 4
b=sample((1:n)[-a1]) #all other integers
b=sample(c(b,sample(0:n,(k-n+1),rep=TRUE)))
a=sum(c(a0,a1,b)*digi)
if (a%%proo==0){
sol=a
print(a)
break()
}

}

return(sol)
}

A similar solution can be proposed for the cases n=7,8,9, with a different constraint on the three first digits due to the divisibility by 8. There again is a special case when n=7, since the sum of all integers from 1 to 7 is 28, not divisible by 3. On the other hand, the sum of all integers from 1 to 8 is 36 and the sum of all integers from 1 to 9 is 45, both divisible by 9. Here is the corresponding R code:

magi789=function(n,k){

proo=(1+2*(n==7))*5*7*8*(1+8*(n>7)) #only required divisors
 digi=10^(0:(k+1))
 sol=rep(9,k+2)*digi

for (t in 1:10^6){
 a0=0 #multiple of 2*5
 #multiple of 8 (4, 2)
 a1=sample(2*(1:trunc(n/2)),1)
 a2=sample((1:n)[-a1],1)
 while ((a1+2*a2)%%4!=0){
 a1=sample(2*(1:trunc(n/2)),1)
 a2=sample((1:n)[-a1],1)
 }
 b=sample((1:n)[-c(a1,a2)]) #all other integers
 b=sample(c(b,sample(0:n,(k-n+1),rep=TRUE)))
 a=sum(c(a0,a1,a2,b)*digi)
 if (a%%proo==0){
 sol=a
 print(a)
 break()
 }

}

return(sol)
 }

Le Monde was furthermore asking for the smallest solution for each n. I ran the R code a few thousand times for every n and obtained

 > magi456(4,4)
 122340
 > magi456(5,4)
 123540
 > magi456(6,5)
 1235640
 > magi789(7,7)
 122437560
 > magi789(8,7)
 123487560
 > magi789(9,8)
 1234759680

Of course, these are upper bounds on the smallest solutions (and there are more clever ways of R coding the above as well as of solving the puzzle in a mathematical way). Being away till Tuesday, I will not check the solution till then…

Follow

Get every new post delivered to your Inbox.

Join 652 other followers