1

THE OPTIMAL PRACTICE STRATEGY (**NOT CLICKBAIT**)

 1 week ago
source link: https://codeforces.com/blog/entry/129125
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

THE OPTIMAL PRACTICE STRATEGY (**NOT CLICKBAIT**)

By galen_colin, 41 hour(s) ago,

Spoiler: it's clickbait. Sorry. Titles like those are fun.

...but, it's the same style of clickbait as my roadmap [spoiler 2: if you haven't seen that, it markets itself as a standard roadmap (y'know, soulless and devoid of purpose), but then a few minutes in, says "ok but roadmaps are stupid and here's the advice that you really need" and completely changes the direction of the video]. That's my style of clickbait, and that's the vibe this blog goes for.

So... hear me out, please.

The start

First, a couple meta-notes. I will likely exaggerate my tone a bit here for dramatic effect. Don't take it personally, please. Also, this applies to almost all ratings. At the very least, I recommend you process the main point of this blog and see whether or not you already do something similar (for most people... probably not?)

The problem

I'm sure if you've looked at the recent actions tab for more than a few nanoseconds, you've noticed that there are an uncountably infinite amount of blogs asking questions like "what's the best way to practice?" or "what's the optimal way to reach rating X (often red)?", and you've possibly made a few more observations about such blogs:

(1) The people writing these blogs have clearly not tried to answer their own questions

(2) Some people do answer, and they almost always provide zero justification for their answers, saying "source: trust me bro". Some of these answerers are even lower rated than the poster of the blog, which, combined with the previous point, is... suspicious.

(3) Very few people actually follow the advice that is given, even if it's actually good

(4) There's often an enormous amount of emphasis on topic-based learning

...and that doesn't even cover what goes on in DMs. This list is not exhaustive, but it's enough to make a point.

Many people (with an enormous intersection with the people who write such blogs) have a plan like the following for improvement in CP (let's denote this plan as P1): "Let's find the best practice strategy possible (maybe by asking some red or posting a help blog), then implement that for the rest of my life without questioning it" (perhaps worded a bit dramatically). The "without questioning it" part is evident from observation (2) and somewhat from (1), and (3) indicates that people are doing strange things with the information they get — maybe trying to combine everything into some ultimate strategy? I'm not sure, but it doesn't really matter.

I'll say, if you write such a blog asking for help like that, you're asking the wrong questions.

I note: if you actually find the optimal practice strategy, then P1 is not that bad, because you'll be improving at the best possible rate. But there's a bit of an issue with P1. To illustrate what it is, let's look at some of the best existing blogs about improvement/meta stuff on CF (not exhaustive, and in no particular order):

(a) Self-deception: maybe why you're still grey after practicing every day by -is-this-fft- — this blog was genuinely groundbreaking. I'd never seen insight of this caliber on CF before. The role of learning psychology in CP is vastly underappreciated as-is, and this blog was a good look into an incredibly significant factor stopping people from improving.

(b) How to practice Competitive Programming [Um_nik version] by... Um_nik — this is a really good framework for how to look at practice and what it should do for you. The "ask a friend who solved the same problem" is a great solution to the issue of missing out on knowledge from not seeing editorials.

(c) My opinion on how to practice competitive programming by Radewoosh — this blog illustrates a very simple point: if your brain wants to learn something (e.g. because you enjoy it), you'll have a much easier time learning it. I think the blog itself is more anecdotal than formal in illustrating this, but it's still a very important idea I've rarely seen addressed on CF.

These blogs are great. They're fucking amazing. They introduce new ideas to the CF improvement meta and answer a lot of questions people may have. But, the issue: any such blog is finite, but there are infinite possible ways that someone could be practicing wrong.

For example, here's something that none of these address — what if you think about problem-solving wrong? What if you try to solve everything like a school problem (or LeetCode), just throwing the knowledge you have at the problem and hoping it cracks? That doesn't work when a problem requires structural insight or observations (which is most CF problems). If you practice with that problem-solving framework in mind, it doesn't matter how much good practice you do — you'll be training for the wrong thing, and thus be forever doomed to be stuck. There are so many issues like this, where even if you do everything else perfectly, leaving those issues unaddressed will leave you to fail nonetheless (or, at least, seriously drag you down).

In a more general sense, these blogs provide great necessary conditions for having a good practice strategy, but they are far from sufficient, because there are infinite possible things that could be going wrong. There are a lot of blogs and theories and such about how your practice should work. Many of these theories are not wrong. But even if you combine all of the (correct) theories together and somehow manage to absorb all of that information, you still won't be able to find the perfect practice strategy, because it can't possibly cover everything that someone could be doing wrong.

So, here's my first bold (literally) claim — no existing resource is good enough to find a good enough practice strategy for everyone*, simply because there are too many necessary conditions to enumerate like this, and many people are doing certain things wrong that are often too hard or specific to see coming without actually experiencing it yourself (so no such resource would even think to mention it).

* There is maybe one exception I know of, by nor. But I don't think that blog puts nearly enough emphasis on the part I'm about to talk about.

A solution

So, then, what? What's the solution to this? Often people turn to coaching — to have some experienced pair of eyes look into your soul and identify the things you're doing wrong to correct your strategy. There are also some issues with that. First, most coaches don't actually do that, and instead just serve to enhance your own practice. But if your practice is wrong, it doesn't matter how much someone else enhances it, it'll still be wrong.

Another issue is that, it's hard for an external party to even know what questions to ask someone to draw out their issues. Usually, people who do things wrong, do them wrong because they think they're right. So if someone asks "what do you think you're doing wrong?", the wrong things won't even be part of the conversation. You almost have to know what the issues are beforehand to be able to diagnose them... which runs into the same problem as before.

No. There's something better. How about this — you should learn to diagnose your own issues. Here's the thing — nobody has the knowledge of you that you do. Nobody has access to your mind but you. You, and only you, know exactly what's going on in your thoughts.

Whenever someone asks me how to debug, I usually give them something of the form — to look at your code, inspect every line. Ask yourself, "Does this match what my solution idea actually wants it to do?". If your code passes that check, then your code is maybe fine, and the issue may lie in your idea. So then, do the same to your idea — for every piece of your idea (you can use your code to guide this), ask yourself "Does this make sense to be doing? Does it give me correct and necessary information to solve the problem? Does it fit within time/memory/query/etc. constraints? In what ways/cases could this be wrong?".

If your idea passes the check too, then check that your understanding of the problem is correct. If all of that works, then you missed something in that process, so repeat it, but more carefully. Don't mentally "skip" anything — ask about every line, no matter how obviously correct it may be, because... maybe it isn't. The subtlest of bugs show up in quite unexpected places.

Well... I see no reason why you can't apply this process to your practice strategy too. So here's the first real bit of advice: in semi-regular intervals, "debug" your practice strategy. You get a lot of feedback from problems and contests. For each problem you fail to solve or solve too slowly, there are some ideas you missed, or some wrong directions you took, or some knowledge you didn't have, etc.

This feedback often forms patterns — if you repeatedly fail problems due to some knowledge factor, that's a sign that you should brush up on that knowledge. If you miss observations, maybe that's a sign that you give up too early or spend too long dwelling on ideas that don't work. If you fail problems and the editorial often just tells you "lol just be smarter", that's probably a sign that you should work on your creativity or "raw problem-solving" (i.e. spend more time just thinking/spend longer on problems).

This feedback tells you what you should do to optimize your thought process. But it also tells you a lot about how you should practice to address these weaknesses. If you're trying to learn every topic under the sun, but every editorial you see tells you that you missed an observation... isn't that a sign that learning topics is maybe overrated for you (and the same feedback applies for the "solving problems school/LC-style" thing mentioned earlier)?

If you consistently fail binary search problems... isn't that a sign that you should spend more time on binary search? If you consistently don't fail binary search problems... isn't that a sign that your binary search is fine, and you probably don't need to direct much time to it? If you do much better in practice than in contests, isn't that a sign that you need to spend more time getting used to the contest environment/pressure (i.e. do virtuals or more contests)?

I could go on, but doing so would be pointless. The main thing is — you should learn to recognize these signs yourself. And, how? It's exactly like normal practice "should" work — you see that your strategy (either thought process or practice strategy) is failing for some reason, you use the feedback given to you by problems/contests on how your process is failing or the parts that it doesn't cover, and you make theories on why your practice fails and how to do better about it, then you test those theories and see if the feedback you get supports/rejects them. That's the scientific method, and you (probably) won't get anywhere without it!

Obviously, if you're not good at making theories (and you probably won't be at the start), the theories won't be good, and you may even lead yourself in the wrong direction. But, just like problem-solving, the more you practice it, and support or disprove your theories (also using the feedback), the better you'll be at making theories, and the better you'll be at improving your strategy.

Hopefully you can see how powerful this is. Now, instead of having a fixed strategy and thus a fixed rate of improvement, you're constantly trying to improve your strategy, and you're even constantly improving the rate at which you improve your strategy. If you're familiar with calculus, think derivatives. Already, we have cubic growth, instead of linear (which you'd have if you just stuck with one strategy). Magic, isn't it?

