Category Archives: Personal Life

Algorithms: Design and Analysis, Part 1

So the latest Coursera course I’ve been taking and have now completed is Stanford University’s version of its Algorithms class by professor Tim Roughgarden. Apparently enough people asked about the differences between this course and the one from Princeton University that the question has now been addressed in the FAQ sections of both courses: the Princeton class focuses on implementation and practical programming with students in their first and second university years as the target audience. This Stanford version focuses on the analysis of algorithms and is usually taken by students in their third and fourth years.

I always knew going on that with a weak maths background, this course was going to be hard for me. It also didn’t help that I find myself much more interested in practical applications of algorithms than in studying and devising proofs of an algorithm’s correctness or performance claims. As such I didn’t put as much effort into this as I did for the Princeton course. Some observations:

  • The programming homework emphasizes actual implementations, with some tweaks, of the algorithms being studied. It’s a language agnostic course so you’re free to use whatever language you want. The professor just explains everything in pseudo-code while the homework provides a data set and you just have to type in the answers you get from processing the data for evaluation. I cheated. Having already covered much of the same ground in the Princeton course, which does provide complete implementations of all algorithms in Java, I simply used the Princeton library, tweaking code only as necessary to get the correct answers. For the most part, this made the programming homework very easy for me.
  • Th quiz portion was correspondingly harder for me. I found that I usually had a decent intuitive grasp of what to shoot for, but in many cases, lacked the discipline to thoroughly walk through the entire reasoning process. Especially since many of proofs requires a solid understanding of probability. The same goes for the final examination, which honestly speaking is slightly easier than the regular quizzes, but is timed and allows only a single attempt. We were allowed two attempts for each of the quizzes. I scored 32 out of 40 in the final exam. I did not attempt any of the optional and ungraded challenge questions.
  • I have to say that Professor Roughgarden’s lecture videos and study materials are very basic compared to the Princeton course. It’s just a talking head and slides, with no animations whatsoever. One major problem I had is that the audio frequently is not in sync with what is happening on the screen. For example, he would talk about something but when he refers to a mathematical formula or a snippet of code, it doesn’t show up on the whiteboard until a few seconds later, which certainly does not help comprehension. Also while he offers typed versions of the slides he uses as a download, he prefers the handwritten versions in the lecture videos, and his handwriting isn’t always perfectly legible.
  • I did appreciate the thoroughness with which he covers the proofs and I have to admit that I’m able to follow them much more closely than I did when professor Sedgewick went through them (which he didn’t always do in the Princeton courses. I still can’t say that it’s my favorite subject though.
  • As previously mentioned, the course does cover much of the same material so there was little here that I haven’t already seen before. I did appreciate learning about bloom filters. And after being frankly puzzled by the Kosaraju-Sharir algorithm in the Princeton course (easy to code, hard to intuitively understand) I really liked how professor Roughgarden’s explanations and the associated programming homework, allowed me to finally grasp it in my head.
  • I don’t believe that I ever saw any Community TAs in this course. By and large, as far as I could tell, the students did an excellent job of posing and answering questions themselves, with professor Roughgarden himself intervening only on rare occasions mostly related to technical problems with the course itself. I do find that the student body for this course appears more mature than that of the Princeton course, with few people posting frivolous questions or appearing to be completely clueless.
  • Certainly as the professor admits, the assessment system is currently the weakest part of the course. The course really needs a way to have students submit proofs and get them evaluated (which would have utterly defeated me I believe) but there’s simply no feasible way to scale anything like this. Also, the programming homework requires just an answer (usually just a string of numbers) without any of the performance and memory usage evaluations used in the Princeton course.

No surprise when I say that I prefer the Princeton course by a very large margin. But this is still an excellent, high quality course especially for those more interested in the analysis side of things. Incidentally I’ve been invited once again to serve as Community TA for the next offering of the Princeton course which should begin at the end of August.

 

End of Algorithms 2 class

Part 2 of Princeton’s Algorithms course on the Coursera platform officially ended last week but I haven’t had time to write about it until today. I gushed about the first part of the course in a post last year and this is just the follow-up. It was originally meant to be offered at the end of 2012 (and the lecture videos have dates indicating that they were indeed filmed last year) but due to apparent problems with finalizing the exercises and assignments, the course was only opened at the end of March of this year. My thoughts:

  • I thought that Algorithms 1 was the best educational experience I’ve ever had and part 2 only goes on to confirm it. It is amazing in all respects. Based on discussions on the online forums with other students, it is my understanding that no other course available on the Coursera platform currently can match its wealth of teaching materials. It has lecture videos, PDF copies of the slides used in the lectures, extensive exercises, very interesting programming assignments, the code on the booksite provides a vast amount of examples to look at and its fiendish difficult interview questions will challenge you for weeks after the end of the course.
  • As to be expected part 2 is markedly more difficult than part 1. I’m pretty sure that the graph structures we learn in the first weeks of the course are more complex than anything else seen in part 1. I note that the official forums were pretty much devoid of dumb posts asking for help with elementary topics quite early on. There were some posts talking about the difficulty of the material early on and then everything was down to business. I surmise that the initial difficulty curve scared off plenty of people.
  • Part 2 only has four programming assignments whereas part 1 had five but they are all much trickier. Many students had high praises for the week 2 assignment which involved implementing the seam carving algorithm invented in 2007 and now used in many graphics editing software. It’s not just a toy program either since our own implementations can be used as elementary clients to perform seam carving on our own photos. I also liked the WordNet project which uses graphs to capture the relationships between words in the English language and is apparently used as part of the core of many programs that need to understand English, including IBM’s Watson computer. The other two projects were implementing the Burrows-Wheeler data compression algorithm and using graphs in an unconventional way to figure out whether or not teams have been effectively eliminated in baseball (or any other sports) leagues.
  • The latter stages of the course become increasingly theoretical. For example the professors provide an implementation of a linear programming solver but admit that it is only a toy solver and stress that serious users should look towards industrial-strength versions. This contrasts with previous work in the course in which the textbook implementations we study are suited for general use. The course ends with a discussion on reductions and a look at the classic P vs. NP problem in computer science.
  • The exercises used share the same format as part 1 of the course. The main purpose seems to determine if a student can manually trace how an algorithm works on pencil and paper. But the final exam in part 2 is a surprise in that it has a strong focus on the theoretical. Several students posted in the forums to note that the final exam feels like it wouldn’t be out of place in Tim Roughgarden’s Design and Analysis of Algorithms course. This is great of course since theoretical questions like this really test whether or not you understand the algorithms in question in a deep and intuitive way but tests like this are much harder for me.
  • While I could complete all of the assignments and exercises with a 100% score and I scored over 90% in the final exam, I feel that the difficulty of this course comes close to hitting my limits of what I can do. For example, for some algorithms, such as the fiendish Kosaraju-Sharir, while I can certainly follow the implementation and trace its results, I find that I can’t quite wrap my head around why it works and hence a deep, intuitive understanding of it. Similarly, for the data compression assignment, I can implement it and get it to work perfectly and why it works the way it does feels like magic to me.

So yeah, I greatly enjoyed the time and effort I spent on this course. My next Coursera course won’t be starting until mid-June or so which means I have some free time on hand until then.

Learn to Program: Crafting Quality Code on Coursera

One of the MOOC courses I’m taking on Coursera, Learn to Program: Crafting Quality Code, has effectively ended. It was taught by professors Jennifer Campbell and Paul Gries of the University of Toronto. It is by a large margin, the most disappointing of the online courses I’ve taken so far. What follows is a long post that I wrote on the official forums explaining why I was disappointed with the quality of the course:

 

This post will probably be unpopular. Judging from the tone of the posts in this forum, this course seems to be well-liked by many students. Yet I note that for many of these posters the first Learn to Program, which I did not take, appears to have been their very first programming course. I disagree with that assessment and have a low opinion of the quality and usefulness of this course. I started this thread to set out my reasons for holding this opinion.

Continue reading Learn to Program: Crafting Quality Code on Coursera

End of Programming Languages class

So the Programming Languages course is just about over. There’s actually one peer assessment yet to go and it will probably be a few weeks until the course staff tabulates and releases the results, but all of the serious work is over. I wanted to get this post written before I start on two new courses next week. It’s run by Dan Grossman of the University of Washington and ran for 10 weeks. This course used a slightly different schedule than other Coursera courses which usually had weekly sections. For this course, the eight course sections were spread out over the ten weeks so we didn’t have a predictable schedule of when each section would be released.

The course used three different languages, starting with SML for the first four sections, Racket for the next two sections and ending with Ruby for the final two sections. There was a programming assignment for each section, with exception of section 4 when we had a mid-term exam. At the end of it all, we have the final exam which is still ongoing as of the time of writing. There were no other quizzes though each section’s programming assignment had to be submitted twice. Once to the autograding system to test for correctness and once again to the peer assessment system to check for style issues and correctness isssues for which it was difficult to get the autograder to test for. One cool thing is that most of the programming assignments have optional challenge questions which award a small number of bonus points for a comparatively huge amount of extra work, just for those who want to run the extra mile.

Continue reading End of Programming Languages class

Doing programming stuff

I’ve been remiss in updating due to being busy on the Coursera site. I’m currently taking the Programming Languages course from Dan Grossman of the University of Washington. It has a strong focus on functional programming, a paradigm that is completely new to me. It’s pretty amazing to learn about these powerful programming idioms that don’t yet exist in mainstream languages.

Meanwhile I am also serving as a Community TA for the current run of Princeton’s Algorithms 1 course. Apparently I got the invitation due to good grades and being active in the forums during the first run of the course. It basically means playing the role of moderator on the official forums and helping students with explanations and basic problem solving when appropriate. It’s sometimes disheartening to note how many students don’t understand basic instructions, for example, like zipping two files is not the same as putting the two files in a folder and zipping that folder. But it’s also great to see students work on the same problems that I spent time on last year, sometimes with results that surprise me.

For those curious, we get moderator powers and can view some personal details of students. We also gain access to a TA-only forum in which instructors and TAs from all of the courses on the platform can interact. We also regularly interact with the course instructor by e-mail. But we have no special behind-the-scenes access to the nuts-and-bolts of the system. So fixing stuff like broken autograders, server outages and the like are done only by Coursera engineers.

Finally if you’re not yet into the MOOC scene, here’s a recent post on the official Coursera blog announcing a huge expansion plan. Those in Asia may be interested in knowing some of the new universities that have signed up include the National Taiwan University and the National University of Singapore. Courses in more languages than just English should be available soon, including some in Chinese. In fact I should be taking a couple of courses on C++ later this year in French simply because they are the only C++ courses on the platform currently available and it is kind of embarrassing not to know the standard language most widely in use in industry.

End of Introduction to Interactive Programming in Python class

Updated on 28th December 2014 to fix errors caused by a change in the CodeSkulptor library.

The latest Coursera class I’ve been taking is Introduction to Interactive Programming in Python, a long and unwieldy title. It was conducted by professors Joe Warren, Scott Rixner, John Greiner and Stephen Wong of Rice University and ended yesterday so, as usual, I thought I’d write a few words about it.

To tell the truth, I was misled by the title of the course. I thought it really was an introduction to writing interactive programs. Since all of the programs we worked on in the Algorithms class were non-interactive, I thought this would be a good new experience. It turns out that this course should really be labelled something like Introduction to Programming via Interactive Games in Python, which is even more of a mouthful but more aptly describes the content of the course.

Continue reading End of Introduction to Interactive Programming in Python class

End of Introduction to Finance class by Kaul

I thought I should write a note on this course offered by the Ross Business School of the University of Michigan on the Coursera platform that also ended last week. It’s a ten-week course that I enrolled in out of a slight interest I have in the subject, due to my passing knowledge in accounting and economics.

As with Algorithms 1, I learned a great deal but the quality of this course is markedly lower. Most notably, there was a complete lack of instructor presence and oversight on the official forums. This lack of feedback left many students frustrated and encouraged students to freely discuss and share solutions to assignments with each other. With no moderators to rein in behavior, this left the forums a chaotic mess.

The problem was also exacerbated by the limited pool of questions available in the exercises. For these reasons despite that the fact that this course offers a certificate and Algorithms 1 doesn’t, I’d put more stock in the integrity of the grades in the latter. And yes, this even takes into account the fact that the final exam for the Finance course is timed while the one for Algorithms isn’t.

One excuse is that the enrollment for the Finance class was much, much higher than that for Algorithms, so much so that Professor Gautam Kaul might have been discouraged from the start from being able to intervene in any meaningful fashion in the forums. I believe that there were over 50k students in the class. But I also suspect that quality of the forums was also degraded by the fact that many students were motivated primarily by the offer of a certificate rather than the love of learning. I found the many posts in the forums begging the professor to let them have the certificate despite failing the final to be ridiculous and in extremely poor taste.

Finally, while finance is in many ways more practical than algorithms, after all I hold significant investments but don’t make any money from writing programs, I can’t help but feel that it is less relevant. Despite all that I’ve learned, I still can’t see how the models apply to the real world, given that the models are supposed to work only in an ideal environment (perfect market, frictionless transactions, no taxes etc.) It’s all very interesting in a theoretical sense, but I can’t help feeling that it’s all a bit bunk and that academic finance, at least at this introductory level, is pretty much useless in a real world context. I think I’ll stick to the computer courses from here on out.