Saturday, October 27, 2012

Back at long last! A lot has changed.

It's been ages since I wrote a blog post -- I can't believe that the last one was entitled "GRE just around the corner." So much has happened since the GRE. On the plus side, I doubt anyone actually reads this blog except spambots, so I don't think anyone was waiting with bated breath to hear what was going on. On the other hand, this blog is not so much for everyone else reading it, as for me when I want to go back and see what happened throughout this quite literally pivotal time in my life.

With that in mind, let's do a brief overview of some of the key events which have taken place since that GRE test, starting with the test itself.

  • I scored well on the GRE test.
  • I applied to Northwestern University.
  • I got rejected from Northwestern University.
  • I decided I had to take real computer science classes.
  • I applied to the Graduate Student-At-Large program at the University of Chicago.
  • I left Japan and returned to America to take computer science courses.
  • I'm a full-time student taking a Java and a Discrete Mathematics course.
Let's go through some of these things in more detail, while acknowledging that there's no way I'm going to really cover 5+ months of events in a single blog post.

I took the GRE test and scored very well. I was quite pleased with my scores, not because I think they really reflect reality that well, but because it means that I have very little incentive to take the test again - if GRE scores alone were the difference in me getting into a great school, I'd be pretty much set. Unfortunately, they aren't as my experience applying to Northwestern taught me.

I had always intended to apply to Northwestern because it's in my hometown of Chicago and it's a reasonably highly-ranked school (around #34, which ties it with my alma mater, the University of Chicago, in the area of computer science). But as it turned out, they have an incredibly late deadline for fall-quarter applications (July 1st this year). The same deadline for most schools is around December. So I had planned on waiting to apply to schools until the end of this year, but when I saw that Northwestern's applications were still open, I decided to make a go at it. I quickly requested letters of recommendation from my two American former employers - from my boss at my summer job where I had worked through high school and college, and from the director of the biology lab where I had worked after college. I wrote an essay which I felt adequately summarized my story and portrayed me as someone passionate about learning, which is true.

With such a short-notice application, I hadn't exactly expected I would get in -- I really didn't expect anything one way or another. In retrospect, my rejection was a good thing. Well, the best thing in some ways would have been getting in and going, but failing that, it was good that I had the experience of applying and that I learned that as I stood at that time, I was woefully unqualified to enter a top graduate program. The admissions counselor at Northwestern took the time to write me a detailed email explaining why I had gotten rejected, and it was clear that it had been an easy decision. I didn't have any academic record in computer science. I didn't have any letters of recommendation that were pertinent to computer science. My admissions essay wasn't poorly written per se, but instead of talking about what I wanted to study and do, I talked about all of the different areas I had studied so far, and how interested I was in all aspects of computer science, which had the net effect of making me look unfocussed.

I realized that I did not have a strong application and moreover, I would still not have a strong application come the winter if I continued on the path that I had been on, studying on my own and moving from topic to topic with interest but without direction. It became clear to me that no matter how much I could learn without real classes, it ultimately wouldn't mean very much if I didn't have proof of that knowledge in the form of grades. Further, having virtually no relationships with professors from my days in college, I would not be able to get great letters of recommendation from an academic standpoint, especially that emphasized the things that especially matter in computer science - mathematics and problem-solving.

Upon this realization, it became clear that the only answer that made sense would be to return to school. I had to go to school, to go to school. Is that irony? I guess that's not quite the right word for it. But whatever it was, it was true. Unfortunately, it took me about a month after my rejection to come to this conclusion, which cost me the opportunity to apply to the non-degree programs at the University of Illinois Chicago and the University of Illinois Urbana-Champaign (the former attractive for its price, the latter for its price and its prestige). But the University of Chicago has a very late start to its academic year, and I was able to apply to their non-degree program and get accepted. I quit my job -- with a certain amount of chagrin for the late-notice I gave -- and packed up for Chicago, which is where I am now.

So, at this point it is 4 weeks into the autumn quarter at the U of C. I ended up officially taking 2 classes, Java Programming and Discrete Mathematics. The former is a graduate course,  and the latter undergraduate, but ironically the math class is far more difficult. Discrete math is broadly the mathematics of countable objects, and the kinds of things you do with them are quite a bit different than what you do in physics, which is mostly calculus. I've been able to do well on the first three problem sets thus far (at least, I think I've done well; only one has been graded so far). It's required quite a significant investment of time and energy, however. And the first midterm (of two, plus a final) is the day after tomorrow, and I am a bit nervous. It will be the first time I've taken a college test in over 5 years, and the first math test in several more. I did take the GRE of course, but that's a test of endurance as much as anything else. This one will likely be quite tough. Honestly, I had second thoughts about taking the class officially, because of the high cost of the class (about $2700) and the difficulty. It's a bit of a gamble, because if I do well, it will be impressive on my transcript (I hope), but if I do poorly, it might count against me.

The Java class, on the other hand, is frankly too easy. I hadn't studied Java in any significant depth prior to the course, but I had been exposed to object-oriented programming via python in my first computer science class, and again later as I studied C++. My knowledge of C++ carries over nearly wholesale into Java, and while there are a lot of new concepts in the nitty-gritty details, overall it's almost the same. Unfortunately, the class is taught practically from step one. Thus, four weeks into the course, we're still talking about basic things like inheritance and how Java passes values. The thing is, for as detailed as the lectures get, the textbook is even more detailed. And that's great for a textbook. So, if I were running the class, I would assign readings from the textbook, assume that people had done them, and use the time in class to press forward with the material. But hey, maybe I'll get to make those kinds of decisions somewhere down the road.

In coming back to take classes, I have three main goals. First, get good grades. This one is obvious. Second, make friends with professors so that they know me well enough to write me good recommendations. I had pretty good grades in college but I wouldn't be surprised if 95% of my professors didn't even recognize me now. I didn't build a relationship with any of them. That's something I'm trying to fix with both of my classes now. Third, figure out exactly what I want to do so that the next time I write an admissions essay, I can be direct and to the point, and inspire confidence that I know what I want to do. On this one, I'm still a bit fuzzy but I'm a lot closer than I was before, when I couldn't decide if I wanted to do artificial intelligence research, or build robots, or make CGI movies. At this point, I'm pretty settled on the idea of software engineering, designing and building applications. Making software is fun for me; identifying a challenging problem, knowing that there's a program I could write to solve it, and then figuring it out and doing it is a pleasure and rewarding. I'm still undecided on what kind of software I want to write - servers, systems-level applications, databases, mobile apps, web apps - but all of those sound great, and they're largely closely connected enough that I don't necessarily need to pick now.

