Posts Tagged ‘computer science’

On Learning…

Wednesday, April 29th, 2009

My friend showed me this the other day (yes we’re both computer scientists and apparently nerds) and this kind of got me thinking about how I’m starting to see applications of computer science concepts all over the place, and especially in my other courses. It’s happened to me too many times to be coincidence, and I know that it’s also happened to some of my friends, and personally I think it’s really cool.

Regarding that specific article, I’m enrolled in an algorithms class where we’re talking about NP-complete problems, and in particular graph coloring. I’m also enrolled in a compilers class where we just started talking about code optimization. My friend and I mentioned this article to our compilers professor and he said that we would discuss this soon (and I think soon means on Thursday). I found this totally awesome! My courses are so aligned that we discuss a problem in one and then see an application in another within two weeks of instruction? Amazing!

Of course you’ll see applications of algorithms all over the place; they are kind of the foundation of computer science. For example, today, I implemented a Disjoint-Sets data structure to do run a Union-Find type algorithm for a project I’m working on. And yup, we talked about this structure in detail when we were talking about Minimum Spanning Tree algorithms. The disjoint sets structure was exactly what I needed to cleanly finish what I was working on, but had I been doing this just 2 months ago, I wouldn’t have known what to do.

I think this is why I like my algorithms class so much. Not only is it fun and intellectually stimulating to think about algorithmic challenges, but it’s arguably one of the most useful “advanced” computer science courses (of course it is more useful if you know how to program and enjoy/need to do so). Without thoroughly understanding the suite of algorithms at your disposal, it’s often difficult to find the right solution to your problem (although if you’re lucky/smart you can re-invent algorithms and data structures, I’ll comment on this in a later post). In that sense, to be a good programmer, you have to either spend a lot of time reading books, or browsing the web to learn the techniques.

I guess this is true of most fields, but when I came to college, I didn’t really think it would be true for computer science. I kind of thought that my degree would more or less validate that I knew how to program, but that I didn’t really need to actually go to school to figure that out, I could just read language tutorials online and whatnot. And I think that a lot of people also have this mindset about programming. Many of my friends are envious about programmers because you can get involved in side projects and research without taking a bunch of advanced courses. And yeah, this is true in some sense, but I don’t think you can do your side projects well if you don’t have “advanced” knowledge. Being a good programmer (and more so a good researcher) takes years of experience and also years of learning, just as it does in any field.

This is especially true for research. There are tons of techniques out there and how are you supposed to even know that they exist without reading hundreds of papers? And sometimes you need to take techniques from other completely unrelated fields. In one study, network security researchers used the mark-and-recapture technique from ecology to figure out estimate the size of a spamming botnet. How are you supposed to even know this technique exists? I think it’s really interesting and quite crazy how people even know about the technique, let alone realize that they should apply it in this new space.

At the same time, it’s really cool when you end up doing this yourself. I really enjoy including tidbits of information from the AI class I took last semester in my algorithms homework. For one assignment, I framed running Kruskal’s algorithm as running an agglomerative clustering with some threshold distance at which you stop clustering. In another, I modeled a problem as a Hidden Markov Model (which we haven’t discussed in the class) and solved the problem by running the Viterbi Algorithm. Applying previously learned knowledge to current problems not only enforces your understanding, but it validates that you didn’t waste your time learning some stuff.

So in one regard, I’m always applying things I learned. To write this post, I’m hinged on the fact that I learned to write in elementary school. Every time I program, I’m applying my knowledge of basic programming skills that I’ve been honing for the last two years. There aren’t many situations when you aren’t using past learned information. I just take a lot of the basics for granted and am not really impressed when I apply them. This is almost unconscious behavior, so it’s not exciting to me. I am impressed when I apply the advanced stuff, because I don’t really expect my brain to dig that information out when I’m thinking about something completely different. I don’t think it’s instinct to think of some specific advanced techniques, but it’s not like I’m delving into textbooks to discover them. I guess when you study some techniques in enough detail it does become instinct to recall them in new contexts.

Ok, I’ve started writing really long posts since I picked up this blog again, so I’m going to wrap it up. Here are my takeaways: Learning is super important; it gives you a full repertoire of techniques that you can use to tackle any problem. Without these techniques, you have no hope of elegant solutions. It’s also important to be able to apply these techniques in new contexts, places that you’d never expect to use them. I didn’t really talk about this much in this post, but I may in a future one. Keep reading about your field, I think you’ll quickly find that you are not wasting your time