I am now on Twitter! Meet me on Twitter here (my nick is pkrumins.)
Or on Google Buzz and Facebook.
I just finished watching the last lecture of MIT’s “Introduction to Algorithms” course. Having a great passion for all aspects of computing, I decided to share everything I learned with you, my dear readers! This is the first post in an article series about this course.
As I wrote earlier, I am very serious about watching video lectures. If they are math-intensive, I usually take notes as if I were in the classroom. Lectures in this course were exactly like that — logarithms, big-o’s, thetas, expectations, and all the other math guys fighting with each other on the blackboards.
There are totally 23 video lectures, each around 1 hour 20 minutes long. I will be posting about 2 - 3 lectures at a time which will result in approximately 10 blog posts. Each post will contain annotated lecture, along with embedded video of the lecture and a time-stamped list of topics covered in the lecture. I will also post the notes I took myself as I watched the lectures (actually, I just bought a scanner (Canon CanonScan 4400F) just for this purpose!)
Understanding and designing effective algorithms is a very important skill for a top-notch programmer. You can still do good without knowing much about algorithms, but knowing them makes you superior. There are two kinds of people, those who can design effective algorithms and those who don’t. ;)
Let’s start with Lecture 1 of this course.
Lecture 1: Analysis of Algorithms
The first lecture is given by the famous professor Charles E. Leiserson. He is the L in CLRS. If that doesn’t ring you a bell - it’s one of the most popular books on algorithms!
He starts the lecture by explaining what this course and algorithms will be all about. He says that this course will be about “Analysis of Algorithms” and states: “Analysis of algorithms is the theoretical study of computer program performance and resource usage”.
Designing great software is not just about performance. Charles presents a list of 12 things that can be more important than performance. Just for comparison with algorithms guru, what do you think can be more important than performance?
Here is the list of things more important than performance that Charles presented:
- modularity,
- correctness,
- maintainability,
- security,
- functionality,
- robustness,
- user-friendliness,
- programmer’s time,
- simplicity,
- extensibility,
- reliability, and
- scalability.
He also asks “Why study algorithms and performance at all?”. He and students answer:
- Sometimes performance is correlated with user-friendliness.
- Performance draws line between feasible and unfeasible.
- Algorithms give language for talking about program behavior.
- Performance can be used to “pay” for other things, such as security, features and user-friendliness.
The lecture continues with the definition of the Sorting Problem - given a sequence (a1, a2, …, an) of numbers, permute them in such a way that a1 <= a2 <= ... <= an.
There are various algorithms to solve this problem. Two algorithms are presented to solve this problems - one of them is Insertion Sort and the other is Merge Sort.
Running time of these algorithms is analyzed by introducing Asymptotic Analysis and Recursion Trees.
Here is the whole lecture:
Topics covered in lecture 1:
- [17:15] Main topic of the course - Analysis of algorithms.
- [19:00] What’s more important than performance?
- [22:03] Why study algorithms and performance?
- [27:45] The sorting problem.
- [29:30] Insertion sort algorithm
- [34:30] Example of Insertion sort.
- [36:25] Running time of algorithms.
- [39:39] Definition of worst-case, average-case and best-case types of analysis.
- [46:50] How to analyze the Insertion sort’s worst-case running time?
- [49:28] BIG IDEA - Asymptotic analysis.
- [50:49] Asymptotic notation - theta notation.
- [57:14] Insertion sort analysis.
- [01:02:42] Is Insertion sort fast?
- [01:03:40] Merge sort algorithm.
- [01:05:25] Example of Merge subroutine of Merge sort.
- [01:08:15] Analysis of Merge sort’s running time.
- [01:10:55] Recurrence equation for Merge sort.
- [01:13:15] Recursion tree solution of the Merge sort’s recurrence equation.
Lecture 1 notes:
Lecture 2: Asymptotic Notation
Lecture 2, on the other hand, is given by genius professor Erik Demaine. He is the youngest professor in the history of the MIT! He became professor at MIT at 20! Wow!
This lecture is all about mathematical notation (Asymptotic Notation) used in the analysis of algorithms. It’s the big-o notation, big omega notation, theta notation, small-o and small-omega notation.
The second half of the lecture is devoted to solving recurrence equations. Three methods are presented:
- Substitution method,
- Recursion-tree method, and
- The Master method.
Here is the whole lecture:
Topics covered in lecture 2:
- [01:25] Big-o (upper bounds) notation.
- [03:58] Set definition of big-o notation.
- [05:25] The meaning of O(h(n)) in notation f(n) = g(n) + O(h(n)).
- [10:20] Big-omega (lower bounds) notation.
- [11:40] Analogies of O, Ω and Θ to comparison operations of real numbers.
- [12:28] Theta (tight bounds) notation.
- [13:40] Small-o and small-omega notation.
- [17:03] Solving recurrences: substitution method.
- [37:56] Recursion-tree method.
- [49:00] The Master method.
- [01:02:00] Proof sketch of the Master method.
Lecture 2 notes:
Have fun absorbing all this information! Until next post!
Ps. It turned out that the lectures were not available anywhere but from MIT’s OCW website. I found that they were released under CC license, which allowed me to upload them to Google Video, so I can embed them in the posts!
Pps. the lectures are taught from the CLRS book (also called “Introduction to Algorithms”):
Did you like this post? Subscribe here:
If you really enjoyed the post, I'd appreciate a gift from my geeky Amazon book wishlist. Books would make me more educated and I could write even better posts. Thanks! :)

