Archive for Singapore

alternative realities for ISBA 2018

Posted in Statistics with tags , , , on July 29, 2017 by xi'an

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…

Dance Dance Dance

Posted in Books, Travel with tags , , , , , , on November 25, 2012 by xi'an

In the (rather nice) bookstore in Changi Aiport, I came across this book by Murakami, “Dance Dance Dance”, and got hooked by the cover catchphrase: “If Raymond Chandler had lived long enough to see Blade Runner, he might have written something like Dance Dance Dance“. And the (UK) cover looked great too. (This was also a good opportunity to get rid of my remaining Aussie coins!)

I am not a major fan of Murakami as I find his stories rather uneven and his semi-fantastic undertone sometimes completely alien: e.g., I loved the short stories in after the quake and Kafka on the Shore was a great novel. On the other hand, the first volume of 1Q84 convinced me not to look any further in the series. This novel alas belongs to the second category of books I do not like so much: for one thing, the catchphrase above is just completely inappropriate! This is not a hard-boiled detective story: there are murders, for sure, but the main character is not hard in any sense and the murders are possibly solved by psychics and ghosts. There is no dark technocratic future à la Blade Runner either, only a lingering past that remains hidden behind the daily normality as an harmless ghost. (I do not know the author of the catchphrase but I hope (s)he gets fired from The Observer) The characters in Dance Dance Dance are caricaturesque, even when they have some real depth, like the main character (whose name is never given), and it is difficult to fathom what his motivations are, as he gets carried like flotsam along the various currents of the novel. There is no conclusion to the story: some characters vanish and the main character finds some (short-term) love achievement with an hotel clerk he has been wooing the whole time. The book is not altogether unpleasant, it is well-written with a kind of counter-pace, however the psychological quandary of the main character is simply too complete to stand!

Singapore sunset

Posted in Kids, pictures, Travel with tags , , , on August 25, 2012 by xi'an

en route to Australia

Posted in Books, Kids, pictures, Travel, University life with tags , , , , , , , on July 10, 2012 by xi'an

Despite the very long flights and the two transfers in Singapore and Brisbane, I found the trip to Australia only moderately tiring! Maybe because I managed to sleep for close to 8 hours on the first leg. Maybe because of the (great) facility of my new and cheap Compaq to keep running for a whole leg of seven hours without exhausting the battery (that I reloaded in Singapore). Maybe because I am finally getting used to twelve hour flights after my round trip to Kyoto last week. Maybe because having five breakfasts (my favourite meal!) in two days is a good enough reward. I even watched a movie, The Hunger Games, in two parts: one half before landing in Singapore and the other half over Bali. It is a terrible movie, with poor acting and even worse scenario. Plus, it has a rather lame ending, since the structure of the Orwellian society where those games take place is not at all perturbed by the actions of the characters since they were manipulated till the very end. However. the lame plot had some interesting game theory implications: in a game where all adversaries have to be eliminated, does it make sense to make temporary alliances? And then I suddenly remembered having read a blog about this, a few months ago!

The only painful part of the trip actually was to travel with two laptops, as I am not trusting the Compaq to stand the whole visit to Australia, nor the newly installed Macbook to be sufficiently stable. (I even took an external hard-drive to make daily security backups and to keep both laptops attuned…) I also wish my daughter had not “borrowed” my Canon point-and-shoot camera as there were particularly nice views when we landed both in Singapore and in Brisbane. Travelling with my (wife’s) Nikon J1 is not exactly as easy (more about this later!). And I do not think I can take it running, although I will obviously give it a try.

I now hope it won’t take me too long to get on Australian time(s) and look very much forward the interactions being an AMSI Lecturer can induce!

quick impressions from Japan

Posted in pictures, Running, Travel with tags , , , , , , , , , on July 9, 2012 by xi'an

Just like last year trip to Shanghai was my first visit to China, this trip to Kyoto was my first time in Japan. I found the experience so exhilarating that I am already considering a trip back next year! (Especially since I could have lost all of my Kyoto pictures with my hard drive!) The mix of tradition and modernity, of history and high-tech, of chaotic architecture and smooth interactions, of rice fields in the shade of high-rises and of houses in the shade of expressways; all those snapshots, caught from the train as much as from the few hours I spent exploring the modern part of the city, are starting to blur already and I feel a need to go beyond to get a broader and deeper perspective on this fascinating country! Continue reading