Archive for Vietnam

another viral math puzzle

Posted in Books, Kids, R, University life with tags , , , , , , , on May 25, 2015 by xi'an

After the Singapore Maths Olympiad birthday problem that went viral, here is a Vietnamese primary school puzzle that made the frontline in The Guardian. The question is: Fill the empty slots with all integers from 1 to 9 for the equality to hold. In other words, find a,b,c,d,e,f,g,h,i such that

a+13xb:c+d+12xef-11+gxh:i-10=66.

With presumably the operation ordering corresponding to

a+(13xb:c)+d+(12xe)f-11+(gxh:i)-10=66

although this is not specified in the question. Which amounts to

a+(13xb:c)+d+(12xe)f+(gxh:i)=87

and implies that c divides b and i divides gxh. Rather than pursing this analytical quest further, I resorted to R coding, checking by brute force whether or not a given sequence was working.

baoloc=function(ord=sample(1:9)){
if (ord[1]+(13*ord[2]/ord[3])+ord[4]+
12*ord[5]-ord[6]-11+(ord[7]*ord[8]/
ord[9])-10==66) return(ord)}

I then applied this function to all permutations of {1,…,9} [with the help of the perm(combinat) R function] and found the 128 distinct solutions. Including some for which b:c is not an integer. (Not of this obviously gives a hint as to how a 8-year old could solve the puzzle.)

As pointed out in a comment below, using the test == on scalars is a bad idea—once realising some fractions may be other than integers—and I should thus replace the equality with an alternative that bypasses divisions,

baoloc=function(ord=sample(1:9)){
return(((ord[1]+ord[4]+12*ord[5]-ord[6]-87)*
ord[3]*ord[9]+13*ord[2]*ord[9]+
ord[3]*ord[7]*ord[8]==0)*ord)}

leading to the overall R code

sol=NULL
perms=as.matrix(data.frame(permutations(9)),ncol=9,byrow=TRUE)
for (t in 1:factorial(9)){
  a=baoloc(perms[t,])
  if (a[1]>0) sol=rbind(sol,a)}
sol=sol[do.call(order, as.data.frame(sol)),]

and returning the 136 different solutions…

the forever war [book review]

Posted in Books, Kids with tags , , , , , on April 26, 2015 by xi'an

Another book I bought somewhat on a whim, although I cannot remember which one… The latest edition has a preface by John Scalzi, author of Old Man’s War and its sequels, where he acknowledged he would not have written this series, had he previously read The Forever War. Which strikes me as ironical as I found Scalzi’s novels way better. Deeper. And obviously not getting obsolete so immediately! (As an aside, Scalzi is returning to the Old Man’s War universe with a new novel, The End of All Things.)

“…it’s easy to compute your chances of being able to fight it out for ten years. It comes to about two one-thousandths of one percent. Or, to put it another way, get an old-fashioned six-shooter and play Russian Roulette with four of the six chambers loaded. If you can do it ten times in a row without decorating the opposite wall, congratulations! You’re a civilian.”

This may be the main issue with The Forever War. The fact that it sounds so antiquated. And hence makes reading the novel like an exercise in Creative Writing 101, in order to spot how the author was so rooted in the 1970’s that he could not project far enough in the future to make his novel sustainable. The main issue in the suspension of belief required to proceed through the book is the low-tech configuration of Halderman’s future. Even though intergalactic travel is possible via the traditional portals found in almost every sci’-fi’ book, computers are blatantly missing from the picture. And so is artificial intelligence as well. (2001 A space odyssey was made in 1968, right?!) The economics of a forever warring Earth are quite vague and unconvincing. There is no clever tactics in the war against the Taurans. Even the battle scenes are far from exciting. Esp. the parts where they fight with swords and arrows. And the treatment of sexuality has not aged well. So all that remains in favour of the story (and presumably made the success of the book) is the description of the ground soldier’s life which could almost transcribe verbatim to another war and another era. End of the story. (Unsurprisingly, while being the first book picked for the SF MasterworksThe Forever War did not make it into the 2011 series…)

snapshot from my SIOD 2013 talk

Posted in pictures, Statistics, Travel, University life with tags , , , , , on July 11, 2013 by xi'an

Saigon snapshots

Posted in Books, pictures, Running, Travel with tags , , , , , , , , on June 8, 2013 by xi'an

DSC_4994I did not have too much time to explore Saigon and even less Vietnam in the 62 hours I spent there, especially with the course and the conference, but I very much enjoyed the feeling. From riding on the back of  a motorbike in the traffic (thanks to a guest student!) to having pho in a simple restaurant by the side of the street, from watching improbable loads going by on the same motorbikes to wandering in the shops around, to talking with students around the course, my snapshots all came back in the best possible light and I found my stress about food safety, street security, pollution, &tc., very quickly fading away and I wish my suitcase would have arrived in time so that I could have gone jogging in the vicinity of my hotel (rather than using the treadmill in the hotel). DSC_4968I have obviously seen nothing of the countryside and wish I can go back there in the future.

This most kind student also took me to the War Remnants Museum, which is a highly sobering place about the destruction and long-term health consequences of the Vietnam War, in particular the generations of victims of the Agent Orange sprays… Even when accounting for the (mild) propaganda bias. Actually, a few days prior to flying to Vietnam, I had read Bao Ninh’ Sorrow of War, a moving and very grim account of the war and of the after-war from a disillusioned soldier.  (The book was banned in Vietnam for a while. And thus I was unsure I could travel with it…) Continue reading

Saigon river [Sông Sài Gòn]

Posted in pictures, Travel with tags , , , , on June 7, 2013 by xi'an

DSC_4969

Statistics, with interactions

Posted in pictures, Statistics, Travel, University life with tags , , , , , , , on June 6, 2013 by xi'an

Ton Duc Thang University entrance hall, June 5, 2013Due to a tight June schedule (3rd conference in a week!), I only stayed one day at the SIOD 2013 conference in Saigon. (SIOD means Statistics and interaction with other disciplines.) The conference was housed by Ton Duc Thang University, on a very modern campus, and it sounded like the university had drafted a lot of his undergrads to catter to the SIOD participants: similar to the Bayesian conference in India a few months ago, those students would stand at the ready to guide us around the campus and to relay any problem to the organisers. This was very helpful and enjoyable, a plus being that most female students wore the traditional pink costume adopted by the university, but it also made me a wee bit uncomfortable as I do not know how much say those students had in this draft… In particular, most of the students I talked with were from other fields than Statistics. (And definitely not complaining, but being on the opposite very friendly the whole time!) A funny side story is that I got a wake-up call from the conference organisers in the morning as I had missed a welcome ceremony with the president due to oversleeping (itself due to an excess of iced coffee rather than minimal jetlag!). Among the few talks I attended, some French school statistics due to the presence of a large contingent from Toulouse, a talk about zero inflated normal distributions which sounded like missing-at-random normal observations (hence easy to process), and a talk about the point of using Bayes factors in hypothesis testing which essentially if independently provided a second version of my course from the previous day.

DSC_4983Yesterday, I also had a short discussion with Paul Minh who presented a talk on a general regenerative device for MCMC algorithms, using a bound on the target density rather than on the Markov transition in order to achieve easier regeneration. While a neat idea, this method requires the construction of a lower bound that can easily simulated. Furthermore, if the regeneration probability is low, the mixing speed may remain similar to the original MCMC sampler, as the method ressorts to a standard MCMC step on the remaining part of the target density.

Saigon skyline

Posted in pictures, Travel with tags , , on June 5, 2013 by xi'an

DSC_4972