▲ | leoh 2 days ago | |
I've been thinking about something related lately. I've been going through algorithms problems and although I've been a very successful engineer, I feel terrible when solving algorithms problems. I had a realization, which is that there are two ways to learn: 1. trying to figure out solutions a priori 2. learning from tutorials online or cormen, rivest, stein, etc. The two approaches are very difficult for me to reconcile. I'm the type of person that always prefers to do (1). That said, a lot of algorithms probably either 1. took a lot of careful studying to figure out 2. were solved by someone who is really brilliant 3. some combination of (1) and (2) I think we need to remember that in all likelihood, many "solved" problems in technical fields -- which individuals are expected to be able to solve, at least in programming interviews -- probably were solved in the past by taking a lot of careful time by reasonably smart (but not necessarily genius individuals -- though I am sure there are exceptions). I would much prefer to be able to do (1) for every algorithms problem, but the fact of it is, I think it is near impossible (probably even for very brilliant individuals, maybe folks like Ramanujan excepted -- and even then, he had exposure to building blocks in textbooks). Calculus is a special case of this, for example. It doubtless took Newton and Leibniz a lot of very careful studying to discover calculus in addition to them being very bright individuals. Solving a rubik's cube is another example. I suspect (though am not sure) that the the number of individuals who have solved a rubik's cube a priori is extremely tiny. Maybe on the order of dozens (out of hundreds of thousands if not millions?) in the world ever. I don't think that these issues are clearly articulated enough and it really is a shame. It's also a tragedy, I think, that we live in a world where: 1. individuals working in technical fields are often expected to be able to know how to do a lot of very hard things that likely took humanity a very very long time to discover 2. there is a tremendous amount of pressure in many contexts to know how to do very hard things in many cases without very much support in learning For individuals that don't care too much about figuring things out a priori, I think this can be a very very challenging world. I think one of the ways out is to appreciate the above -- and to carefully, slowly, thoughtfully attempt to reconcile when to try to understand things a priori versus when to try to learn things from principles others have discovered. The first individuals who were doing things like sorting algorithms, dynamic programming, etc. likely took months if not years to be able to solve problems that are now considered (relatively) trivial and in only a few lines of code. | ||
▲ | birdfood 2 days ago | parent [-] | |
I think a good, related example to your point is the “2 watched literals” algorithm used in SAT solvers. It uses lazy evaluation to significantly improve the speed of the SAT solver. I implemented an SAT solver a couple of years ago just for learning and when it came to refactoring my code to implement the 2 watched literal I had what felt like a moment of recognition of the cumulative time and effort of many people working in this field of research that it must have taken to arrive at this design. It’s just such an elegant implementation that to me seems it can only have come from deeply understanding the theory and implementation of SAT solvers. |