luckytoilet's blog

By luckytoilet, history, 4 months ago, In English,

10 minutes remaining in the contest, but you’re still a few points short of advancing. Armed with your mighty coding powers, the first three problems fall quickly, but problem 4 is proving a tough nut to crack. After four incorrect attempts, your time is running short, and you’re searching desperately for an off-by-one error, an edge case you haven’t considered.

You read the problem statement one more time, and at last, you find it. An integer overflow bug. With a wide grin, you fix the bug with a few quick keystrokes. You upload the source code file...

Continued on my blog

 
 
 
 
  • Vote: I like it  
  • +22
  • Vote: I do not like it  

»
4 months ago, # |
  Vote: I like it +14 Vote: I do not like it

One of the best blogs I've ever read!
Just curious, what if you wrote a book in such intriguing way :P?
Wish you everything best in your life!

»
4 months ago, # |
  Vote: I like it +319 Vote: I do not like it

Please forgive me if I am being too harsh, but seriously I've been along with these kind of articles for hundred times and now I think I should say something. Quote from Terry Tao was good (I always liked that article), but I don't think your article is simillar to him.

"Your time is better spent studying machine learning, or statistics, or compilers, or distributed systems, or just about anything else in computer science."

Why machine learning? Why distributed system? Because AlphaGo won some Go battles? Because that's what people are talking in 2016? So, if some cool new fields arise in some years later, you will say "Oh, machine learning is useless now. Let's switch to these blah blah"? If competitive programming goes hot somehow, then you will say "Sorry for being wrong, now let's stop that distributed s**t and register this CF round"?

I believe that studying algorithm have some "timeless" factors, and that's why eventually Google or other large SW companies are wanting competitive programmers even though their brains are packed with useless algorithms. CP is meaningful (definitely far more than "sports") not because they teach you how to range update in O(lgn), it's meaningful because of the logics underlying, and the experience of problem solving. This is very simillar to the reason why we are learning math. Do you think someone studying set theory or etc is doing something useless? Because your friends don't talk about them? And you want to say that "If you got better than A- in set theory class, congrats for wasting your time"?

To add some lines, The one who excels at CP is not the one with fast typing skills, or the one who make lesser off-by-one errors. Even further, it's not the one who know some obscure algorithms (even though I think those who know should be rewarded). Do you think I got 390 in http://stats.ioinformatics.org/results/KOR/2015 because I didn't knew some weird segtree that 600 point scorer knew? No. This circumstances are easily understandable that if you think about the "math". Someone who are good at logical / mathematical thinking will excel at it. (and if they love CP, they will enjoy extra skills such as lesser buggy codes)

On a side note, I agree that CP is really fun and it also have some spirits shared with sports. This is a good thing. I don't know you mean that way in the beginning of the article, but it's silly if you think "CP is fun, so it would probably be useless". I've met a lot of person who think in that way (it's not limited to CP. just those kind of people always think that way)

  • »
    »
    4 months ago, # ^ |
      Vote: I like it -42 Vote: I do not like it

    The difference between competitive programming and other areas of CS (machine learning, distributed systems) is that you can build cool stuff like AlphaGo if you get really good at machine learning, stuff that produces value for other people. The same cannot be said for competitive programming. You mentioned that one who excels at competitive programming is an excellent problem solver. While this is true, your friend who gets A+ in set theory class and goes on to publish research in set theory also has great problem solving skills. Both of you are developing problem solving skills, mathematical thinking, tenacity, etc, but he is doing so while advancing human knowledge while you are solving problems that already have known solutions.

    That being said, I don't think competitive programming is a waste of time -- why do I have a Codeforces account if I think that? It's a great way to improve programming and problem solving skills while having fun. The key word here is fun: if you're feeling frustrated and stressed out about programming competitions, you should take a step back and ask yourself why you're doing this in the first place. Given that competitive programming is not that useful above a certain point, there's absolutely no point in continuing if you're not having fun. That's what my article is about.

    • »
      »
      »
      4 months ago, # ^ |
      Rev. 4   Vote: I like it +33 Vote: I do not like it

      I'm sorry your argument that "The difference between competitive programming and other areas of CS (machine learning, distributed systems) is that you can build cool stuff [...] that produces value for other people" is invalid. AlphaGo and a lot of other things wouldn't have even come to fruition if the PageRank algorithm had not been created. If you look on the wikipedia page you'll see that the basis of it requires knowledge of linear algebra, probability and graph theory (common topics in competitive programming). Your arguments in the blog seem to be influenced by those ever-present comments by non-competitive programmers that insist that competitive programming has no value because it is not software engineering or networking or whatever. Having worked as a software engineer previously I can say that it is largely a mechanical process compared to the type of creative thinking needed to excel in competitive programming, which as koosaga points out, helps to refine one's logical thinking skills, which is a useful (and severely undervalued) trait to have, these days.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      I am curious as to how you can say that competitive programming is not that useful above a certain point, particularly when your claim is that this point is around a rating of 1700? For instance do we say that Petr has wasted way too much time on competitive programming, and that somehow he achieved incredible things at Google in spite of wasting time on contests, or maybe instead part of the reason he has done so well at Google is because of his competitive programming experience? In any case I would find it a bit easier to believe your claims that time is better spent elsewhere if you had achieved a bit more in competitive programming, as is this seems like me stepping on the soccer pitch for the first time, kicking around the ball a few times, and declaring that soccer is a waste of time.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      Both of you are developing problem solving skills, mathematical thinking, tenacity, etc, but he is doing so while advancing human knowledge while you are solving problems that already have known solutions.

      By studying algorithms and data structures you can advance human knowledge too. Finding some undiscovered shortcut for solving TSP, or discovering some new data structure that can handle big data in particular ways can have big practical impacts. I really don't get how you can say that studying math theory can be very useful while studying cs theory is a waste of time...

