Live data from Hacker News

Introduction to Algorithms (2020)

ocw.mit.edu

21–30 of 61 posts

Re: Introduction to Algorithms (2020)

#21
Just looked at the "Course Description" of the "Syllabus" as at

https://ocw.mit.edu/courses/6-006-introduction-to-algorithms...

The course takes itself very seriously and seems to ask each student to devote a lot of time to the course.

My summary reaction is that it would be a shame to devote that much time to what is basically so little material.

Yes, the "Syllabus" mentions

Introduction to Algorithms, Cormen, Leiserson, Rivest, and Stein, CLRS.

Years ago I downloaded a PDF and didn't see much beyond what I'd gotten from Knuth, etc.

I can give a fast overview here:

There I see their lists of topics:

dynamic arrays, heaps, balanced binary search trees, hash tables

and

sorting, graph searching, dynamic programming

I'm a little surprised at how old these topics are: I first learned several of the topics almost entirely from

Donald E. Knuth, The Art of Computer Programming, Volume 3, Sorting and Searching, 1973.

(1) Dynamic Array

A glance at how it works explains why I never heard of it:

Can see

"Dynamic array"

at

https://en.wikipedia.org/wiki/Dynamic_array

So, if have an array A and need more space, then allocate a larger array B and copy over the contents of array A to array B and continue with array B.

A guess is that in nearly all cases a better solution would be a tree where the array subscripts are used as keys and the array elements, as leaves.

Maybe the main reason to include dynamic arrays is to do some applied math to analyze by how much bigger array B should be than array A.

(2) Heaps

I like heaps.

At one point in the software of my startup, I have to search through maybe 1 million numbers and end up with the, say, 20 largest. For that I programmed a heap, and it has worked out great.

There are versions of the heap algorithm that are better on locality of reference and when the heap is carried mostly on slow, secondary storage.

(3) Balanced Binary Search Trees

AVL (Adelson-Velskii, Landis) trees are in the Knuth reference, and they are terrific. An alternative is red-black trees. One of those two is likely the key to .NET collection classes, and my startup uses two instances for a simple, light, fast key-value store instead of Redis.

(4) Hash Tables

Those are also in Knuth. Hashing usually leaves me in doubt due to its various possible problems. But better still sometimes is perfect hashing as I recall also in Knuth.

For hashing in general, a good step forward is in

Ronald Fagin, Jurg Nievergelt, Nicholas Pippenger, H. Raymond Strong, Extendible hashing-a fast access method for dynamic files, "ACM Transactions on Database Systems", ISSN 0362-5915, Volume 4, Issue 3, September 1979, Pages: 315 - 344.

We used that in an AI (artificial intelligence) product we shipped.

(5) Sorting

Knuth covers heap sort and shows that it meets the Gleason bound for sorting by comparing pairs of keys.

(6) Graph Searching

Looking at their lecture notes, it appears that they mean versions of shortest paths on networks.

These are all fairly simple except for minimum cost single commodity network flows where each arc has a maximum flow and also a cost per unit of flow. The problem is linear programming, and the classic simplex algorithm applies and takes on an especially simple form -- a basic solution corresponds to a spanning tree of arcs.

Some good news is that if the arc capacities are all integers and if start the algorithm with an integer solution, then the simplex algorithm maintains an integer solution and will terminate with one.

It is tempting to see that "good news" as a case of progress in NP-complete integer linear programming.

For such content, I recommend

Mokhtar S. Bazaraa and John J. Jarvis, Linear Programming and Network Flows, ISBN 0-471-06015-1, John Wiley and Sons, New York, 1977.

(7) Dynamic Programming

That can be a big subject but does not have to be. I got a good introduction from an expert in about 90 seconds while my cab was waiting to take me to the airport. I ended up writing my Ph.D. dissertation in dynamic programming. For an easy introduction, can have fun, like eating from the appetizer plate at Thanksgiving, say, a half hour at a bite from

Stuart E. Dreyfus and Averill M. Law, The Art and Theory of Dynamic Programming, ISBN 0-12-221860-4, Academic Press, New York, 1977.

One of the amazing advantages of dynamic programming is how well it handles randomness -- then have stochastic optimal control, Markov decision theory, etc.

The flavor of dynamic programming in computer science can be a bit different, e.g., applied to search for some string A in some string B.

Maybe another purpose of the course is to get everyone all wound up and fired up about the question of

P versus NP

My recommendation is to try quite hard to ignore that question.

