Wandoka's blog

By Wandoka, history, 19 months ago, In English

Basically the title.

Why the problems seem so much easier if you go to sleep and return to it the next day? It happened to me numerous times. I struggle for hours with a problem, I give up and move on with my day, I return to it in a day or two, usually I don't remember the statement, but after reading it I solve it almost effortlessly. It is like my brain solves the tasks on its own throughout the day, but I find it hard to believe that it is able to do that if I don't even remember the statement. Sometimes I wonder why I bother thinking about a problem at all if I get stuck for more than 10 minutes. I know that almost certainly I will be able to solve it the next day (if I pick an appropriate difficulty for me obviously).

I have pretty much 0 knowledge on how the brain works, and I wonder why this weird thing happens. I know that it is a common knowledge to "sleep on the problem", I was told that in school for example, but I have not seen anyone talking on how MUCH it affects the results.

I also wonder, if it possible to master this "power" lol?
It sounds weird, but I have an "ultimate move" during the contest to go to the toilet, for some unholy reason I consistently was able to find creative ideas in a span of several minutes I spent there. It seams like forgetting about the problem, and then returning to it works just like turning a device off and on, seems to fix most of the problems. But it is so hard to do it during a contest, especially when there is almost no time left. I also know that skipping a problem and then returning to it might be effective when you are stuck, but the effect is so much weaker for me. It helps, but just a bit.

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

»
19 months ago, # |
Rev. 2   Vote: I like it +11 Vote: I do not like it

It happened to me lots of times as well, some great programmers say that it's because your brain works on the subconscious while you are sleeping.

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

    I don't think my brain can apply dp optimization techniques in my sleep... but I do feel the same.

    I like to think about the problem-solving process as the brain taking a path through some theoretical graph made of ideas, where it tends to go through the most intuitive and direct connections (the accuracy of those of course determined by the quality of one's intuition), but moving towards a general concept changes the way you understand and see these connections, and so when you think about the same problem for too long you'll tend to go deep into a single direction, get stuck on it, and lose the ability to jump to new and unique approaches. Therefore, taking a break (shower/sleep/etc.) can be very helpful if you feel you've exhausted all possible paths when attacking a problem, by effectively condensing everything you've got so far into the starting point, forgetting about the many irrelevant details you've come across along the way, and with that allowing you to re-examine the different ideas that were blocked off in your head.

    I'm obviously just describing how I personally feel, I have no idea how the brain works, but in any case I think the most helpful part of sleeping (with cp) is giving your brain a break from the constant stress of solving a problem, under which it can get difficult to think creatively.

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

      I didnt knew high rated coders had the same feeling

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

        The effect might be less noticeable with more experienced competitors, but I doubt it simply disappears when reaching a certain threshold, everyone needs sleep. That being said, I can't really speak for anyone else, and I'm pretty sure anyway that lgms have either half of their brain asleep at all times so that they can constantly regenerate and claim the positive modifiers with the other half, but I haven't unlocked that ability yet

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

Speaking in general(and I mean it) terms, there exists the consciousness as well as the subconsciousness.

Subconsciousness is like the hyper active toddler, which does a lot of various things super fast, but does it quite hastily and therefore sloppy. On the contrary, the consciousness is magnitudes slower than consciousness, isn't so good at multitasking, but very precise(for a human).

Whenever you are giving up a problem, you don't forget it, you consciousness just dumps it in the subconsciousness, where it will be processed.

The reason why it's soo good at solving problems is because of how problem solving is structured. Humans love to think in concepts, and I am a strong believer that problem solving is like walking on a knowledge graph using intuition and observations. And subconsciousness is very, VERY fast. It is good at traversing this graph quickly, and it doesn't even matter here if it decides to cut some corners, consciousness will do the tedious work.

The main problem with subconsciousness is that you can't control it. You can't order it to solve this problem, it just now how it works. Also since you can't control it, you can't control its output. Ideas from the subconsciousness come out of the blue, so called "Eureka" moments, and you can't predict them.

But you can do something to nudge it towards thinking about something useful for you. Colin Galen has talked about it, Radewoosh has talked about it, i bet many other talanted competitive programmers did. For competitive programming, the secret is to get to the point where your default state of mind is competitive programming. If you think about it often enough, your subconsiousness will pick up on that and start thinking about it as well, and boom, you get crazy benefits.

Btw, I've tried the method where I read problems like 1-2 hours before bed, think about them, then just think about them in the spare time of the other day. I was doing it for 2 months, I will say, I am pretty satisfied with being able to solve 2200-2300s almost within 24 hours and usually without the help of an editorial. But I am very unsure about the pace of improvement from this method: after all, most of your thinking happens in the background, and I am also not sure that such a random way of solving problems will be very beneficial in the contests. I am trying another practice method right now.

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

This is actually a serious topic and has been studied.

Salvador Dali used the following technique for boosting his creativity:

He would hold some object: a spoon or key while falling asleep in a chair. As soon as he started to sleep the object would slip from his fingers and clang against the floor — so he would wake up immediately.

He believed that this small ritual gave him inspiration and creativity, and actually, this technique was tested on people to solve maths problems, and it worked on them pretty well too.

You can search about this further if you want.

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

    Oh, i've heard about Einstein using exactly the same technique. He used a stone or a spoon. Now I am not sure if he actually did that, or they made it up after hearing about Salvador Dali doing so.

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

      This technique is quite old and it wouldn't be surprise if Einstein used it too.

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

        Perhaps, the setup is so familiar, I thought that copywriters made another myth.

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

          Edison was also famous for using this technique; there is even a statue of him with a steel ball in his hand.

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

okay... I'm gonna take a nap of 30 minutes during contest after reading the problem statements... lets see how it goes today :)

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

    well... it worked wonders for me today, thanks XD.

»
19 months ago, # |
  Vote: I like it 0 Vote: I do not like it

A somewhat related phenomenon is documented elsewhere by different people — for example this talks about the importance of thinking about problems subconsciously, for instance during a shower, and how it can lead to more effective learning.

I like to think of it as completely reorganizing/resetting your mental state relevant to that problem. A professor at my uni used to say that a lot of math is just reorganizing the information you have at hand, and perhaps that is why it's easier to come up with creative ideas that actually work. It makes sense from a probabilistic perspective too.