Have you ever wondered what are top performers doing better apart from just putting hours and solving problems??
Read this whole and you might just get a new perspective on what can “Practice” really bring to you… or how should you target to do a really efficient one. A little on Pedagogy side, but I hope it will be an interesting read.
I am very happy to get more suggestions, as these are personal learnings that I have noticed in the last 4 years of actively teaching others Competitive programming, DSA, and working on pedagogy and gamification aspects of trainings.
Well, Lets start with a hard fact
Solving problems beyond a certain level actually requires you to have at-least these 2 things:
1. A decent IQ and Maths Skills. 2. Good “Practice” with an intent to abstract.
Let me explain you what these 2 mean, from best of my knowledge. I will focus more on the second one though…
Have a decent IQ and Maths Skills.
Ofcourse till a certain level, it’s just about “practice” and knowing coding language (Implementation Skills), but as you start growing beyond say 1800-2000 rating level, its starts sharply hitting you.
You need Good IQ and Maths skills to be really at the the top. Strong Knowledge of Counting, Number theory, Geometry, Probability, Linear algebra starts getting asked in problems and you always need some Good IQ to start generating good observations and connecting the dots to things you might have learned in the “Practice”.
Well this blog is not on this point, so I will keep it till this and not digress much. After all, your time is precious! So keep reading.
Intense “Practice” with an intent to abstract.
Ok, I agree that it’s a sentence with a lot of buzzword-y terms, but it all will make sense soon.
So you practice to improve right?
Try to seek answers for these yourself:
- How do you select questions that you are going to practice?
- What are some objective takeaways from any problem that you look for? Or are you just trying to memorise the solution of that exact problem?
- How do you ensure that you learn and retain maximum from a problem?
Have you ever thought about these or it has been just been random problem solving by putting your heads down. Well unless you have a trainer who is doing all this for you, you should really be investing some time in it.
Also, I don’t think pedagogy ever has been taken seriously in a field like CP. It has mostly been people who are subconsciously doing these and are improving and rest are finding it difficult.
So what’s the solution Vivek ???
I am no expert on the same, but over years what I have realised is what learners are picking up from practice can be classified into one of these 4 Categories.
Before I explain them, quick question. Have you ever played MMORPG / RPG Game? (I expect all of you to say Yes… expecting all of you to be geeky gamers like me in old days :P)
Back in my childhood, I used to play a lot of them. In fact design many of them using 001GameEngine.
When you play a RPG game, a typical setup is the following
- You are at Level 1.
- You choose certain monsters / perform some quests.
- These give your some Drops and XP.
- The more XP you collect you level up.
- The Drops give you Special Weapons that have certain types of stat point.
- As you progress you start seeing harder monsters, for which you have to strategise on which weapon to use. Say there is a water type monster and you know that Fire weapons will work much better on them.
I feel problem-solving in general is exactly like this. More so in CP.
- You start with basic language implementation skills (Level 1)
- You chose Problems (monsters) / Topic Questions (Quests)
- Each problem drops builds some Concept and Frameworks (XP) and teaches some Forms and Tactics (Drops)
- As you see harder problems, you use your Concepts and Frameworks (XP) to strategise an attack and use the tactics and forms (Drops) you have collected overtime that best fits.
Hmmm… quite similar right?
Let’s now understand what these are and how can they be truly used.
The 4 Fundamentals
These are fundamental Algorithmic pieces that you learn (little theoretic) that are used directly to solve or code standard problems.
Eg. DP is a simple memoization concept over what you have learned on Backtracking. You learn how to code basic idea too in this.
These are first level questions you ask yourself as you see a problem to decide what can potentially be used. Asking good questions to yourself can be key in solving problems.
Eg. “This Is a Tree problem and we need to do counting. Can we use DP to solve it? Some maths maybe?”.
If gives you the path to progress in a problem, so that it’s not haphazard (I'm not saying diffused thinking is bad, its just not the thing always to start with, atleast for standard doable problems).
Standard class of applications that you see in a particular type of problems.
Eg. Most of tree-dp (Which itself is a Form) problems generally fall in one of these subforms.
- Maintaining parent state with a state. (Whether the parent was taken or not).
- Merging subtree contributions. (Like some knapsack on each subtree).
- Maintaining full ancestral states (Like GCD of root till this node).
Usually this is something that you pickup when you see a lot of problems of the same type.
These are independent ideas that are generally used to reduce/solve the subproblems or optimisation issues.
Eg. Say we have a knapsack type solution where we merge
DP(node,Items taken in subtree) for a Bunch of Childs.
One tactics that exist that reduces this from O(N^3) Dp to a O(N^2) dp is that when you are merging the child’s dp value, maintain the current size and only update potentially till cur_size+new_child_size in the dp table.
Now if you don’t know this tactic, there is no chance you can solve problems that need it. [If you don’t, learn it from here : https://codeforces.com/contest/816/submission/37993710]
These are the primary 4 things that you should focus on when you are practicing.
Want to see another example of usage of this ? Just made a video explaining the same too : https://www.youtube.com/watch?v=F2HgeehAaio
Now ofc you might ask me Vivek.. Ok, that’s all good, but what should I do now??
Improve your practice !!
Most students who comeup to me and ask me that ‘why are they not improving from a very long time ??’ … mostly the issue is with one of the following.
- They are not practicing.
- Their practice strategy is absolute garbage.
- They are too impatient to see improvement, as this domain does takes time.
You will not be able to improve in a RPG game ...
- If you keep defeating simple monsters much lesser than your level.
- Defeat a monster and then leave the DROP and XP you should have gained (very very common). You will never improve.
- If you want to be level 100 in 1 day (Unrealistic expectations).
Your goal while solving any problem shouldn’t be to memorise how to solve this problem, but analysing what can you actually take away from this that you can use to solve something in real contests.
How to actionably do this ?? Post solving a question, just retrospect what where the new
- FRAMEWORK question you picked (How would you think about something like this next time ?).
- CONCEPT you learned (Go to some site and learn it).
- FORMS you have built (Collect problems of similar type and see what are you using in them repeatedly),
- TACTICS used that you can pickup (See for optimisations and observations).
If you are seeing a lot of problems in practice that is leading to no new thing in this list, your practice (sorry to say) is bogus.
If you are seeing too many in every problems, then maybe you collect them (which is difficult to be recalled), and requires too much of mana (I think I should stop playing game :D)
How to choose problems that will give you more of them… or how to work on the memory recall part of it ?? well that’s hard and I will keep it for another long blog (It has been more than 2 hours of me thinking and writing this… sorry).
If you read till this, it on its own means 100 upvotes for me. Looking forward to your take in the comments :D. If more people like these, I will write more things on the pedagogy side. See ya in the comments.
TL;DR: Please don’t be at the bottom of this pillar.