But... why even stop at cubic? We can have a polynomial of arbitrarily large degree — you can go so far as to inspect your process of improving your theorycrafting, and get quartic growth, and etc. — though at some point it becomes impractical and unhelpful. Cubic is probably good enough.

But the main point is — you don't have to ask things like "how do I improve" or "what am I doing wrong" if you're capable of answering that for yourself. You don't have to be confused on what to do if you can answer your own questions.

Yet, it's still somewhat useful to have someone look at your practice plan and tell you what's wrong with it. And those legendary blogs I mentioned earlier are still incredibly useful too, because they contribute many unique ideas. But they should be useful for the purpose of improving your theorycrafting, rather than just for statically making your strategy a bit better. Use that feedback as actual feedback, and think about it, and use it to make your improvement (and improvement of your improvement, and etc.) better, rather than just blindly following it. You can use others' knowledge and insights, but like anything else, you have to learn from it and absorb it into your own thought process, rather than just applying it without thinking.

Examples

Let's look at some commonly asked questions and see how this framework can allow you to answer them for yourself (e.g. with the feedback you get from solve attempts). Just thinking about things from the meta-improvement perspective can lead you to some pretty novel philosophy.

1. Something that often shows up is stuff of the form "what topics do I need to know to solve div2C?". Think about what I've said in this blog, and how you could answer that for yourself. Try to answer before reading what I have to say on it.