(41 votes, average: 4.49 out of 5)
|
|
|


August 20th, 2008 at 4:13 am
Is it just me, or are both videos lecture #2?
August 20th, 2008 at 4:46 am
Oops, James, you are right. I have made some kind of a mistake and uploaded the same video twice or something.
Fixing it now.
August 20th, 2008 at 5:00 am
Thanks for the transcodes Peteris. I can hardly believe that MIT decided to use Real for these… unless it’s just a container for the encode.
August 20th, 2008 at 5:08 am
Danno, it’s true. MIT used Real for those.
I took the opportunity to upload them to Google Video, as they were released under CC license. I am uploading a video at a time as I write more posts.
August 20th, 2008 at 5:31 am
So, I’ve taken and taught this class (as a TA, that is), and the one thing I need to emphasize to anyone that wants to really go through this class through OCW… the bulk of the learning in this class is in the problem sets. They are hard. They are very hard. They normally took a good 8+ hours each for a solid group of 2-4 MIT CS students.
I haven’t looked at the OCW versions, but don’t waste the material by looking at the solutions before you have a good struggle with them. As a student, and as a teacher, they were by far the most important aspect of the class.
August 20th, 2008 at 6:32 am
As someone who has also taken the class, I second what Matt said. Most of the learning will happen from the problem sets. But also as Matt said, the problem sets usually are worked on in groups, so if you have a friend who’s interested as well, it would probably make your life a lot easier to have someone to bounce ideas off of.
August 20th, 2008 at 6:48 am
Hey, thanks for the share! Really enjoying this. It’s great to see someone’s notes as they show how another person intakes the information. neat notes too =P
August 20th, 2008 at 6:49 am
Concur w/Matt + Brennan.
August 20th, 2008 at 7:51 am
As another person who has taken the class, I never worked in a group during this class.
In fact, in my career at MIT I’ve only done 1 pset in a group. Groups can be good, but for most people I think they impede learning.
August 20th, 2008 at 8:47 am
here you can find many of the algorithms of the book coded in Python.
August 20th, 2008 at 10:47 am
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse (tags: via:mento.info) […]
August 20th, 2008 at 10:51 am
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse (tags: via:mento.info) […]
August 20th, 2008 at 10:54 am
Peteris,
Thanks for this and for converting the videos for YouTube. Makes life much easier.
August 20th, 2008 at 11:38 am
oh, you got coloured crayons :)
nice work :)
August 20th, 2008 at 12:35 pm
Wow, thanks, this reminds me of another, shorter, Great Course available from Stanford which I’d been meaning to post about for ages. The professor covers “the future of the internet” with a true expert’s precision. He makes clear subtle economic points and lays out who really has the upper hand in the internet economy, why many communications acquisitions work or are bungled, etc. Though not pure CS, certainly relevant to the same crowd with a similar intensity to this MIT algorithms course.
http://www.thadk.net/wp/2008/08/20/the-future-of-the-internet-review-of-stanford-itunesu-course/
August 20th, 2008 at 1:34 pm
In the bulleted list of items, I’m assuming item #5 “functionaly” should be something other than “functionaly” like functionality?
Thanks for posting the notes and reviews. It will motivate me to spend some time going through the videos.
August 20th, 2008 at 2:43 pm
babul, you are welcome :)
spx2, it’s not crayons, it’s soft color pencils :)
sml, you are right, it’s “functionality”. I am correcting that mistake now. Nice to hear that it will motivate you :)
I also agree with everyone who said that you should also solve a lot of problems, psets or at least quizzes!
August 20th, 2008 at 2:56 pm
Review del curso del MIT ‘Introducción a los algoritmos’
Este es el primero de una serie de posts en los que se analiza este curso, enfocándolo en su utilidad para los desarrolladores. Incluye vídeos de las conferencias.
August 20th, 2008 at 10:43 pm
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse A great collection of notes to accompany the "Introduction to Algorithms " course video series by MIT (tags: algorithms mit course) […]
August 21st, 2008 at 12:09 am
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse (tags: education learning) […]
August 21st, 2008 at 1:44 am
[…] uploaded to Google Video by Peteris Krumins from the host on MIT’s OpenCourseWare website. In his post about them on his blog at catonmat.net, Peter also has posted his notes on each lecture. As he […]
August 21st, 2008 at 3:19 am
This is no less than the 3rd time I’ve come upon your site and taken the tour of a subject matter through the provided lens. I distinctly remember following a Python thread and a thread re: one videos from one of the H/P/A/V’cons, and each subject has been extremely well presented …
Thank you for taking the time to share your notes and doing a write-up, I watched the video first and then read your write-up as a reinforcement. Good stuff.
grantmichaels
August 21st, 2008 at 4:20 am
This is a great initiative- building communities of learners in each subject. Let us hope more listeners come up with course blogs like you. You may also take notice of developments outside of MIT OCW. For example visit:
www.youtube.com/nptelhrd
Where you will suites of about 40 hours of recorded lectures in each course in about 60 courses (and increasing) for the undergraduate engineering subjects posted by the IITs in India. Meanwhile Wikipedia is trying to establish a Wikiversity. Best wishes.
August 21st, 2008 at 4:47 am
Hello,
I am just going through these lectures myself (haven’t finished them yet, though). My approach is a little bit different.
Aside from traditional lecture notes, I put the information in a spaced repetition system like Mnemosyne (there are a few others but this one works great for me).
This thing tells me exactly when to review my notes. I make the flashcards on the fly as I watch the lectures.
The advantage is that I can take for example a longer break from watching the lectures (if for example you don’t have time) and as long as you do your repetitions, you will be able to go back right where you left off.
I always had trouble previously because after watching 2-3 lectures, I had to interrupt for some reason or another and then start over from the beginning to make sure I remember everything.
You also have the added bonus of always keeping 90% of the knowledge in the lecture inside your head.
August 21st, 2008 at 7:28 am
Could you host the videos on anything else? Google Video is often unavailable in China. For example I cannot watch the videos now. Youtube would be better.
August 21st, 2008 at 8:17 am
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse (tags: programming tutorial video algorithm videos courses lectures MIT) […]
August 21st, 2008 at 1:03 pm
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 […]
August 21st, 2008 at 1:21 pm
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse […]
August 21st, 2008 at 10:44 pm
[…] changed my mind a little on how I will be posting the reviews of lectures. In the first post I said that I will be posting reviews of two or three lectures at a time, but I decided to group […]
August 22nd, 2008 at 6:28 pm
Looks interesting, but I give up as soon as I hear a lecturer speaking verbatim while he is writing on a blackboard “Theerrre … aarrre ….” One should not be allowed in front of students with this crap.
August 22nd, 2008 at 8:03 pm
Peteris: Nice site and thanks for being sure to mention our CC license. Our videos are also available through YouTube with embedding enabled, which might save you some trouble. They are also available through iTunes U for download.
Best,
Steve Carson
MIT OpenCourseWare
August 22nd, 2008 at 11:45 pm
Steve,
Only the audio (for this course) seems to be available via iTunes U. To be honest, I don’t find just the audio very useful for a course like this. I would very much appreciate it if the video lectures were uploaded to iTunes U!
August 23rd, 2008 at 6:34 pm
Like one of the comments states: Doing the psets and spending like the 8 hours on it is how you get the most out of this class. I don’t know if they post the take-home test too, but that’s definitely challenging.
August 25th, 2008 at 6:00 am
Argh! RealVideo is the most frustrating format I’ve ever had to deal with.
How are you converting these?
August 25th, 2008 at 1:59 pm
Michael,
I used Avisynth + Virtualdub + Realtime Alternative.
First I installed Realtime Alternative, then Virtualdub, and then Avisynth.
Then I created this Avisynth script for each realtime video:
I named each script like ocw01.avs, ocw02.avs, … ocw23.avs.
Then I loaded each script one by one in Virtualdub and chose Audio -> Full Processing Mode, and selected Audio -> Compression to be mp3 at 16kbit/s.
The same for Video. Go to Video, select Full Processing Mode. Then select compression to be DivX at 230kbit/s.
Then File -> Save as AVI and save the video to ocw01.avi, then load the next .avs and save to ocw02.avi, etc.
This was time consuming but I was unable to automate it with ffmpeg.
August 25th, 2008 at 8:42 pm
thadk: hey, where did your article and the blog go?
“The requested URL /wp/2008/08/20/the-future-of-the-internet-review-of-stanford-itunesu-course/ was not found on this server.”
August 25th, 2008 at 8:49 pm
btw, thanks peteris :) great job. it’s a good addition to autodidactism :)
August 26th, 2008 at 1:49 am
very interesting!
thank you :)
August 26th, 2008 at 8:18 am
Cursos de programación del MIT, en vídeo
Una serie de vídeos sobre programación (divide y vencerás, ordenación, etc) grabados en el MIT. Merecen la pena y están divididos en varios "cortes", incluyen notas y comentarios. Muy buenos!
August 26th, 2008 at 8:14 pm
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages. […]
August 27th, 2008 at 9:15 am
[…] te interesa el tema el MIT publica unos cursos de introducción a los algoritmos. En este blog hacen un seguimiento a los […]
August 30th, 2008 at 10:49 pm
[…] example you can find videos of the Introduction to Algorithms course or a huge number of courses in any discipline you might […]
August 31st, 2008 at 6:24 pm
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse […]
September 24th, 2008 at 2:49 am
[…] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse The first lecture is given by the famous professor Charles E. Leiserson. He is the L in CLRS. If that doesn’t ring you a bell - it’s one of the most popular books on algorithms! […]
September 30th, 2008 at 6:19 am
[…] the complexity of algorithms using these mathematical tools. Please follow this link to read it: http://www.catonmat.net/blog/mit-int…thms-part-one/ You’re welcome to engage in a discussion about it! __________________ Peteris Krumins loves […]
October 17th, 2008 at 5:23 pm
[…] Lectures 1 and 2: Analysis of Algorithms […]
October 25th, 2008 at 5:00 am
I guess I’m not following the second lecture:
1/2 * c n^3 - n == -.5 if n=c=1…
which is lt 0…
November 4th, 2008 at 9:50 pm
[…] http://www.catonmat.net/blog/mit-introduction-to-algorithms-part-one/ By Ben, 11/4/2008, 3:21 pm o’clock […]
November 24th, 2008 at 1:44 pm
[…] the best book on algorithms “MIT’s Introduction to Algorithms” + my notes on algorithms […]
December 12th, 2008 at 12:11 am
[…] MIT’s Introduction to Algorithms + his notes on algorithms […]
December 21st, 2008 at 10:49 pm
[…] in Bash’s Vi Command Line Editing Mode (with Cheat Sheet)Famous Awk One-Liners Explained, Part IMIT’s Introduction to Algorithms, Lectures 1 and 2: Analysis of AlgorithmsHow to Extract Audio Tracks from YouTube VideosLearning Python Programming Language Through Video […]
February 10th, 2009 at 3:43 pm
please someone answer the follow question
how can i prove that we can create a minimum spanning tree with Prim,Kruskals algorithms in the case that the weight of a tree w(T) is the largest (maximum) of the weights of the edges e
w(T)=max{w(e)}
February 20th, 2009 at 6:49 pm
Dude can you please tell me where i can get all the video lectures. Google video doesn’t have all of them and its such a pain in the ass that i cant find all the lectures on one website. Also the sites that claim to have the lectures keep crashing on my browsers !!
February 24th, 2009 at 9:33 pm
Peteris, Fantastic Job!
I have just started going through the lectures. Would you recommend a good way to download these video to watch offline?
Thanks…
March 2nd, 2009 at 6:50 am
[…] Bài giảng 1 và 2 (Phân tích các Thuật toán và Các ký hiệu tiệm cận) (bài giảng thứ 2 được thực hiện bởi một giáo sư của MIT rất xuất sắc (trở thành giáo sư của MIT khi 20 tuổi)) […]
March 19th, 2009 at 8:52 am
hello!
Is there some compact material about that math requirement he mention?
I remember something from my study time, but can’t really follow all that math stuff that are in this course.
April 5th, 2009 at 10:47 am
Most of the lecture videos can be found on Youtube.com/edu MIT page.
And thanks kurumin for the informative post.
May 6th, 2009 at 7:31 pm
Awesome, just what I was looking for! In combination with school this is an excellent tutorial!
May 6th, 2009 at 10:30 pm
Are the problem sets (and, ideally, answers) available anywhere online? I think following along with the lectures is great, but being able to look at the problem sets would be even better.
May 16th, 2009 at 5:40 pm
[…] [upmod] [downmod] MIT’s Introduction to Algorithms: Lectures 1 and 2 - good coders code, great reuse (www.catonmat.net) 1 points posted 8 months, 4 weeks ago by SixSixSix tags lectures imported […]
May 29th, 2009 at 2:18 pm
very nice work, every bobdy have to be
interested, continue and improve.thx
September 19th, 2009 at 7:09 am
Brilliant work fellows, it is really helpful for students like us from other institutes all over the world.
September 19th, 2009 at 7:12 am
This is a scholar from National Institute of Technology, Srinagar, India. These web realeases of MIT lectures have been quite helpful. Great work over thr guys!
October 13th, 2009 at 4:03 pm
Any one tell me what will be the upper bound of following recurrence.
T(n)= T(n-1)+n^2.
October 13th, 2009 at 4:05 pm
Sorry, its
T(n) = 2T(n-1)+n^2
October 16th, 2009 at 1:27 am
Arslan, it’s exponential O(2^n).
At root level you have work n^2, at 1st level 2(n-1)^2, at 2nd level 4(n-2)^2, …, at i’th level 2^i(n-i)^2.
October 27th, 2009 at 3:02 pm
[…] blog của Peteris Krumins anh ta đã ghi chép lại trong quá trình học tập của mình http://www.catonmat.net/blog/mit-int…thms-part-one/ 1.Bài giảng 1 và 2 (Phân tích các Thuật toán và Các ký hiệu tiệm cận) (bài […]
November 2nd, 2009 at 1:59 am
Peter: “fantastic work”; and “thank you very much”; How do I grow the new lobe on my brain to hold this :-)
November 10th, 2009 at 6:15 pm
[…] sorting. It’s called funnel sort which is basically an n-way merge sort (covered in lecture 1) with special cache-oblivious merging function called […]
November 11th, 2009 at 7:04 pm
[…] Lectures 1 and 2: Analysis of Algorithms […]
November 12th, 2009 at 9:02 am
As usual, I loved this post too. This is a nice to have list of algorithms related lectures. This one goes straight to my delicious account.
November 19th, 2009 at 12:00 am
i have to thank u cos these notes and videos helped me so much for understanding the logic. i studied wth these videos and notes and find all my questions answers about these topcis. they re really reallyy helpful and good explained. thanks to all =)
January 5th, 2010 at 5:07 pm
[…] out the elimination is O(n3) process (more carefully, it takes around n3/3 steps). (See my notes on MIT’s Introduction to Algorithms for more info about […]
February 4th, 2010 at 5:42 am
Looks like Alexander Calder’s sculptures on the cover of the book. I’ve had the book for undergrad algos courses, but only now am I noticing this after my arts course. Interesting .. Very Interesting. http://calder.org/work/category/hangingmobile.html
February 9th, 2010 at 11:47 am
hey!
I’m studying for tomorrow’s exam in Algorithms & Complexity (which I will probably fail as I never actually followed the course) and I stumbled on your blog in a frenzied attempt to get a better grip on the Master Theorem.
I am in love with your blog(and the mit course videos), downloaded all the course’s problem sets for a bit of self summer schooling :P. It’s resources like this that make the internet so gr8 :))))
super super thank you =D