I’ll be home for Christmas

(Tried playing a histogram. Failed.)

I had a great time tonight performing on piano for our Christmas celebration, playing one of my favorite pieces (I love Sinatra’s version). Played a lot of piano today, mostly messing around during practice on the Tokyo Ghoul theme and some Chinese pop songs I’ve kept on repeat recently.

December came without me knowing it: I was walking back from the great hall when I realized it was past midnight. It felt strange simply because I’ve been looking forward to this, and for it to creep past quietly under my radar made me rather happy. I’ve been trying to keep my mind off the agonizing wait, and spending time working with people I love has really helped.

Here’s Diamond’s sweet backdrop from Bangsawan last night.

Here’s wishing all of us a satisfying end to the year!

Posted in School | Tagged , , | Leave a comment

Five Pirates

I find combinatorial game problems really fun, especially Russian problems, but many of my favorites (all involving wizards, for some reason) take some degree of math background to understand.

Still, one night at the IOI in Kazakhstan, Chris gave us this puzzle I hadn’t heard of before. It’s quite simple, but my intuition was initially wrong. Give it a try!

5 pirates of different ages have a treasure of 100 gold coins.

On their ship, they decide to split the coins using this scheme:

The oldest pirate proposes how to share the coins, and ALL pirates (including the oldest) vote for or against it.

If 50% or more of the pirates vote for it, then the coins will be shared that way. Otherwise, the pirate proposing the scheme will be thrown overboard, and the process is repeated with the pirates that remain.

As pirates tend to be a bloodthirsty bunch, if a pirate would get the same number of coins if he voted for or against a proposal, he will vote against so that the pirate who proposed the plan will be thrown overboard.

Assuming that all 5 pirates are intelligent, rational, greedy, and do not wish to die, (and are rather good at math for pirates) what will happen?

(puzzle copied from here)

I’m still up looking through photos from Kazakhstan. Missing all of you tonight!


Halfway up the mountains at Almaty. Photo taken by Mr Mark.

Posted in IOI 2015, Math | Tagged , , | Leave a comment


I’m finding it very difficult to accurately explain what I’m feeling this month – whenever I attempt to enunciate this emotional blur I still can’t fathom, I can’t quite keep up with the fluctuation. Like that time I tried to count the number of koi in that pond a while ago…it’s a swirl of anticipation, worry, excitement, hope and gratefulness all congealed together. I’m genuinely happy and scared at the same time. Super vague, I know, but bear with me for a while, a few more weeks, maybe!

In the past few months lots of potentially Important and Life-Changing things have come and passed, but here are some little things that have moved me recently.

Midnight mamak last weekend in KL, where we held a workshop at an engineering fair

Midnight mamak last weekend in KL, where we held a workshop at an engineering fair


Catching up




Teaching/posing at our Python workshop at KLESF last weekend


Experiment time, or “punching white fluid turns it into white solid?”

Plus many pages’ worth of silly photos with my friends and family which don’t belong here! :)

Posted in Updates | Tagged , , | Leave a comment

Day 1: The beginning

27.7.15: Practice session and opening ceremony

We wake up early in the morning to realize that we have over an hour before our guide comes to pick us up for breakfast. While trying to contact Allan, we engage in various activities, some of which involved the playground:


Breakfast involved some excellent milk, cakes and pastries. After that, we walked to the eventual contest hall, the Al-Farabi library, for the practice session. While playing cards, I inform the team about the IOI push-up challenge: pick a constant c, and for every point you fail to get at the IOI, you have to do c push-ups. I pick c = 0.2.


At the contest hall, we settle into our seats and take a look around. To our left sits Macau, to our right, Moldova, and others in the vicinity include France and Germany. The screen was locked on a cover page showing our details.


Someone in the contest hall counts down the seconds to the start of the practice session, and I get a glimpse of the tension that would be present tomorrow during Day 1. For now, I test out the keyboard, mouse and configure my system. I decide that the laptop keyboard is better, and I unplug the external one. The mouse works reasonably, so I won’t have to use my own. Then, I pull up Terminal and gEdit, and start to code out solutions to the practice tasks.

Although I had some time to think about them on the plane, I still only had partial solutions to divide and graph for 50 points each. Search was just trivial binary search. I code out all 3 solutions and submit, and they perform as expected. A small commotion at the entrance distracts me, and I notice that the leaders have arrived. Shien Jin and Mark come to my station a while later to make sure that my system is working fine.


After they leave, I suddenly solve Graph. It was pretty simple after all: run a BFS initially to find a path P from S to T. Then run a DFS from each vertex in P in turn to record, for each node v, the first vertex u in P such that there is a path from u to v. Then flip P working backwards, keeping a count of the first vertex of P that reaches each vertex of P, which is sufficient to find all points that disconnects S and T.