Answer

2. More generally — "should I practice more on topics or solve randomly?"

Answer

3. Stuff like "what difficulty should I do? How do I choose problems to practice on?"

Answer

4. Another common thing, regarding editorials — "how long to spend per problem?" and/or "how to read editorials?"

Answer

5. More of a freebie — stuff like "Should I see tags/hidden test cases/difficulty/etc. while practicing?"

Answer

There are obviously many more questions. Many of them have answers of similar nature. You should not memorize my answers, you should understand how I reached my answers (they usually directly involve the feedback you get), and understand (i.e. think about) how to find such answers yourself (similar to the points made in question 4). Your end goal is to be able to come up with such answers yourself, so you can effectively critique your own practice.

Essentially, think thoroughly about everything. Then think thoroughly about how you think about everything. Then think thoroughly about how you think about how you think about everything. Then...

I'm willing to answer some more questions from comments, if (and only if) they're good questions, to better illustrate through example what I've spent all this time blabbing about.

Final notes

You could argue that this is a massive dose of overthinking. Most LGMs have probably not formalized their philosophy to this extent. But... people spend a lot of time thinking about this stuff, but they only address the first layer — just trying to find the best strategy rather than looking into how to answer their own questions or why those strategies are actually effective (or not!).

I'm not the first to recommend something like this, but maybe I can be the one to emphasize its power to everyone. It would be easy now, for each "how to improve" post, to merely link this blog and say "you're asking the wrong questions". And the chance that they actually process everything I'm saying is not the best. But it's better than just giving them some aimless advice and leaving them to deal with all their issues that they probably don't even know are issues.

The self-deception blog does raise an interesting point — we're often biased in how we look at ourselves. So how do we critique our practice if we can't even see it properly? I think a general approach for this is to treat learning as objectively as possible. You start out with some random vector of preconceptions of how learning should be done. Many of these will be wrong... of course, because it's random. Your goal is to fine-tune this vector and point everything in the right direction. No attachment to ego, no satisfaction from "knowing what you're doing" (because you almost certainly don't), just objectivity. Then you'll likely be able to see yourself clearly.

That's probably not sufficient to overcome certain biases. I'm not an expert on it, so I don't exactly know how to go about that, but there's almost certainly a way — psychology is a very broad field. But I will say — you should also incorporate the possibility of bias into the theories you make about your practice (or about your theorycrafting), and that will already do a lot for you.

A possible question — is a meta-improvement process like this necessary for good improvement? Did reds discover this by accident (or on purpose)? Is this some (no longer) well-kept secret within the upper echelon of CF?

...conspiracy theories aside, most people who got really good probably do this to some extent — for example, I did. I started on USACO, which (at the time) was much more of a game of "guess the right topic to apply". Then I came to CF thinking that same method would keep working, and I quickly learned, many times I failed to see a solution simply because I didn't think thoroughly enough and missed something. So I adjusted my general strategy using that feedback and converged to the right problem-solving approach from it.

I would call that quadratic growth, maybe — doing some meta theorycrafting about practice, but not to the extent outlined in this blog, and definitely not with as deep an understanding of it as what I have now. I'm sure many others have had some similar thoughts... but I'd love to hear it directly from you, if you have or haven't.

Meta notes

I was going to wait until LGM to make posts like this, to have some extra validation for the theories. But I've still improved a lot recently. If you want some direct validation for these theories... use my virtual rating. And I'm not waiting until LGM anymore because recently, I'm not sure if that will even happen anytime soon, or at all (the exact reason why for that will be apparent in another blog).

So... this blog is not an isolated incident. I plan to do more, and talk about some really deep psychology shit, and dump the "treasures" I've discovered about learning itself into the previously untainted seas of Codeforces, and hopefully start/continue some insightful conversation. I've had very little to do lately (have been quite sick for a while after WF, and doing most other things takes a lot of energy that I don't have at the moment), so this should all come fairly quickly. Look forward to it.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK