Wednesday, February 20, 2019

Project Euler - level 10

Project Euler (PE) is a popular online math and coding challenge site. Compared to other CS-style coding-oriented sites such as HackerRank or LeetCode, PE problems heavily involve mathematics like number theory and geometry. PE problems are 'hard' in the sense that finding the governing math equations is not the end of the game. It typically asks you to count the number of integer solutions of the equation, which involves additional layer of number theory skills. One can brute force count, but it will take millions of years. Anyway, lying at the intersection of math and coding and math with comparable proportion, this site was exactly for me.

I started solving PE problems back in April 2018 for Python coding practice. The problems were easy at the beginning. I could solve more than 10 problems a day. But the problems became progressively difficult to solve. Instead of being distracted, I was the more fascinated by the challenge. Soon I was completely captivated by thinking of the solutions literally all day long. I was solving the problems while driving, taking showers, in the bed, in the bathroom; essentially whenever I could. I even completely stopped listening to podcasts while commute driving just to solve PE problems.

In the mean time I ran into an interesting article in Quora, questioning 'who are the people who solve 200+ PE problems?'. It had responses from people who actually solved over 200 problems, one of whom was contacted by and worked in Google. What a stimulus. Another reply claimed solving 200 problems in 4 months. I set the same milestone as my goal.

In the end, I passed the finish line in 115 days, a bit short of 4 months (progress summarized in GitHub repository). Note that I wasn't as committed before I set my goal. There were a few days in which I haven't tried any problems. Therefore I must have spent significantly less than 115 days in reaching 200. Due to the increasing difficulty, I had to reduce sleep to spare more time on the problems. I am proud that I solved all 200 problems without discussing with anyone else nevertheless.

I kept solving PE problems since, although at much slower pace after 200. And just yesterday I reached level 10 by solving another 50 problems in about 6 months. Roughly 2 problems per week. Only 1153 people in the world reached level 10 in the last ~17 years, out of ~880k registered users. Definitely a token of achievement, for tenacity and persistence.


After solving 60~70 problems I started saving my Python code. Furthermore, after solving ~100 problems, I have recorded the entire thought process including key insights and the points where I was stuck or made mistakes, along with pictures of handwritten paper notes. I don't publicly share any of them in accordance with PE policy. Contact me personally if I can be of help.

I will keep moving forward. Let's see how far I can go.

Philips SAECO Xsmall espresso machine repaired

I have a SAECO Xsmall espresso machine. I bought it in Dec 2014, and brewed 2~3 cups of espresso per day on the average over the last 6 year...