»
4 months ago, # |
  Vote: I like it +108 Vote: I do not like it

Who cares? Do you play Super Mario because you want to become a Pokemon Master? Just spend time on what you're pursuing. Don't expect anything from the low correlation.

»
4 months ago, # |
  Vote: I like it +6 Vote: I do not like it

When one is not fulfilled oneself, how can he ever add value to someone else's life. Time is always best spent doing what you love. Thinking about usefulness means you care more about the end goal, not the path to that goal. If you don't like the path, its really unlikely that you'll reach that goal anyways.

»
4 months ago, # |
  Vote: I like it +6 Vote: I do not like it

I'd agree with the point regarding fun. Contests obsess people, that's true. People like them, because they can see the results in scoreboard, they get excited and spend more and more time to get higher ranking.

I participated a lot in CTF contests, which are much more practical and broad than algorithmic programming, and nevertheless many security guys, who cannot afford to solve even simple CTF challenges, keep saying these competitions are useless and artificial, and it's better to invest time in research.

The truth is that you should better keep balance in any computer field: do contests for fun and skills and do research and real projects for knowledge and profit.

That being said, just remember the fact, that most of great computer scientists were not competitive programmers, and neither are most of highly qualified software engineers.

Don't underestimate and don't overestimate contests, don't be fanatic about them, luckytoilet is almost right about inflection point, but the concrete value of rating depends on you and the field you're gonna work in.

»
4 months ago, # |
  Vote: I like it +18 Vote: I do not like it

Learning things is not always about the things you learn. It is about the process of learning.

Why do we learn calculus in school when some of us will go to study literature and never use it? Why do we study literature if it doesn't get a job at Google? If something you learn isn't used, it doesn't mean it is a waste of time.

There are two underlying factors which are impossible to overlook.

1: education leads to a development of the mind — not just plain knowledge. Even if you think the content you learn is useless, it is still invaluable to have the experience of learning something like that.

2: something like competitive programming gives people who enjoy it a goal to work towards. They want the achievement of solving a problem, of waiting the last seconds before a contest starts with a notebook ready, of gaining that new colour they wouldn't have imagined. Hard work in competitive programming (or any other area for that matter) shows a person's determination.

This is why Google looks for such people although they are necessarily skilled at engineering. From point one, they have the creativity and bright mind which competitive programming develops due to countless hours of problem solving. From point two, they have a continual desire for improvement which is necessary for success.

This is not to say I never considered that I was wasting my time. But in fact, the introduction to your blog post is the exact reason I stayed — the excitement.

»
4 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Computer science community is expecting a lot from competitive programmers and Marek Cygan is a good example . Take a look at this blog entry

»
4 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Your claim "Due to limitations in automated judging, contest problems are limited to exact, deterministic algorithms that have a single correct answer. This rules out entire classes of randomized and approximate algorithms." is false. Constructive problems that accept many answers are common in Codeforces. There has been randomized algorithms 364D - Ghd and approximation algorithms 576C - Points on Plane in Codeforces. A randomized approximation algorithm appeared in the round 3 of Google Code Jam 2016.

I think that the only limitation in traditional programming contests is that it should be well defined if the answer is correct or not. This rules out a lot of practical problems, but it ensures the fairness of competition. I know that most of the problems are still exact algorithms that have a single correct output, but I hope that "unusual" problems like the Code Jam problem will become more common.

Anyway I agree with you that competitive programming is mostly useless after some point if you want to work as a regular software engineer with no specialization in algorithms.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Randomized and approximation algorithms are hard to analyze in contest time, so those problems sometimes fall into trial and error. I guess that's why they are not common.

»
4 months ago, # |
  Vote: I like it +97 Vote: I do not like it

A little offtopic, but when is a toilet considered to be lucky? My guess would be it is lucky iif it's not used very frequently (otherwise, literally people will s*it on you). What do you think?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I dont think he means that the toilet is itself lucky but rather some specific toilet is his 'lucky' toilet similar to how people have their own 'lucky' pen, 'lucky' watch ,'lucky' clover etc.

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it +24 Vote: I do not like it

    I_love_Retrograd Lol, reading this after reading all the comments above it is extremely funny xD.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    fetishes, bro