kevbamboo's blog

By kevbamboo, history, 7 weeks ago, In English

How do you learn from your mistakes? Like how do you learn from the solution? Even if I understand the solution, I am not able to generalize the answer to the one problem to others of the same type.

 
 
 
 
  • Vote: I like it
  • -5
  • Vote: I do not like it

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

e.g. when I looked at a dp solution for a medium leetcode problem, I couldn't generalize to an easy problem without looking at the hints.

  • »
    »
    7 weeks ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Because CP isn't about generalizing it's about learning to think and problem solving.

    • »
      »
      »
      7 weeks ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      But also, like every time before I get an AC, I have to make like 5 wrong submissions, most of which are dumb mistakes. How do you prevent that?

      • »
        »
        »
        »
        7 weeks ago, # ^ |
          Vote: I like it +8 Vote: I do not like it

        solve more problems

        • »
          »
          »
          »
          »
          7 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          But solving problems doesn't teach me anything if I know how to do it already. And you look at the solution if you don't get it, right?

          • »
            »
            »
            »
            »
            »
            7 weeks ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            If you know how to do it already, then why are you making 5 wrong submissions and having problems generalizing it?

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Learning from your mistakes is only part of getting better. You won't be able to generalize the answer from one problem to another by only looking at your mistakes.

I'm new to this whole competitive coding thing, but it seem a lot like chess -- something I am much, much more experienced in.

Now in chess you won't get much better if you only look at the mistakes in your games -- although this is something that you need to do to improve. Looking at the mistakes helps identify the areas in which you are weak, from there you can identify what you need to improve on and then practice in that area.

Say for instance you lost a game because you missed a fork. Well, this suggests that you should brush up on this particular tactic. Now keep in mind, if you solve a chess tactic that is rated 1800 that uses a sacrifice and a fork that doesn't mean you are going to encounter that exact sacrifice and fork tactic in your future games (or ever again for that matter) nor are you necessarily rate at 1800 -- however, you are training your brain to pick up on this tactic subconsciously. You become aware of the idea that such a thing can be done. If you are new to chess it's one thing to learn what a fork is, it is then another thing to recognize it in a different situation.. how good you are is in part predicated on how well you can recognize these patterns and how fast you are at finding them.

Similarly in coding, in order to get better look at what your mistakes are. If it is DP then do problems that involve DP and then do random problems were you must realize that DP is the solution. If you are making a lot of small blunders -- silly mistakes -- then keep practicing.

Another key takeaway here when learning something new/ trying to improve is consistency -- you must consistently do problems or else you brain will forget and you lose all that practice you've done.

  • »
    »
    7 weeks ago, # ^ |
      Vote: I like it -9 Vote: I do not like it

    are you from quora

    • »
      »
      »
      7 weeks ago, # ^ |
        Vote: I like it +12 Vote: I do not like it

      No? Why is there something wrong with my advice?

      • »
        »
        »
        »
        7 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Just codeforces things

        • »
          »
          »
          »
          »
          7 weeks ago, # ^ |
            Vote: I like it +11 Vote: I do not like it

          ... my answer is directly related to OP's question. Am I not allowed to give an analogy to help elucidate a concept?

          • »
            »
            »
            »
            »
            »
            7 weeks ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I think, a known/popular analogy would have been helpful. But in this case personally I don't know anything about chess, and I think many people would have not got anything that you have said about fork, sacrifice and all that stuff, and maybe that's why they have downvoted. :-\

      • »
        »
        »
        »
        7 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        because your comment makes a wise and well-thought-out impression, but it consists mainly of obvious statements, and no true insight. anyone can give such "advice", even people who have never programmed.

        this is exactly what people on quora do when they see a question they can't answer but still want to say something: write a long text with 0 content that looks smart. random forced analogies are the bread and butter. only thing missing is an unrelated pic of a webcomic or hot girl

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

          No need to be so vitriolic; now, how am I forcing any analogies? Learning from your mistakes applies to many, many subjects. It seems fitting to give an analogy to help explain the concept that I am talking about, especially since chess competition and code competition share several qualities -- such as, thinking analytically and logically, studying, worrying about time limits and making the wrong decisions, practicing rudiments to build a solid knowledge foundation, an ELO type rating system, etcetera, etcetera. Secondly, I think it is worth mentioning here that things that you may find so obvious may not be so obvious to others -- they weren't obvious to me at one point in my life and I had to learn things the hard way.

  • »
    »
    7 weeks ago, # ^ |
      Vote: I like it -9 Vote: I do not like it

    what is your Lichess profile?

    • »
      »
      »
      7 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      • »
        »
        »
        »
        7 weeks ago, # ^ |
          Vote: I like it +9 Vote: I do not like it

        ?

        • »
          »
          »
          »
          »
          7 weeks ago, # ^ |
            Vote: I like it +46 Vote: I do not like it

          I (the person who is typing this comment) have found the account (a persistent, long-term identity associated with a service) associated with you (the user named TheMonsoon) on Lichess.org, a free and open source website for playing chess (an ancient board game in which pieces move around and the objective is to checkmate the king). The URL (uniform resource locator) associated with this account is https://lichess.org/@/TheMonsoon. Please note that this was a best-effort guess made by inputting your username here into the Lichess profile search and may not be 100% accurate. Thank you and have a great day.

          • »
            »
            »
            »
            »
            »
            7 weeks ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            nice reply

          • »
            »
            »
            »
            »
            »
            7 weeks ago, # ^ |
              Vote: I like it +8 Vote: I do not like it

            No need to be patronizing. I just find it odd that you would take the time to dig up a lichess account and post in on this website.

      • »
        »
        »
        »
        7 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        imagine not using chess.com

  • »
    »
    7 weeks ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    The chess analogy is kinda forced here buddy.

    #chessBrah #habitsBrah #Forever1500Crew

    • »
      »
      »
      7 weeks ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      In what way is it forced? The principle of analyzing your mistakes and then taking that analysis and practicing to improve is the same.

      • »
        »
        »
        »
        7 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Nothing wrong with it, I agree with your advice and understand it. But someone who doesnt know/care about chess will not benefit much from it. Mostly the fourth paragraph doesnt look non chess folks friendly.

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

How much important is Fenwick Tree for Competitive Programming?

»
7 weeks ago, # |
  Vote: I like it -11 Vote: I do not like it

There is a union of humorists in the comments above

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

After getting accepted for a problem think about what cost you the most time on that problem? Is it thinking, implementation, debugging, or any other thing? Then think about how you can reduce the time. Then think about when you are thinking about the problem which path gives you no solution and how you can avoid that path. After understanding others' solutions (from the tutorial or somewhere else) think about how you can go that solution logically without guessing from reading the statement. Smooth your thought path for that problem. Note your mistakes and when you make a mistake (new or old) you can read through all of the mistakes you have done so far as punishment (don't mind, just fun).