After the practice session, we head for lunch, then to the opening ceremony at the Palace of Students. This was the first time I had ever arrived early to an opening ceremony: so early, in fact, that we were waved away by a petulant man at the entrance, so we seek shelter under some trees to wait. This was the venue:


The opening ceremony was, in my opinion, bizarre. The performances were strange, including one where two dancers accompanied a man carrying just an unplugged guitar, synced to electronic music. Unlike the IMO, the IOI opening ceremonies just have the teams stand up in the hall instead of parading on the stage, which made for a speedy ceremony. It ended with the raising of the IOI flag, which failed on its first attempt. It was eventually raised, and the ceremony pronounced over.


Outside the hall, we started playing cards. A few Kazakh locals approached us and asked us where we were from, showed us a card trick, and then taught us how to play Durak (‘idiot’ in Russian), a card game widely played in Kazakhstan. Because they weren’t very proficient in English, this took some time, but we eventually got it. We would then play lots of this game over the week.

We then headed to an early dinner, before going back to the hostel for quarantine. This was when the leaders and deputies were translating the tasks for Contest Day 1 tomorrow, so wi-fi access was cut off on our side. We played cards and chatted, and went to bed at 10, all a little nervous for the contest the next day.

Posted in IOI 2015 | Tagged , | Leave a comment

Day 0: Departures and arrivals

26.7.15: Flight to Almaty

At 3am, I dragged myself out of bed, gathered the final remaining things scattered around my room (toothbrush, retainer, laptop, phone, chargers), checked that my passport and wallet were with me, and set off for KLIA at 4am. Despite having to work at 9am, my father drove me straight to the airport, a 2.5 hours drive either way, while I slept snugly in the passenger seat.

I arrived at the airport, texted the group, and found out that Jen Khai was already there. I met up with him at a gate nearby, and said goodbye to my father. After a brief conversation, I suddenly remembered that I hadn’t yet had breakfast, so we head off to McDonald’s for a bite. After I get my food, Chris and Jia Jen arrive, and the team was thus assembled!

At 8am we meet up with Shien Jin and head to the counter for check-in. To our surprise, it was still not open, even though the flight was schedule to depart at 10:55 and it was already less than 3 hours before that happened. After some jokes about how this would be a precursor for Kazakhstan, we went to a dim sum place nearby for breakfast with Shien Jin’s parents, where the four of us spent the next hour trying to convince them that we’d already had breakfast and wouldn’t need much more food.

