Competitive Programming (CP) & LeetCode

6 bookmarks
Custom sorting
Really knowing things
Really knowing things
During undergrad, I got into competitive programming and noticed a strong tendency among contestants progressing quickly to spend almost all of their time actually solving problems. Contestants who progressed more slowly tended to spend a lot of time and energy on trying to memorize algorithms and then apply them to contest problems, rather than learning relevant algorithms “in the field.” One of the top competitive programmers in the world, Um_nik, has a much-discussed tongue-in-cheek post titled Things I don’t know. At the end of the post, he says “if you know at least 3 of these things and you are not red — you are doing it wrong. Stop learning useless algorithms, go and solve some problems, learn how to use binary search.” Something about actually solving problems, thinking deeply about them, and internalizing their lessons helps one really know things. On the other hand, it is very hard to theorize about how one might solve a problem. In the limit, people who spend almost all of their time learning new ideas but never applying them must do exactly that. It doesn’t work well. In some simplified but very real sense, they know lots of names, but don’t know what the objects the names point to really are. Richard Feynman’s recollection of a conversation he had as a kid gets at something foundational about knowledge: One Sunday all the kids were walking in little parties with their fathers in the woods. Then the next Monday we were playing in a field, and a kid said to me, “What’s that bird? Do you know the name of that bird?” I said, “I haven’t the slightest idea.” He said, “Well it’s a brown-throated thrush. Your father doesn’t teach you anything.” But my father had already taught me about the names of birds. Once we walked and he says “that’s a brown-throated thrush, in German it’s… in Chinese it’s… in Japanese it’s… and so on. But when you know all the names in every language of that bird, you know nothing, but absolutely nothing, about the bird.” And then we would go on and talk about the pecking and the feathers. So I had learned already that names don’t constitute knowledge. (source) Names themselves are powerful and indeed even underrated. When something acquires a name, its essence is compressed, allowing for high-level discussions. It is for this reason that once something is discovered, it is given a name. But the directionality is the point! Focusing too much on memorizing a name before grasping for oneself the thing the name describes is most often a mistake. The process of learning should follow the process of original discovery as closely as possible, and should deviate only when there is a better approach to discovery. It is easy to confuse memorization of attributes with understanding. To arrive at fundamental, meaningful understanding one should focus on getting to a point where such attributes just make sense by questioning them, playing with them, and connecting them with everything one already knows about the world. This process itself seems to have a name: discovery learning. Explanations For people who focus on understanding in this way, the ability to explain things simply comes almost for free. Roughly, my model is that this ability emerges from extraordinary knowledge transfer – imagining all concepts that you know something about as nodes in a graph, the more edges to which you can connect a new concept, the more simply you’ll understand it, and in turn, be able to explain it. If you practice discovery learning, you’ll find integrating new nodes easier since your whole knowledge graph is highly connected. On the other hand, if you don’t spend time trying to connect with other nodes and instead opt to memorize, you’ll end up with components of the graph that are much more isolated. An implication of these claims is that we should generally expect someone who is at the very top of their field to discuss its ideas in ways that are less complex because their understanding is deep enough to do so. In a 1960 interview with the BBC, Orson Welles, creator of Citizen Kane, describes this phenomenon exactly when explaining the advantages of working with his cameraman: … and of course again I had a great advantage not only in the real genius of my cameraman but in the fact that he, like all great men, I think, who are masters of a craft, told me right at the outset that there was nothing about camera work that I couldn’t learn in half a day, that any intelligent person couldn’t learn in half a day. And he was right… and I was lucky enough to be told that by the absolute best living cameraman. Like a doctor – you know very good doctors often tell you, “you know, we don’t really know anything much about medicine.” I’ve noticed an awful lot of good doctors do talk that way, but only the very good ones. (source) This is not an attack on camerawork or medicine; Welles’ point is incredibly broad. A mid cameraman finds the sheer magnitude of angles, scenes, props, and lighting decisions impossi
·tannerhoke.com·
Really knowing things