So, where do I go from here? Well for one, I don't expect I will be at the U of C after this quarter. There are two primary reasons for this: for one, the courses at the University are incredibly expensive. For courses in the Computer Science Professional Program, which includes the Java course I'm taking now, a single course is about $4860. That's an insane amount of money. It might not be insane compared to some other schools, but for example in comparison to the Universities of Illinois - which are around $7-8000 for a semester of three courses - it's a pile. The second reason is that I don't think the CSPP is the right program for me. It's too focused on industry careers. Now, over the time that I began studying computer science, my goals have indeed shifted from wanting to do research to wanting to program professionally. But I am still driven by the thirst for knowledge, and I constantly want to learn more. The atmosphere of the CSPP - and maybe I'm mistaken about this - seems to be much more one of "learn only what you need to know." In part because the CSPP is such a short course. There are only 9 quarter-long courses, such that it can be finished in less than a year. Most master's degree programs are two years, with around 12 courses (if they're semester-long). It's inevitable that such a program will make sacrifices in the way of depth, in order to facilitate an accelerated track of study. Certainly it's attractive to imagine getting a master's degree in such a short time, and with no thesis. But that doesn't seem to be what I want. So, I'm setting my sights elsewhere, though reserving the right to change my mind.

With that in mind, I think my next destination will likely be the University of Illinois at Chicago. For the next few days, I actually have a window of opportunity to apply to the master's program there and begin in the winter. However, I think I'm going to pass that up just for the moment, and apply initially as a non-degree student in order to give myself the opportunity to apply to a wider selection of schools. Unfortunately, UIC only accepts a maximum of 9 transfer credit-hours when starting as a full-time student, and most courses are 4 credit hours, so courses I take past two (including the Java course I'm already taking) will be somewhat meaningless. However, I don't want to jump into a master's program without first trying other options. If it were Champaign-Urbana instead of Chicago, I would almost certainly go for it, since that's a top-5 school. But with UIC ranked at #58, it's a solid choice and one I wouldn't be ashamed to go to, but one where if I went without trying other options, I would probably regret it.

So, there are the updates. It got a lot longer than I was planning on, but I guess that always happens. Hopefully my next update won't come so late... but if it does, I expect I will have much and more to write about what transpired in the meantime.


_____________________________________


Musings on that price at the University of Chicago's Computer Science Professional Program: I would make a wild guess that their lecturers maybe get paid about about $10,000 per quarter, and it might be a lot lower - at 3 hours a week (5-6 if you include office hours, perhaps 10 if you include preparation), that's a pretty big chunk of change. Perhaps the TAs and graders make maybe $5,000, which again might be overestimating; that would be a nice gig if you could get it. Then with tuition at $4860 per quarter, 10 weeks per quarter and three hours of lectures per week, that means students are paying $486 a week or $162 dollars per hour of lecture, a rather eye-popping cost. On the other hand, there are around around 40 students in a class, meaning the University pulls in nearly $20,000 per week from each course, or $200,000 a quarter. If money spent on lecturers and TAs is around $20,000, that means around $180,000 of pure profit, per course, per quarter. Now there are typically around 4 or so highly subscribed courses per quarter, and maybe 2 in the summer. That means 3*4 + 2 = about 14 courses such courses per year. If my guestimates are anywhere near correct, that's about $2.5 million a year in pure profit from the CSPP. Now, if you're Mitt Romney, that's the kind of money you find between your couch cushions, but for most of us... cha ching.

Saturday, May 19, 2012

GRE is just around the corner!

It's been a while. In my personal life, I've had some significant changes... which I'm not going into except to say that they may or may not have been impacting what I've been able to accomplish. Which isn't so say that I've been lax recently; I've been able to be productive, if not superbly so.

The GRE is in less than two days, coming this Monday. I really hope I do well, because I don't want to have to take it again, both from a monetary and a time point of view. I definitely should have been spending more time on it over the last few weeks, but it's just so... blah. Any time I'm studying for it it feels like I'm wasting time. But, I haven't completely ignored it, and I also am planning to take a practice test tonight (perhaps just half of one, depending on how the time works out), and possibly tomorrow as well.

So with my "real" classes, let's see how much I've gotten done.

Progress:

  • Stanford Programming Abstractions: completed the first problem of problem set 4.
    • Yeah, it's really not a lot, but I've had to de-prioritize Abstractions in order to keep up with some of my deadline-containing classes. The main thing I want to solidify my knowledge of are pointers. While there are certainly many other important things included in these lectures, pointers are one of the fundamental topics of C/C++ programming and are essential to claim knowledge of the languages besides just syntax. So, I at least want to make sure I can get those, if not do a 100% on the full problem set as I have been (for the most part) on the others.
  • Coursera Machine Learning: completed first programming assignment, watched through section 6
    • I've been going back and forth on whether I should stick to the Coursera lectures or switch to watching the lectures from SEE (the original Stanford lectures). Those lectures are presented on a higher level (in terms of sophistication) and give a more thorough treatment of the subject, complete with discussions of probability, more derivations of equations, and so on. I think ultimately due to time constraints and mismatch of material covered that I will end up sticking with the Coursera lectures, and returning to the SEE class later. I wish that the Coursera lectures were presented with the same level of sophistication as the Stanford lectures, as the Algorithms course had been. But as is said in Japanese, しょうがない。
  • Coursera Computer Vision: watched through section 4 (dynamic perspective)
    • This class has definitely picked up from the post I made May 4th. In fact, I think that I neglected to include some progress I had made in the class in my previous blog post. Anyway, they have uploaded a good deal of lecture videos as well as an assignment (which I hope to do tonight or tomorrow). I still get the sense that the material has been somewhat awkwardly ported from a college course to the online lecture format, rather than having been built from the ground up to fit the MOOC paradigm, as for example the Udacity classes, and most other classes are. But that doesn't really matter too much to me; what matters is that the content is interesting, and it definitely is. I had never considered that the whole basis for what we understand as "how the world works" comes from mathematical properties of a 3D projection onto a 2D plane. It's really cool.
  • Udacity Web Application Engineering: watched through unit 5, completed homeworks 3, 4 and 5
    • It becomes clear how much has gone by since my last post when I note that I've completed 2.5 lecture sections and 3 homeworks in this class since my last update. This class is certainly the most practical class of all that I'm taking, and that's not a bad thing. There's a huge amount of useful, if not theoretical, information being given in these lectures and it's great. This week was a bit of a break compared to weeks 3 and 4, which were both a lot of content and quite a lot of frustrating work on the homework. While both of those took me several hours to complete, in contrast week 5 only took about an hour. However, the concept introduced in week 5 was that of how websites disseminate information (through e.g. JSON and XML) such that it can be easily parsed by web applications. This rather simple concept is really quite powerful, and explains a huge wealth of applications and potential applications that take advantage of the ability to read and analyze the informational content of a web page. Cool stuff.
  • Udacity Programming Languages: watched a bit past the middle of unit 4.
    • Wow; in stark contrast to the substantial progress I've made in the web course, with this one I've only gotten through half a unit in more than two weeks. Ouch. Unit 4 has turned out to be quite a drag. What had been an interesting and easy-to-follow course up until then took a sudden turn for the convoluted as Professor Weimer's explanation of parsers made little and less sense to me. I'm going to try to finish the class, but in some ways I'm wondering if I might not be better off jumping ship to the Compilers course. That course turned me off a bit by introducing the requirement of learning a new (and practically useless) programming language called COOL for which to write a compiler. While I'm sure that there are many benefits to constructing a language specifically for the purpose of making compiler design easy, nonetheless it's really irksome to have to learn a whole new syntax just for one class. It would have been nice if they had at least modeled the syntax on a well-known programming language so that it would be easy to learn. But then again I'm sure it wouldn't be a big deal if I just sat down and took the time. We'll see.

No-progress classes: Linear Algebra, Udacity Robotics... I'll get back to you guys when I have some more time! Sorry!

Saturday, May 5, 2012

Second update today...

Well, it's finally time to hit the hay tonight, as it's technically tomorrow, but I figured I'd update once more, seeing as I was so productive today. Whee.

Progress:

  • Stanford Programming Abstractions: watched through lecture 12.
    • Pointers! Um... are hard. Well, not super hard, but a bit unintuitive. I guess they'll get clearer when I get some practice with them. Hopefully I won't blow up my computer using them.
  • MIT Linear Algebra: watched through lecture 9.
    • More on spaces; this time talking about basis vectors, vector independence and such. Interesting. Actually this stuff was pretty easy to grasp, at least, at the beginning. Urgh, 9 lectures means I'm due for another problem set. Like Abstractions I guess.
  • Coursera Machine Learning: watched through section 5.
    • Learning about Octave, which seems cool, I guess. I guess it's like Mathematica, but it's reeeally big on matrices. Haven't really done much with it yet, but it all looked pretty straightforward. We'll see, I suppose.
  • Udacity Web Application Engineering: watched through the middle of unit 3.
    • Databases! A fairly straightforward topic, at least at the level that it's been taught so far. They aren't exactly lighting my fire as of yet, but I suppose they're cool. The parts that would likely interest me would relate to algorithms. There was a bit of that, mentioning hash tables and the like. I learned a bit of SQL code. With that plus Octave, I can now say that at least in a very limited sense, I've added two languages to my repertoire. Man, including JavaScript and I'm really learning quite a few! Though, none of them I've used in any real depth save for Python and C++.
So yeah, significant progress on four additional courses after my first update! Plus, I talked with my brother for 2 hours on the phone and watched several episodes of Big Bang Theory! Woohoo. Productive day. If I can match it tomorrow it'll be great.

Finding Programming Languages so interesting, I've also registered for the Coursera class on compilers, and watched the first two lectures. I'm not sure how much time/energy I'll be able to devote to that one, but it would be nice if I could complete that one too - perhaps not in a timely fashion though. Oh, and I forgot to mention that I have registered for the GRE! The test date is May 21st... only about two weeks away! Yikes. I keep putting off studying for that, since it's such a waste of intellectual resources compared to the other classes... but indeed, I had better do some more reviewing. Argh.

Stuff I'd like to get done tomorrow: 
  • Udacity Robotics course (finish unit 2 and possibly unit 3)
  • GRE study
  • Linear Algebra and Programming Abstractions problem sets 3 and 4, respectively
  • Possibly watch some more lectures on Compilers.

Friday, May 4, 2012

Moving is complete! Back to work...

Well, this past week has been relatively quite unproductive, because I have been moving to a new apartment. Who could imagine how much crap that involves! Well, strictly speaking it should have come as no surprise, since I had done it only a year prior. But that time, I was moving from a smaller place to a larger place, instead of the other way around, and thus I had no need to do all of the throwing away that this one required. And since in Japan, throwing stuff away is a hugely involved process that includes not only proper separation of all trash categories but also taking the trash out on the right day (an impossible proposition when you're under a time limit, by the way), suffice to say it was a pain.

But, I managed not to be completely unproductive, so let's see what I have done.

Progress:
  • Udacity Programming Languages: Watched through the end of Unit 3. 
    • Having accomplished little in the last week, I marathoned two units in two days (technically three but I skipped a day). The class is still holding my interest very well. I like that it's more theoretical than the other udacity classes I have taken. Although the stated goal of the class is to build a web browser, so far there has been little direct work on that front, instead focusing on fundamentals of programming languages, compilers and interpreters like finite-state machines, context-free grammars, and other highfalutin-sounding topics. Anyway, it's cool and as a plus, I've also learned a little JavaScript. Well, actually I've learned a lot of JavaScript since much of what I know from Python and C++ ports right over to it - what's still missing for me is how to integrate it into a webpage with stuff like user input, etc. I'm not sure to what degree that will be covered in this course, or perhaps in a course such as...
  • Udacity Web Application Engineering: watched through the end of Unit 2. Completed weeks 1 and 2 of homework assignments.
    • I don't feel particularly intellectually challenged by the course as I do from Programming Languages. Indeed the course seems much more "practical" in a way that makes me feel like I'm taking a DeVry course (though I can only guess at that, not actually having taken a DeVry course). By which I mean that it's a lot of "how to" knowledge, and not a lot of theory or deeper stuff. But that shouldn't suggest I'm not enjoying the course. There's a lot of really useful knowledge here, with a wide range of applications. I'm not sure I'm interested in a career as a webmaster, but at least I understand some of what goes into that job now. I expect things to continue to blossom.
  • Udacity Robotics: watched through the middle of unit 2.
    • Yes, indeed my progress leaves a bit to be desired. But I hope to make up for lost time. Unsurprisingly, not having the time limit that some of my other classes have takes away the urgency somewhat and makes me more likely to put it off. But I do plan to pick up the pace again. So far, I haven't really connected with the material; something I hope will change soon.
  • Coursera Computer Vision: watched through the second of two lectures.
    • To be frank, I'm disappointed in this class so far. Other classes I've taken have had loads of content right from the get-go, but two weeks into this class and all there have been is less than an hour of lectures. The first week there was nothing but an "introduction" video with very little technical content. I assumed maybe they just hadn't finalized their course materials yet or something and the "real" class would start next week. And yet when week two rolled around, there was again only a single video lecture. This one at least had some technical content, with a mathematical discussion of perspective and a flipped image - the kind of thing that would be fine when coupled with other videos, but it was quite underwhelming alone. And still no homework assignments.
  • Coursera Machine Learning: watched through unit 4.
    • In contrast to Computer Vision, this class has been serving up loads of content, both in lectures and problem sets (though so far there have only been "review questions" which are pretty much softballs). It seems clear that a topic like this makes a lot of use of linear algebra, which makes me glad I've gained the moderate skill that I have in that subject, as it saves me from a trial-by-fire that would have otherwise taken place.  Even though he tends to shy away from discussion of calculus, there's lots of cool math to be found in this course. It's somewhat odd that calculus is downplayed, because the same does not seem to be true for linear algebra. I wonder if that's because he assumes that people will find linear algebra easier than calculus (not the case for me) or if it's just more central to the topic. Probably the latter. Anyway, although it's not my favorite course yet (that would probably be programming languages), it's good.

Note that I haven't included in this list Linear Algebra or Programming Abstractions. That's because I simply haven't watched/done work for either one since my last update. :( But I plan to change that today; hopefully I will watch at least one lecture from each.

Sunday, April 22, 2012

Design and Analysis of Algorithms finished!

Well, I've wrapped up the work for Design and Analysis of Algorithms. I hope and plan to watch some of the remaining optional videos that I didn't get around to seeing, but that's the end of the work. I got full marks on the last homework and problem set, but on the final exam I got 25.75/30, which is a little lower than I'd like. Particularly annoying is that I lost two points on the final question, which I should have been able to get but I just didn't read my notes well enough. Ah, well. I certainly could have done better, but on the other hand, considering where I'm at, I can't be too upset by it. I'll await my final score - which unfortunately will be lower than it should, due to that brain-fart of not knowing about the existence of the programming questions. I could calculate it now, but eh.

On the class itself - interesting!! Wow, algorithms are really cool. I can see what Tim meant when he said they're addictive to think about. Although so far I don't seem to have any particular spark for algorithm design - all of the solutions offered are like "gee whiz" to me - I can understand everything well enough, and the ideas are cool enough, that I could see myself in some parallel universe studying this stuff. At the very least, it's very useful.

So with that, let's look at where I've come since the last post:

Progress:

  • Algorithms: completed the course.
    • I've all but given up on finding the answer to the second programming question. It's infuriating because the code sorts the list just fine - but the problem doesn't ask you to sort; it asks you to count the number of comparisons made. And for some reason, my code just doesn't count it right. Since it was late, and since I already got one of the three problems right, remaining is only a question of one or two more points. So, for the sake of my sanity, I'm going to pass.
  • Programming Abstractions: watched through the 11th lecture video. Finished problem set 3.
    • On the last problem of the set, I used an iterative solution rather than a recursive. They didn't say which one to use, but I'm guessing they wanted the recursive solution. Once I had the "updateVector" function built, it would of course be easy to implement a recursive rather than iterative solution, but I don't think the algorithm really would gain anything from it. Also, there might have been able to do a problem like this without vectors, but that's the answer I got and I'm sticking to it. Worthy to note is that some of the lectures coming up will be covering similar ground to the algorithms class I just finished up, so I anticipate skipping through a couple of those.
  • Linear Algebra: watched through the 8th lecture video.
    • The plodding pace of this class continues. I hope I can keep up a pace of at least 2 lecture videos a week; even at that I'm running behind the pace of the real class but at least it's not so slow that I'll lose track of the class.
  • Programming Languages: watched through the end of unit 1.
    • A really cool class. I like the content and I like the professor. I'm really looking forward to this one.
  • Robotic car: watched through the end of unit 1.
    • I remain optimistic about this course. Oh what an understatement, I'm totally psyched by this course! The material is a bit challenging, sometimes from a conceptual point of view and other times practical. But, if I can get a good grasp on this stuff, it will really be amazing. Especially combined with the Machine Learning and Computer Vision classes.
And coming right around the corner are Machine Learning and Computer Vision courses from coursera! They will be live on the website starting tomorrow or maybe late tonight. W00t!

Friday, April 20, 2012

Modelling The Monty Hall Problem with python

So I've always found the Monty Hall problem interesting, because it's so counter-intuitive. Basically, you're given three doors, with a car behind one and a goat behind the other two. You pick one door and then the host opens one of the doors you haven't picked to reveal a goat, and then asks you if you want to switch. Intuitively, you'd think that you'd gain no advantage from switching, because either way you have a 1 in 3 chance of getting it right... right? But no, as vos Savant first showed, the actual probability of a hit is higher if you choose to switch. Significantly higher. I'd heard this of course, and seen the Bayes math to show it's true. But nonetheless, it's just so counter-intuitive that it's hard to believe.

Enter computer science! Python, as with many things, makes it a snap to whip up a Monty Hall simulation. Then run it a hundred thousand times and voila, we have our answer: and sure enough, 2/3 of the time, switching gave us the car, while only 1/3 of the time did staying with our first pick result in a hit. It's still hard to understand why... but the sim is pretty solid.

Here's the code:
http://pastebin.com/2KueJkf4

Here's a rendering of the pseudocode inside the montyPick function, the only non-trivial part of the simulation.
Given a randomized list of three doors:
Pick the first door
- if you chose the car, Monty opens one of the other two doors (both goats).
- if you chose a goat, Monty opens the other goat.
- set remainingDoor to be the one you haven't picked and Monty hasn't opened.
- if your initial choice was a hit, add 1 to the count of hits from staying. (this step could be done earlier if wanted)
- if the remainingDoor is a hit, add 1 to the count of hits from switching.

The outer loop just iterates this and shuffles the list, so each time you're getting a randomized list. I had initially randomized both the list itself and the pick, but I realized that was unneccessary and added unneeded code complexity as well as extending the runtime (though perhaps I could have eliminated this with some optimization).

And the results speak for themselves:

Out of 100000 trials run:
Trials won by switching: 66575 percent of total: 66.575
Trials won by staying: 33425 percent of total: 33.425


Tough to argue with! : )

Wednesday, April 18, 2012

All hands on deck! We're heading into the squall...

So, the ball is definitely starting to roll now and I scarcely have time for anything these days besides working, eating, sleeping and of course, studying. But that's good - productivity is a good thing, right? This is what gives me raison d'etre. Of course, my girlfriend is not quite as excited by my obsession. But this isn't my diary, so let's stay focused and update ye olde blog.

Notice that the number of classes in the list has suddenly gone way up! And next week it will go up again...

Progress:

  • Programming Abstractions: finished 5 out of 8 problems on the third problem set.
    • Despite a week dedicated to recursion in the lectures, there's only a bit of recursion included on this problem set (of the 5 problems I've done), so either the last three problems here are recursion-heavy, or the next problem set is, which would mean that I'm a bit behind in problem sets compared to where I am in the lectures. Which isn't that big of a deal. Anywho, I'm getting more comfortable in C++ but at the same time there are so many myriad things that Python seems to make so much easier. Not only are the data types much more opaque in C++, but, it's worth mentioning, more limited too - for example the "map" type provided by the CS106B library can only accept strings as keys, while the equivalent "dictionary" type in python can take anything. Also, while accessing substrings from either direction is a snap in python, it's a hassle and a half in C++. The iterator is also a big PITA in C++. It's amazing how much I'd been taking for granted in python. I suppose the tradeoff of that is a reduction in computation speed, but so far that's not an issue for me. Anyway, I certainly don't regret getting some practice with C++, and compared to other languages I'm sure C++ is as easy as python anyway.
  • Algorithms, Linear Algebra: no progress since the last update :(
  • Udacity CS212: Design of Computer Programs: watched through part 14 of unit 1.
    • I'm excited by this course, but I'm a bit miffed by the somewhat ill-defined nature a bit of the programs have taken. The lecturer has a bit of a loosey-goosey way of doing things when he's explaining, and I wish he'd be a bit more precise. That said, I think there's a lot to get out of this class. I expect to see lots of the same kind of stuff that I encountered on my own when programming my FreeCell implementation, but handled in a more thorough and structured way - plus all of the peripheral knowledge that will come with it.
  • Udacity CS253: Web Application Engineering: watched all of unit 1.
    • I expect this course to teach me a lot about what up until now I've mostly taken for granted about how the internet, specifically the client-server interaction, works. I expect it to complement the skills learned in CS262 very well. Thus far, there hasn't been too much new information since I already know the (very) basics of HTML. But there's some good info regarding the kind of information that servers use, etc.
  • Udacity CS262: Programming Languages
    • While the backbone of this course deals with building a web browser (which is incredibly interesting and exciting), it also so far has been spending a lot of time talking about more theoretical topics like regular expressions and finite-state machines. I find this theoretical stuff to be just as fascinating and I'm glad the course has a bit more of an academic feel to it than the other two, which seem to be more like practical (engineering) courses. But of course, time will tell.
  • Udacity CS387: Programming a Robotic Car
    • Along with Computer Vision and Machine Learning that are starting next week, this will be one of the three AI-courses I'll be taking this "term." How exciting!! The course thus far has been decently challenging, but I must say I'm not without complaints. Sometimes I feel he doesn't spend enough time on the math or the theory and the knowledge doesn't seem as deep because of it. I wonder if he's not trying to "sweeten" the course by removing rigorous mathematical discussion, which would be a shame in my opinion. On the other hand, sometimes the class is difficult but for the wrong reason - to wit, he tends to give a quiz right after he explains something. Instead of doing several examples to explain the concept, he hits the student with a quiz right after he's explained the theory, so in effect you're being asked to do the example yourself. This is fine in some cases, but really, in my opinion quizzes should be made after a thorough explanation and some examples have been given. This will help the student understand the material and see the thought processes to make, and it will avoid discouraging the student by giving them a problem they don't understand well and thus can't solve, and making them feel stupid for not being able to do so. As far as the actual course content goes, there's lots of interesting stuff. It seems that probability is absolutely central to the idea of AI, which isn't surprising. With that as a framework, localization and motion can be wrought up as probabilistic functions, with measurements and attempts at motion updating probability. It's neat. I hope and expect that if I have a good understanding of this class, the Computer Vision class and the Machine Learning class, and fill in whatever significant cracks are left (for example, by looking at the Introduction to Robotics lectures on the SEE site), then I'll have some really solid knowledge of AI. I'm very excited.

Right as I add a host of courses to my plate, I also find myself about to start my job full-time (next week, to be precise). As exciting as all of this is, I'm not a little worried as to how I'm going to fit everything in. I suppose we'll see.

Monday, April 16, 2012

Curses! Algorithms fail.

Well, so for the last couple of days I've been focusing on algorithms, not the least because it's the hardest subject I'm taking but also because I'm finding it quite interesting. Despite my lapse of giving up 2 points on the 3rd problem set, I bounced back to complete the 4th problem set with a perfect score, and in general I've been feeling pretty good up about the course.

Then suddenly, a link on the course webpage caught my eye - "Programming Questions." Huh? What's this?

Dun. It's 3 weeks of graded homework assignments that I hadn't been doing - plus a fourth one for this week. Urgh. I guess for some reason I had tunnel vision for the word "problem set" and didn't think there could be other graded work. Well, lesson learned and no sense crying about it. Besides doing the programming question for this week, I also have attempted to finish the other three I hadn't done, and now I've finished two of them and I'm inches away on the third.

As one might expect, these problems involve the actual implementation of some of the algorithms taught in the course, which is indeed nice to have the experience of. As I've learned, it's one thing to learn a high-level description of an algorithm in class, and quite another to translate that into working code. Oftentimes little things like how best to represent your data are big issues. Another is how that data changes - what should you change at the nuts-and-bolts level when you make a change like collapsing one node into another that's easy to understand at the high level? Anyway, it's interesting, but not a little frustrating. Anyway, here's the code for two that I've finished. I got full credit on problems 1, 3, and 4, but because 1 and 3 (and 2 when I finish it) are late, they only get half-credit. :(

Problem 1 - counting inversions
Problem 3 - calculating mincuts

OK, so a full update on progress. It wasn't all algorithms; I also got some Linear Algebra done.

Progress:

  • Programming Abstractions: watched through lecture 10.
    • The recursion topic, though not really new to me anymore, is still easily one of the most difficult for me to grasp intuitively. This is mostly true on the practical front - writing working code - but also on the conceptual front. So, I don't feel my time is wasting watching these lectures. But I'm still kind of skipping through them, as there is a lot of repeated information.
  • Algorithms: watched the remainder of section IX and all of section X. Completed problem set 4 and programming questions 1,3, and 4
    • In addition to the lengthy description above, I'll note that graph search is somewhat difficult in concept but is also very interesting. It seems like there must be loads of cool stuff to learn in graph theory.
  • Linear Algebra: completed problem set 2.
    • This is definitely the slowest-progressing class of the three. I hope to improve that and would say I aim to, but at the same time, there's a lot on the horizon and I'm not sure how much my available time for this class might wane as the new slew of courses begins.
Coming up:

Coming up is actually a lot! It's April 16th now, so all of the Udacity courses are going to start. And then on April 23rd, a new list of Coursera classes begins. There's hardly a course in those two lists that doesn't seem incredibly interesting. I hope to take most of them, and I hope I succeed therein. A lot of these are "periphery" classes when considered in the framework of a CS major, but are hardly periphery to the core of computer science. To wit, the planned course list is:
  • Udacity:
    • CS212: Design of Computer Programs
      • Looks like it focuses on some key ideas in structuring larger-scale programs. Awesome
    • CS253: Web Application Engineering
      • Learning how to design web apps like a blog, and the associated stuff like user accounts. This one could be huge for any sort of business ideas or who knows what. Awesome awesome.
    • CS262: Programming Languages
      • I'm not sure how far it will go into the theoretical aspects of programming languages, but at the very least it teaches you how to build a web browser - wow! This knowledge seems to tie well into both of the above courses in that a central idea of programming is tying together disparate sources of information like HTML vs JavaScript, etc. Awesome awesome awesome.
    • CS373: Programming a Robotic Car
      • I was enrolled for the previous edition of this course but due to time demands and doubts about my level, I didn't actually do any of the class. Now once again I might skip this one, but I should be covering it either way through the machine learning class I hope to take at coursera. I'll start with both of them and pick the one that seems better - who knows, it might be both.
    • CS387: Applied Cryptography
      • This one seems very cool and I'd certainly like to learn cryptography, not only for practical purposes but it seems like a really neat aspect of mathematics. However, I must admit that if one course were to be knocked off, it would probably have to be this one because it's the least "essential" as in, what I feel I really need to know. I was going to say I'd try it out, but on second thought it seems clear that the time would be better spend elsewhere..
  • Coursera
    • Computer Vision
      • What to say - this is what I'm the most interested in! At a very abstract level, I find this topic fascinating, and I would posit it's what I'm the most interested in studying. But, I really don't know the first thing about it. So, enter this course - I hope it's a good one.
    • Machine Learning
      • The natural component to computer vision, all under the AI umbrella. I'm definitely looking forward to this one. I'm not sure how much this one, computer vision, and the self-driving car class will overlap. If it's a lot, one of them might be forgone. Otherwise, it'll be a crash course in AI - hope it lives up to the hype.
    • Lots of courses that I wish I could take!!
      • Cryptography, probabilistic graph models, automata, natural language processing, logic... all in good time, I hope.
Looking over this list, it seems almost certain that I won't be able to handle all of this. This plus abstractions and linear algebra would make more classes than days in the week. I have to work out what my priorities are. One option is really focusing on the AI courses - vision, robotic car and machine learning - and letting the other ones go, or at least myself be lazy with them. Cryptography is probably gonna get the axe. Looks super cool, but it can wait. Plus, there's a coursera version that seems like it might be a little more rigorous.

Excited - but nervous - for what's coming up!

Tuesday, April 10, 2012

Updates 4/11/12

After a bit of unproductivity, I hope I can get back into the swing of things.

Progress:
  • Programming Abstractions: watched lecture 8, finished problem set 2.
    • They began the topic of recursion in lecture 7, which I was surprised to see as I would have thought it would have been introduced in the first term. Lecture 8 dealt entirely with recursion and pretty much covered stuff I knew already, so I just skimmed it. There was a nifty recursive counting (nCk) algorithm they showed that was interesting, but mostly I had seen all of it. The problem set was, like the first one, pretty basic and seemed mostly geared towards just getting students used to the basics of C++, particularly the data types that they use. The last problem was a lot of busy work IMO, with a bunch of if statements. Though, perhaps there was an easier way to implement it; in Python I could have used a few try/except blocks instead of explicitly writing out all the if statements. Here is my code: http://pastebin.com/6dL3FDqW
  • Algorithms: watched second video of VII, first two videos of VIII, and all but the fourth video of IX. Did problem set 2, albeit with a mistake that cost me two points.
    • I ended up having a lot of things come up that cost me valuable time, so I was unable to give the problem set the time it deserved or even to watch all of the videos I wanted to. All that to come.
  • Linear Algebra: watched through lecture 7.
    • Thus far, I'm still finding the idea of subspaces quite understandable, and I'm finding that bit by bit my intuition for matrices is building. It's still not at the level I'd like yet, but it's encouraging. Next up is to do problem set 2, which I may or may not be behind on schedule-wise.
I've gotta run so I'll skip the to-do section. Mostly it's pretty obvious. One thing that I definitely have to do - what a chore - is GRE study. Also I need to register for the test.


Sunday, April 8, 2012

Updates 4/8/2012

Unfortunately this has not been the most productive week as of yet. My long vacation finally ended and my new job started up, albeit in a still somewhat restricted capacity. It seems that this job will allow me a fairly large amount of free time so it should still be possible to maintain a very productive schedule - but nonetheless, the job and certain other exigencies prevented me from getting much work done Thursday, Friday or Saturday. I got some quality study time in today, however. Well, let's see where we are now.

Progress:

  • Programming Abstractions: Watched through lecture 7.
    • Lots of interesting new data types being introduced. It's largely stuff that's part of the course-specific libraries, but nonetheless a lot of it looks interesting. Basically I'm seeing counterparts to a lot of the fundamental data types that are included in python like  lists ("vectors" in this class) and dictionaries ("maps"), and some new data types like the LIFO-vector type "stack" and the FIFO-vector "queue", as well as a fast-access unstructured array called the "set." The lecturer gives good examples of all of them, and I wonder if I might at some point find C++ as easy or easier for certain things than python.
  • Algorithms: Watched through the third video of section 9.
    • More operations on arrays, namely selection algorithms (such as the canonical "find the ith smallest member of a set") and graph theory (minimum cut problem) that both make use of randomized algorithms, much like the QuickSort algorithm.
  • Linear Algebra: Watched lecture 6.
    • With the somewhat tedious subject of manipulating matrices seemingly covered, it seems we're ready to dive into the more theoretical concepts in linear algebra. He started talking about subspaces of a space, which is an interesting topic and one that is perhaps ironically much easier for me to grasp than figuring out how one matrix will multiply another - although I'm getting better at that too.
  • Udacity 101: Watched final 2 units of the course. Took the final exam, minus the starred problems.
    • The final part, which was an explanation of Google's PageRank algorithm, left me somewhat confused. I feel like the explanation of the derivation of the terms in the algorithm was presented very quickly and without adequate time spent on saying what each term was doing and why the equation had the composition that it did in the end. I might rewatch them to see if I get a better idea upon second (more like third) viewing. Otherwise, the class was lots of fun and I'm glad I took it. I felt that the final exam was pretty easy, although I haven't tried the starred (bonus) problems. The first starred problem on the final exam looks quite a bit like some of the graph theory we're being introduced to in algo. I might give those problems a try, though time constraints might prevent me.
  • GRE study: began some practice problems in the vocabulary and reading comp sections. 
    • The reading comp problems are really unnecessarily weasely in my opinion. They're worded like riddles and that seems to be their primary value (although, for riddles, they're hardly amusing). I suppose a law student would be expected to ace that kind of thing, as the sort of subtle differences it's asking you to identify is the kind of thing that in my opinion would really only be relevant if you're looking for loopholes in legal language or some other kind of quibbly pursuit.



To do next:

  1. Programming Abstractions: at least get started on problem set 2.
  2. Algorithms: problem set 3 is due tomorrow, and there are also a few lectures I still need to watch to cover the proper material.
  3. Linear Algebra: get started on problem set 2, read appropriate sections of the book
  4. GRE: more practice problems. Try writing some of the essays. Get registered for the real thing next month.
  5. Figure out what course is going to take the place of the Udacity course. It's somewhat of a moot point as there will be a whole host of new classes starting around April 16th, but nonetheless. Perhaps the discrete math would be a good fit for this, or I could simply decide to use the time towards existing classes.
  6. Finish the FreeCell game, at least up to the point of a text-based implementation.

Wednesday, April 4, 2012

Progress on a FreeCell game!

I'd been thinking about if for a while but at last I got around to something a little fun: a freecell game. I was going to do it in C++, but... Python is so frickin EASY! Plus, the class inheritance system is a really nice advantage with this kind of thing. Here's what I have so far.

http://pastebin.com/NiH02qE9

The mechanics of freecell are really quite simple and almost trivial to write, so it didn't really take me long to write the move functions (no longer than it took me to write out all of those card name variables, etc...). All that really remains, besides bug testing, is fleshing out how it's all displayed. In the beginning, unfortunately, it'll be all text-based... but hopefully I can get something that's decent. I doubt it'll be a real blast but, hey like they always say, food tastes better if you cook it yourself. If I can get something working, I'll be happy. And then, maybe I can work on some solving algorithms. :D

Class progress updates:
Linear algebra: Watched first half of lecture 5.
Udacity 101: finished unit 6 and completed the final exam. I'm essentially finished here, but I might do the final exam bonus questions, and watch the videos in the last segment. I'm still a little fuzzy on exactly what PageRank does. I'll have to figure it out.

Monday, April 2, 2012

Updates 4/2/2012

(Sorry that my titles are getting repetitive. It's hard to be creative in this regard.)

Yesterday turned out to be a very productive day. As I noted in my previous entry, I had watched a lot of lectures from the algorithms class and completed the 2nd problem set. I also finished lecture 4 of Linear Algebra and before I went to sleep, I powered through the first problem set of the class. I was somewhat lazy on the problem set and didn't exactly nail all of the questions, but I was able to at least feel like I understand the material at some level. (It's still not my cup of tea, that's for sure). After waking up today, I got through unit 5 of the udacity 101 class (which mostly dealt with hash tables), and I'm now on unit 6, which seems to focus on recursion - my old nemesis. Although judging from the difficulty level of the class so far, I don't think it's going to challenge me as much as, say, the dynamic programming assignment from MIT 6.00 did (I think the stress of that problem set probably aged me a year or two - shiver).

Progress:
Introduction to Computer Science: 19 lectures, 10 problem sets
Programming Abstractions: 5 lectures, 1 problem set
Algorithms: 6.5 lecture sections, 2 problem sets
Linear Algebra: 4 lectures, 1 problem set
Udacity 101: 5+ units
Discrete Math: 1 lecture

My rough plan for the day is to try to finish or at least make significant headway on unit 6 of the udacity class, to play around a bit in C++ (perhaps do some preliminary work on a FreeCell implementation), and to watch another lecture from the discrete math class. If I have time, maybe I can squeeze in another Linear Algebra lecture.

Updates...

So it's been a few days... productive in many ways, though still perhaps not as productive as I would have liked.

Progress:
Watched through lecture 5 of Programming Abstractions. Completed first problem set but skipped last problem, which dealt with a memory diagram (Note: to address this deficiency in my knowledge, namely stack vs heap memory allocation, I watched lecture 14 of Stanford's Programming Methodology course. It was very informative. I might watch some more videos in this series to shore up whatever gaps exist in my basic programming knowledge. Side-side note: Java looks pretty interesting. I like that everything is an instance of an object. Python is similar of course, but maybe wears it a bit less on its sleeve. Well, like I said before, I'm sure I'll get around to Java sooner or later.)
Watched through section VI of Design and Analysis of Algorithms, and the first part of section VII. Completed second problem set. Once again I was able to get all answers correct. Yay. (Note: I'm worried I'll run out of space in the notebook for this class. Many notes have been taken.)


Unfortunately, this is the extent of my progress since the last update. It's not shameful but I'd like to be doing more. I still have yet to finish lecture 4 of Linear Algebra or complete the first problem set in that class. I hope to do at least one of those and ideally both before I go to sleep today. I also would like to get back to the udacity class before (a) I get too far out of the loop or (b) the class ends without me having completed it.

Next on the to-do for the next two days:

  1. Linear Algebra lecture 4 and problem set 1. Watch lecture 4.
  2. Finish unit 5 of Udacity's 101 class. If motivated, also watch unit 6 and maybe even 7.
  3. Review basic combinatorics, probability and distributions. Watch second video of section VII of Algorithms.
  4. (maybe?) start planning or thinking about a computer implementation of FreeCell, possibly in C++ (Python would be easier, but I could use the practice. Also I can try out new data types like the Queue or Stack in C++).


Aside: I'm becoming a total Stanford fanboy. The quality of lectures is overall amazing, the research is exciting, and they have the further positive of really having embraced the online-lecture paradigm, perhaps more so than any other major institution besides MIT. I can say with high certainty that Stanford would be my #1 pick for graduate school were I to get that opportunity, whether for a master's or a PhD.

Thursday, March 29, 2012

Some updates...

So I wasn't super productive in the last couple of days, but I did manage to watch some lectures and do a little work.

I did a bit of re-thinking of my schedule. During some of my GRE study where I encountered some combinatorics and statistics, I decided that perhaps taking some classes that addressed this would be a good use of time, so I entered a bit earlier than I thought into the Discrete Math course from ArsDigita that I was planning to take. How much I treat these as equal to my other classes remains to be seen, but at the very least it looks like a fascinating course, with a wide range of subjects covered.

I also briefly thought that perhaps I wasn't taking the right class to satisfy my Data Structures requirement, and I considered switching from the Stanford CS106B course I'm in now to the Berkeley 61B course, which has the benefit of being specifically titled "Data Structures." But after looking at the syllabus and seeing a fair amount of overlap with 106B, I decided to stick with that one. Besides the fact that I'm already a few lectures into 106B, it has a few benefits as well. For one, it seems to be a slightly more complete course, with problem sets, libraries, handouts etc all readily available. For another, it's good to learn C++, even if it's somewhat of a PITA compared to Python (that feeling has diminished slightly since I've gotten going, but it still is more cumbersome). The 61B course teaches Java, which no doubt is worth knowing as well, but while I can be quite confident that it's worthwhile for someone who only knows Python to also learn C++, I'm not so sure the same thing holds with Java. I don't really know that much about Java, but from what I do know it seems to be quite similar to python, both being high-level object-oriented programming languages. On the other hand, there are some courses I plan to take which involve Java so I'm sure I'll pick it up sooner or later. I hear it's syntactically similar to C++ anyway.

I watched the fourth lecture of 106B and did another problem (problem 2) of the first set. Here's the code for it:
106B Problem set 1, problem 2: http://pastebin.com/nwpTu6yW

Like I mentioned I've begun to be a bit more comfortable with C++. I still forget to initialize variables and put in the semicolons at the end of the lines, but all in all it really isn't shaping up to be that different than python deeper than the surface. There are a few exceptions - for example, python has really handy data types like lists, tuples, dictionaries etc which are very simple to understand and manipulate, and are also incredibly powerful. C++'s data types seem to be a bit more restricted, or perhaps just a bit more obcure (third option: I just don't understand them well enough yet). The new data type at work in this code is a struct, which is somewhat like a very anemic class object that only contains variables and not functions.

I watched lecture 3 and partway through lecture 4 of the Linear Algebra class. I'm working my way through the first problem set and about 2/3 finished. I'm finding it difficult to get an intuitive grasp on how matrices work. The lecturer obviously has no trouble looking at two fairly complicated matrices and seeing immediately how multiplying one into the other will result. I'm not at that level as of yet. But I've been able to figure out some basic concepts of my own which are helping me understand it.

Rules for LR = F, where L, R and F are two n X n matrices:

  1. The kth row of F depends on all of R but only the kth row of L.
  2. Similarly, the ith column of F depends on all of L but only the ith column of R .
  3. Think of L as a bunch of n-vectors laid out horizontally. Think of R as a bunch of n-vectors laid out vertically. Matrix multiplication is a bunch of dot products between the vectors in L and those in R. 
  4. In order for a dot product to happen, two vectors must have the same number of elements (namely n), which is why the horizontal length of L must match the vertical length of R. The other dimensions are independent.
It's still a work in progress, but this kind of thinking helps me a bit.

In the Algorithms class I watched the explanation of the Master Method, which is interesting. I have to admit algorithms have yet to really spark my enthusiasm, but apparently they're the bee's knees for a lot of computer scientists, so we'll wait and see. 

I haven't visited udacity in a few days, so I'll probably go today. At some point when I've cleaned up the code, I hope to upload the web crawler code I've written. I'm mostly using the same concepts as taught in the class, but I'm using object-oriented programming, with objects like web pages, keyword dictionaries, etc. Fun stuff.

Random musings, unexplored ideas:
I'm curious if there's a fast algorithm for finding prime numbers.
In a physics tangent, it occurs to me that the reason objects under a damping or friction force stop, instead of slow down asymptotically like models often show, must have to do with some sort of energy well - if the kinetic or other relevant energy decreases below the threshold of a given energy well, the object won't proceed. Consider a ball rolling over a rough surface. Initially its speed will decrease smoothly, but at some point it won't have the kinetic energy to pass over some pit or hill on the surface it's traversing, and its speed will decrease from some non-zero amount directly to zero. How non-smooth the end of this curve is will depend not only on initial speed, but also on the relationship between the geometries of the surface and the ball.

Tuesday, March 27, 2012

My lesson plan

I shared what I have done up until now; at this point maybe it would be nice to share my tentative plan of what I'm going to study over the next year.

With the rise of free online lectures provided by the likes of KhanAcademy, TheNewBoston and of course a variety of universities like MIT, Stanford, Berkeley and IIT Kharagpur, there really is an embarrassment of riches to be found for a self-learner, and if anything a problem is that it can be simply too much to choose from. Right now I find myself on vacation from work for a few weeks, and I still don't feel like there's nearly enough time in the day to cover all of the courses I'm taking now, let alone all that I want to take. But as is often the case, the first step to success is a plan; even if you don't know the best way, simply having a plan in mind is said to be helpful. So here we go.

Since I'm looking to enter graduate school, it would seem natural to want to cover the content of an undergraduate computer science education. Unfortunately, there is a wide degree of variability in such majors, both between schools and within the same school, based on a student's goals. Listing every course taken by computer science undergrads, let alone grad students, would be futile. But at the absolute basic level, they seem to share some fundamentals:

Computer Science topics:

Introduction to Computer Science
Data Structures and Algorithms
Computer Organization
Systems Programming

Mathematical topics:
Discrete Math
Linear Algebra
Probability and Statistics


From what I've seen looking at various department websites, these seem to make a fairly solid base. I start from here and then add on what I find particularly useful/relevant to me. The field I'm most interested in is artificial intelligence, computer creativity and computer vision. Basically I want to design the brains of a creative robot. So, things that are most relevant to me are things like artificial intelligence, machine learning, differential equations, digital signal processing, natural language processing, and the like. There are also a few I've starred (*) to indicate things that perhaps might not be essential, but that I'm just interested in.

So let's expand our list. In addition to what we had before, let's add some. Note that with some of these, the distinction between math and CS is a bit blurry.

Computer Science topics:

Introduction to Computer Science
Data Structures and Algorithms
Computer Organization
Systems Programming

Artificial intelligence
Machine learning
Natural Language Processing

Mathematics:

Discrete Math
Linear Algebra
Probability and Statistics

Differential Equations
Digital Signal Processing

OK, we now have quite a lot on our plate. But this still isn't everything that I want to cover - I'm also interested in program design, smartphone and web application development, computer music and algorithmic composition, and others, so we'll just have to find a way to accommodate as many of those things as possible. So, let's turn our course outline into a plan of online courses to take. We'll get to ordering and scheduling later. For now I just want to know that all of this stuff can be covered with existing online lectures. Here we go:


Computer Science topics:

Introduction to Computer Science
I've already taken two classes in this vein, the 6.00 course from OCW and the CS101 course from Udacity. With such a broad topic, practically anything that adds fundamental programming knowledge helps, so after this point I won't really worry too much about satisfying this requirement specifically.
Data Structures and Algorithms
I'm taking a really good-seeming Design and Analysis of Algorithms class from the Stanford Coursera website. It doesn't seem to cover data structures, but the Stanford Programming Abstractions class I'm taking, I believe, does address that. If not, then we might have to find something else to cover DS, but for now we'll consider this base being covered.
Computer Organization
I admit, I'm not to excited about this class. The inner workings of computers don't interest me nearly as much as what those workings can accomplish. But just for completeness, let's find a course on this. The Berkeley 61C course - Machine Structures would seem to do the trick.
Systems Programming
Here we turn again to Berkeley, as they seem to have a nice one there called Operating Systems and Systems Programming. Once again I'm not to psyched about this class, but if I want to develop for an OS, it would seem to be necessary.

Artificial intelligence
The free AI Course offered by Stanford looks nice, although I'm not sure I'll actually be able to access it. I suppose we'll cross that bridge when we come to it. Alternatively, I can take the robotic car class from Udacity.
Machine learning
Stanford's SEE site has a Machine Learning class that looks great!
Natural Language Processing
Once again, it's Stanford to the rescue with their Natural Language Processing course. As I'm looking at the course list on the SEE website, I notice that it might be best to take the natural progression of three courses beginning with Introduction to Robotics. Once again, we'll wait to cross that bridge.

Mathematics:

Discrete Math
The Berkeley one of this seems nice, and broad-ranging.
Linear Algebra
The one I'm taking right now, 18.06 of OCW, fits, but there's a further one I'd like to take if I can, which is introduction to linear dynamical systems at Stanford.
Probability and Statistics
For now, I'm looking at the Probability and Random Processes lecture series from NPTEL. But I might want to switch to another course that has accompanying homework assignments. We'll see.

Differential Equations
The 18.03 course from MIT seems ideal.
Digital Signal Processing
MIT to the rescue again, with their eponymous course.


OK, there we go! Let's see how it shakes out.

First assignment in C++

I feel like my real first assignment in the Stanford 106B course was just getting a working compiler set up. There were library issues... it was a process. It really makes one value Python. Oh, I know C++ has its advantages over Python, but on the other hand, for the kind of programming, I doubt many if any of those advantages will be relevant. But whatever.

My first assignment completed, I move on to the first "true" assignment, which was the first one of problem set 1. This asked me to write a function that would remove select bits from a string. Here's what I came up with:

http://pastebin.com/K8c6qLb7

I initially wrote it with a cin command instead of fgets. This was OK but it crashed when I input a string with whitespace in it. I asked the good folks at my hangout openstudy.com about it, and they told me to use gets, but then another said that gets should be avoided in favor of fgets. So, that's what I used. My choice of 200 characters is quite arbitrary; I feel like it's long enough to incorporate most sentences so that's what I did. Anyway, it works. Here's an example output:

http://pastebin.com/aC2WXMFa

Monday, March 26, 2012

The beginning: better late than never

Introduction:

This is a blog for me to track my progress as I try to become a computer scientist beginning at age 26. I don't know how extensive this blog will be, but I hope that I can keep it up long enough to be meaningful to me and to whomever might read it. If things turn out ideally, perhaps reading this can be a source of pride for me and inspiration for others. If not, at best it will be interesting and at worst, embarrassing.

I might as well start with an introduction. This will be long and will probably not be worth reading unless you really want to get to know me, or my story. But I suppose it will help understand where I'm coming from. The "short version" is that at age 26, I suddenly realized I wanted to be a computer scientist. The long version is below.

Background: 1985-2007

I come from an accomplished family. My father was a MIT PhD and a professor at the Booth school of business at the University of Chicago (he passed away in 1995, when I was 10). His father is a Harvard PhD and an emeritus professor. My mother was college-educated, and is currently in graduate school at age 53. My sister is in medical school. My brother is soon to enter a biology PhD program.

As for me, well on the surface I don't seem so unaccomplished. Like my siblings, After graduating from a top private high school, I attended the University of Chicago, receiving a degree in Physics with General Honors after four years. But while I was there, I didn't really apply myself, content to work in an easy and (relatively) lucrative summer job instead of finding research positions; content to sit in a major that I knew I could do, even though it didn't excite me.

Fast forward. In the five years since I graduated, my sister has piled weighty accomplishments like post-bac degrees and Fulbright scholarships onto her resume and entered medical school (a top 10 one, and she's on a full scholarship), and my brother has been accepted into a biology PhD program, with full stipend of course. But I've been floating about like a boat in an eddy.

After Graduation: 2007-2009

Having no great love for physics, doubting my own abilities thereof (despite decent grades), and no research experience to boot, I didn't think to seek a position in a physics lab, or even at some company that could use a physics major. Instead, after graduation I somehow found myself a biology research position. Coming into the job with no experience, I managed to convince myself that I would summon both the motivation and the passion to learn what I needed to know, and succeed in a difficult research field. As it turns out, I was optimistic.

I had neither great aptitude nor great love for immunology. I learned enough to do my job (more or less), but I didn't find that spark that made me stay up late reading papers and textbooks, or plan new experiments while daydreaming at lunch. When you're in research, drive is as important as ability and knowledge - more so even - and I had little ability, less knowledge and even less drive.

After initially being hired with the possibility suggested that I might enter a PhD program after two years, when the time had elapsed, it was mutually understood that I wouldn't be working there any more. Seeing the end approaching, I dithered a bit thinking about what job I should do next, and then hit upon teaching abroad. I had studied Japanese in college, and I was always seeing those internet ads calling people to teach English. Why not? I wanted to be a teacher, I wanted to become fluent in a foreign language, I was interested in Japanese, and I needed a job. So after spending perhaps all of 15 minutes googling "teach English in Japan" and the like, I had found a company and applied for a job. A month later, I had been interviewed and accepted. Then I stopped worrying; I had a job, and that was all that mattered. Future? What future? It was all so far away anyway.

Doldrums in Japan: 2009 - 1/2012

Thus the Japan chapter of my life began, a chapter I'm still in now. I've been here for a bit over two and a half years now, teaching English. The salary is nothing amazing but it's enough, and the workload is very light - too light. In fact, you often feel completely worthless, as your job consists largely of sitting in the teacher's office pretending to be working (the job is technically an "assistant teacher" job - you're not actually responsible for a class' education). Perhaps it was this useless feeling that woke me up, but I'm more inclined to believe it was just a motivating factor. See, I had been in this job for a bit under two and a half years - until about January of this year - before everything changed. Although I had kind of a joke job, I was content with that, complacent. I had everything I needed for the time being, and I always boasted of being a non-planner; whatever happens, happens.

So what happened then? Well, to begin with, I don't have many friends here. I'm somewhat of a quiet, reserved guy, and on top of that I'm in a foreign country. So my number of close friends is quite small. Really, it's one - Noboru, a Japanese guy who's a co-guitarist in a band I'm in. Noboru and I get along famously, practically buddy-comedy levels. We hang out all the time, and there were many times when he was the only thing keeping me sane in Japan. But in January of this year, Noboru suddenly sent me a text message: "I've decided to quit my job next month." A further text: "I'm going to move to Australia and learn English." I was stunned. He had always complained about his job, a high-level position at a small instrument maker, but had never really indicated he even wanted to quit. He had been there for almost 10 years, had achieved a good deal of seniority, and made a good amount of money. Why did he want to quit? He told me he felt like he wasn't accomplishing anything, that he needed to do something that was meaningful. He said he always wanted to learn English, and at close to 30, his window of opportunity was closing. Furthermore he surprised me by telling me that he envied me; he envied that I was living abroad and learning a foreign language, that I was chasing my dream.

Except, I wasn't chasing my dream. What was my dream? I didn't have one. I just existed. I went to work, got my paycheck, went home. I never thought about the future because it was too unknown, and not the least bit exciting. In all of the emotions I felt in that time, like surprise and worry and loneliness, the biggest of them was jealousy. My best friend was going to be leaving, and even though he was older than me, though he was leaving behind a lot of money and security for an uncertain future, I felt jealous. But now I was woken up. The only thing missing was me knowing what my dream was.

Discovering What I Want To Do: 2/2012

Luckily, I didn't have to look too far. I've long been a listener of science podcasts, and on one of them, I heard someone discussing some of the cutting edge technologies that suggest what is around the corner in our scientific advancement as a species. Things like nanotechnology and genetics were interesting, but one stuck out especially: artificial intelligence. Specifically, it was the discussion of a robot built by Hod Lipson at Cornell, a robot that taught itself to walk, and could deduce equations from looking at data. It was fascinating. Hearing about it, I found myself thinking about all of the questions that I had, and lamenting that I didn't have the knowledge to better understand the research and the kind of things I was interested in. And maybe it was all timing, but that's when I realized I wanted to be a computer scientist. With my friend leaving, my life was at a crossroads. Knowing that I would soon be alone, simple routine and complacency were not an option. I had to think about what I was going to do, and this was it. I wanted to study AI.

But then the $64,000 question: now what? I need to learn. I decided that I wanted to get a PhD, but what school will accept me? I have a math background in the form of calculus from my physics education, but besides general savvy and a Scheme course in high school, I had nothing of computer science education. As a high schooler, I had flirted with the notion of learning programming, but being bored with learning to write simple functions when what I wanted to do was make video games, I never went far. Now, I was 10 years behind the curve. I contacted various professors looking for research positions, but as one might expect, my anemic resume didn't impress many of them. So, I figured I would have to go back to school. I briefly looked into various computer science master's degree programs, but my realization had come just a hair too late for the application periods of most schools. It would seem that I have at least a year to wait.

Self-Education begins: 2/2012 - Present

But at the same time, that's an opportunity. I have a brain, the internet, and a lot of free time. I have a decent job and low expenses. I can study and I can save. So now, for the first time in years, I have a plan. Study. Save money. Apply to CS master's programs late this year. Enter school in fall of 2013. Do research while getting my master's. Apply to PhD programs probably late 2014. Get my PhD 4-5 years later. Naturally, the further out I project, the foggier things get. But I don't to see the future; I just have to focus on doing the right thing now.

So, that's the story. Although I was long-winded, I left a lot of things out. What's pertinent now is what I'm doing to educate myself, and hopefully that's what the blog will focus on. I'm incredibly fortunate to be living in a time period where education, especially computer science education, is so widely available at a high level for free on the Internet. I can only hope and expect this will continue to expand as time goes on.


_________________________________________________________


Progress Overview:

So let's enumerate what I'm taking.

My first class was the Introduction to Computer Science course (6.00) on MIT's OpenCourseWare site: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/. I began this class on February 3rd, 2012. The course is in python, which is great because it's not only a super easy language but also widely used. The course taught or touched on a lot of fundamentals, like big-O notation, recursion and dynamic programming (still a nemesis for me), object-oriented programming etc. Doing the stuff in this course made me feel confident that at the very least I could do this. I've even tried some projects of my own; python is so easy to use. I've completed up through the 10th problem set, but at this point I somewhat feel that I've accomplished most of what I need to from this class, so I've since branched out. I might return to the class at some point to finish the remaining two problem sets, but who knows.

Now, I'm taking four classes:

  1. Stanford's Programming Abstractions (CS106B): http://see.stanford.edu/see/courseInfo.aspx?coll=11f4f422-5670-4b4c-889c-008262e09e4e
  2. Stanford's Coursera site's Design and Analysis of Algorithms 1: https://www.coursera.org/algo/lecture/index
  3. MIT's Linear Algebra (18.06): http://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-spring-2010/
  4. Udacity's Building a Search Engine (CS101): http://www.udacity.com/overview/Course/cs101/CourseRev/feb2012


From here on I'll refer to them by shorter names. Here's the progress I've made in each:

106B: Three lectures, completed first problem of first problem set.
Algorithms: Watched three sections, completed first problem set.
Linear Algebra: three lectures
101: Watched about 4.5 units, various homework problems.

Comments on the courses thus far:

  1. I don't really know what to expect from 106B. I decided to take because it seemed like a logical "second programming class", and because it teaches a bit of C++, which seems like a useful language to know. Beyond getting used to the different syntax and other differences from Python, getting a C++ compiler working and with all of the libraries and whatnot was a big pain. I seem to have reached a stable state in that regard, but I continue to be wary. I can tell why Randall Munroe wrote a comic praising the simplicity of Python - it really is quite amazing, at least compared to my limited experience with C++. As for the class itself, like I said I don't really know what to expect. I hope they extensively cover data structures because I know that's a fundamental area for CS students to cover.
  2. The algorithms class seems interesting. The professor, Tim Roughgarden, has this somewhat CS-cool-badass attitude to him. His teaching style is clear but he speaks very fast and I often find myself having to rewind to gain a full understanding of what he's saying. Some of this has to do with my choice to take copious notes during all of these lectures (except for the udacity ones). It might seem silly to take notes on a pre-recorded class, but it's something that I've done since college and I find that if I just watch and don't write anything down, I often don't retain as much information. It's nice that videos lend themselves well to this. As for the course content, I've been able to understand everything so far and I got everything correct on the first problem set, but I wonder if things are about to get a lot more complicated. Maybe it's just the attitude of the professor that contributes to this. Not in a bad-way, but I feel like sooner or later he's going to cover some really complicated stuff and just breeze through it.
  3. I had settled on taking the MIT linear algebra course and bought the textbook - rather expensive, although average for a textbook. Then I found a class on Stanford's SEE site (same as the programming abstractions class) that was a more applied version, so I though to take that. But after a few lectures of that one, I determined that it was a bit over my head, so I switched back to this one. Glad that I'm not wasting the money I spent on the textbook. There are lots of math classes I plan to take - the three key ones being linear algebra, probability and statistics and differential equations. After I cover those bases, or at the very least after I finish this linear algebra class, hopefully I can return to that Stanford class and understand it all. The MIT professor Gilbert Strang is a good teacher, with some endearing mannerisms (for example whenever he's finished some thought or section, he says "OK" with a degree of finality as if to say "well you guys should understand that, so let's move on"). It's still somewhat difficult for me to conceptualize matrices - how they act on each other, what they mean - but with time and effort I expect it will get better.
  4. The 101 class hasn't introduced much new knowledge, but it is a lot of fun, and it's nice to have immediate practical use for what you're doing, instead of the more pedagogical feel of most of the other classes. And I'm really excited about some of the other classes coming up; I've enrolled in just about all of them so come April 16th my class load will increase a lot (but in a good way).