At 9am, we meet Mark and try the check-in counter again, and get our boarding passes. We were extremely disappointed that we didn’t get adjacent seats. :(


At the security checkpoint we took a group photo.


We made our way to the gate and note that the plane was pretty small.


Half an hour into the flight, Jen Khai comes over and tells me that there’s a vacant seat next to him, after which I promptly move. The flight to Almaty from Kuala Lumpur took 8 hours, but since it was a daytime flight, we didn’t get much sleep. Instead, we worked on the IOI practice tasks (divide and graph), discussed some IOI problems from 2014, watched a Russian movie, and looked at the pretty terrain as we flew past them.


When we arrived, we breezed through customs because Malaysia was (surprisingly) one of just ten countries for which a travel visa was waived! At the baggage carousel, we saw some other teams, but only knew the Singaporeans. Outside, we met a few other teams, Taiwan and Hong Kong, while waiting for the bus to depart.

Upon arrival at Al-Farabi Kazakh National University, our host for the week, we were very impressed by the playground facing the dormitories. Apparently, see-saws and slides are of some use to university students. We checked into our rooms, and then headed off for dinner. Here’s a view from our room:


Here was our first taste of Kazakh food. We had an interesting dinner trying to figure out what we were putting in our mouths, because this was also when we realized that there was a pretty substantial language barrier between us and the food servers. For instance, we didn’t know whether the meatloaf thing was chicken, beef, or…horsemeat? In any case, the food was better than I expected, and the same was true for the rest of the meals throughout the week. It was good.


During dinner, we were asked by multiple people about our guide, which we hadn’t met yet. This spurred a few industrious, official-looking people to go around trying to get us a guide, while trying to tell us to stay in the dining hall, which wasn’t a problem since we were still eating. After a while, we meet Allan, our guide for the week. Allan asks us if we want to go and dance, but we decide to return to our rooms. We then register and get our goodies:


When we first saw our rooms in the afternoon, we lamented the lack of air-conditioning and fans, but thought it would be OK because the weather was supposedly very cold at night. As it turns out, 20+ degrees Celcius isn’t actually very cold, and we go to bed in shorts and tees, sweating a little as our first day in Almaty drew to a close.

Posted in IOI 2015 | Tagged , | Leave a comment

(Kafka) on the Shore

If you remember me, then I don’t care if everyone else forgets.

I recently read Murakami’s Kafka on the Shore. I followed the precocious Kafka Tamura and his alter ego as he navigated life through the lens of a fifteen-year-old, running away from home only to have this distorted reality bring it along with him. Split into odd/even chapters, we also meet cat whisperer Nakata, dumb and useless, swept by the undercurrents of the same reality that he doesn’t yet understand.

Reading it gave me the reminiscent feeling I got when I first read Franz Kafka’s Metamorphosis. I remember first feeling bewildered as I read the final sentences of what still is a hallucinatory and creepy tale. I’m not sure what Kafka intended to convey through Gregor’s transformation and his eventual struggles, but it is evident from the first sentence (“he woke up and…found himself transformed into a horrible vermin”) and Gregor’s immediate acceptance of his fate that the story takes place in a different reality from the one we live in. The unsettling part of the tale lies in the otherwise utterly normal setting of the story: nothing else seems to be out of place.

Similarly, Murakami’s stories (though I have only read one other work of his, 1Q84) seem to take place in the regular world, but sparsely littered with unusual happenings. Nakata goes searching for a cat and ends up in a house with a man called Johnnie Walker, who eats hearts and forces Nakata to kill him. Fish and leeches rain from the sky. Kafka’s metaphysical romance with Miss Saeki. Perhaps it was the pace at which Murakami sets these events apart, but I found it difficult to constantly remind myself that Kafka’s world is different from ours.

For this reason, Kafka on the Shore was incredibly engaging for me. I’m not sure exactly why, but as we grow up, we seem to lose some of our ability to ask fundamental questions about the world we live in. Growing up, I loved Enid Blyton’s illogical realms of magic, talking trees, and other shenanigans precisely because so many of them stem from taking a normal property of the normal world and asking, “what if it wasn’t so?” I still remember such tales as the topsy-turvy town, the flying cottage, among others. Back then, it was so easy and delightful to accept the existence of such places, but now, I’m not sure if my imagination would still be as permissive to lead me to believe in such tales.

Although we still continue to enjoy stories about the Avengers, Thor, and the rest of the superheroes, do we still believe in them? I’m not sure. When I watch a movie and notice an illogical twist, I’m not sure if I can still believe it once it registers in my mind. Still, it feels that Murakami’s whimsical universe is more of a challenge than these usual tales of superhuman strength and wisdom. I constantly kept asking, “Colonel Sanders? Johnnie Walker? What?” Nakata’s conversations with cats are also strangely civil, seemingly taking place without them realizing the strangeness of it all.

Yet as the book progressed, I gradually eased into the psyche of this peculiar world. Our wide array of characters each have their own troubles: Kafka’s physical and psychological attempt to escape a prophecy he already believes is true, Miss Saeki’s disconnected existence after the pain of losing her only love, even Nakata’s innocence as he leads his life led by something he doesn’t yet know, “but will know when he sees it”. Without much fanfare, there is this huge undercurrent pushing the story along that lends a sense of urgency to their adventures – even when Kafka spends an entire week alone in the forest.

Miss Saeki’s request for Nakata to burn her memoirs draws the tale to an end, and she dies knowing that her memories are safe with Kafka. At the end of the book, I felt like I’ve been on a journey and that I now understood something. I don’t know exactly where I’ve been to and what I know now. Yet perhaps this isn’t very different from what I felt from all those tales of fantasy I read as a kid. What did I learn from them, other than to question and accept?

Posted in Writing | Leave a comment

The time I accidentally wrote the official solution

(Copied from Facebook. Remembered this fun story while taking a break from the past paper madness…)

In IMO final training last year we worked on this geometry problem, which seemed strangely familiar. After I found the solution I remembered that I’d solved it before on AoPS – Turkey’s problem 6 from 2012.

We then read the official solution from the booklet – hey, I used the same method! They even used Brokard’s theorem like I did. Wait…

Turns out, they printed the exact solution I posted on AoPS two years ago. :P


I like this problem – the idea is similar to the geometry problem I wrote for the Junior Olympiad in 2013. Here it is, Turkey NMO 2012, Problem 6:

Let $B$ and $D$ be points on segments $[AE]$ and $[AF]$ respectively. Excircles of triangles $ABF$ and $ADE$ touching sides $BF$ and$DE$ is the same, and its center is $I$. $BF$ and $DE$ intersects at $C$. Let $P_1, P_2, P_3, P_4, Q_1, Q_2, Q_3, Q_4$ be the circumcenters of triangles $IAB, IBC, ICD, IDA, IAE, IEC, ICF, IFA$ respectively.

a) Show that points $P_1, P_2, P_3, P_4$ concylic and points $Q_1, Q_2, Q_3, Q_4$ concylic.
b) Denote centers of these circles as $O_1$ and $O_2$. Prove that $O_1, O_2$ and $I$ are collinear.

Posted in Stories | Tagged , | Leave a comment