Re: Introduction to Algorithms (2020)

#22
post #20
post #19

Earlier quoted context omitted.

The authors that can write a book such that you can understand it without previous knowledge are wonderful, but it is heavily dependent on the subject. It’s hard to talk about differential equations without first knowing calculus.

It is not possible and I didn't mean to imply that. There'll be endless prereqs. most of the time. Just that if you need to understand differential equations, and you don't know calculus, the answer in this context isn't reading Spivak from start to finish (here I am assuming a working programmer / self-learner that wants to apply the knowledge - constrained by time and application much more heavily than a student of…

Could you please expand on what you mean by applying knowledge? But sure, I don’t believe reading a book from cover to cover is necessary in most cases, and I seldom do so with scientific books.

Re: Introduction to Algorithms (2020)

#25
post #23

Algorithms at that level are maths for computers. And mostly are for big data. I think it is critically missing the word "maths" somewhere.

I'm not sure why you feel the word "algorithms" needs the word "math" in the same sentence. I feel math is implied in the word. Like, how we don't need to say "mathematical statistics" or "mathematical calculus".

Anyway, first line of the course description gives you what you are asking for:

> This course is an introduction to mathematical modeling of computational problems

Re: Introduction to Algorithms (2020)

#26
post #23

Algorithms at that level are maths for computers. And mostly are for big data. I think it is critically missing the word "maths" somewhere.

I'm not sure why you feel the word "algorithms" needs the word "math" in the same sentence. I feel math is implied in the word. Like, how we don't need to say "mathematical statistics" or "mathematical calculus". Anyway, first line of the course description gives you what you are asking for: > This course is an introduction to mathematical modeling of computational problems

Yeah, I meant in the hacker news.

Re: Introduction to Algorithms (2020)

#27

I'm studying algorithms too right now. As someone who sucks at maths and puzzle solving in general, Steve Skiena's book is proving to be quite approachable for me. Although I have to jump back and forth between the book and Khan Academy to look up some of the Maths. He also has video lectures for the book: https://www3.cs.stonybrook.edu/~skiena/373/videos/ Another thing that helped me was brushing up on C programming…

I love the idea of Skiena's book. I don't love his editor. The second edition has an error almost every other page. The third edition isn't much better.

2nd Ed. Errata: https://www3.cs.stonybrook.edu/~skiena/algorist/book/errata

3rd Ed. Errata: https://www3.cs.stonybrook.edu/~skiena/algorist/book/errata-...

Re: Introduction to Algorithms (2020)

#28
post #7

Earlier quoted context omitted.

What courses did you use from CMU and which major?

I basically followed this: http://coursecatalog.web.cmu.edu/schools-colleges/schoolofco... - but "took" more courses than necessary for my self-learning (I think I read through all of Logic / Language courses, insanely fascinating topic). - I would not recommend a self-learner to follow it rigorously. Like if you are a working programmer, look for material that will help you at your work. Idea is to apply the knowled…

CMU courses doesn't have videos, atleast for most of the core courses. Was that a hurdle to your learning?

Re: Introduction to Algorithms (2020)

#29
post #23

Algorithms at that level are maths for computers. And mostly are for big data. I think it is critically missing the word "maths" somewhere.

I'm not sure why you feel the word "algorithms" needs the word "math" in the same sentence. I feel math is implied in the word. Like, how we don't need to say "mathematical statistics" or "mathematical calculus". Anyway, first line of the course description gives you what you are asking for: > This course is an introduction to mathematical modeling of computational problems

I agree with your point, just wanted to mention that mathematical statistics is a thing. It's usually a name given to textbooks or courses where statistics is built up from foundations in probability theory and where theorems are stated and proven vs introductory statistics courses that approach things with a more decidedly applied orientation that usually also touch lightly on subjects like experimental design and data collection

Re: Introduction to Algorithms (2020)

#30
post #2

Here is my latest life hack that I have been using. Pick a major from MIT and see their degree program to form a basic knowledge graph of the major. Find them on https://ocw.mit.edu/ and study yourself. Usually, taking 1-2 classes gives you a great insight in to any topic so that you can at least collaborate better with the experts of those topics in a team environment.

I'm having the weirdest deja-vu right now. Turns out I did see a thread almost like this, with a top comment almost like this a week ago: https://news.ycombinator.com/item?id=32793139 Felt like I was going insane.

same, thanks for digging up the link. yeah, seriously, verbatim same comment
Post reply on HN