Hacker News new | past | comments | ask | show | jobs | submit login
Algorithms by Jeff Erickson (illinois.edu)
595 points by ngzhian 11 months ago | hide | past | favorite | 152 comments



Not proving solutions to textbooks seems to be a common theme in mathematics and theoretical computer science. It makes it difficult for those outside of the traditional classroom to learn the material. Instead textbook writers seem to have this adversarial approach against readers, thinking they’ll “cheat themselves” if they look up solutions or attempt to verify their work. Experts make mistakes, beginners would presumably make even more mistakes. Without a feedback mechanism beginners can’t truly know whether their logic is impeccable or if they have a subtle error that they themselves cannot detect. They could easily fool themselves that they have correct understanding.

Due to that I will not recommend this current book to any colleagues.

If you want an example of a fellow hacker news member that did things right, check out http://joshua.smcvt.edu/linearalgebra/

He provides solutions and lecture videos... this is truly a democratization approach to learning and a model that other academics should follow.


> Instead textbook writers seem to have this adversarial approach against readers, thinking they’ll “cheat themselves” if they look up solutions or attempt to verify their work.

I agree that worked problems make a text much more valuable and useful; even students in a class may spend a lot of time doing self-study. And for self-study, without worked problems the book is only useful as a reference while working problems from elsewhere. The author essentially agrees with this.

However, it's not "thinking" students will cheat themselves, it's knowing for a fact that many will. If you give homework that takes multiple hours each week, then for students who have gotten behind or don't know the background they should, it will take multiples of that time. Many, if not most, simply won't do it if there's a shortcut handy. Challenging people to do more than they would on their own is necessarily adversarial.


Is it really cheating. If the goal is to learn the material using someone else's solution is incredibly helpful and can expedite the learning process. If there is a process to master a skill in 20 hours and another way to master it in 5, only the fool would chose the 20 hour process.

When I took electrodynamics the first semester I worked through all the problems myself. I started on Sunday would ask questions Monday and Tuesday where I was stuck and the process took me 20ish hours each week. When I took the second semester, a couple of the other students had the solution manual. I would attempt the problem, then when I got stuck, I would consult the solutions manual, understand what the solution manual was doing, then go back to my work and understand the problem. It would help me track down errors I made in algebra. I ended up spending about 10 hours a week on the problem sets, understood the material better (as well as the material from other classes) and got better grades (on both tests without solutions and homework).

I used to tutor kids in physics and one of my students went from a C at midterm to an A because there was real time feedback for the homework he is trying to do so he was able to grok the material. Worked out solutions to the homework problems is the next best thing.

When I was teaching myself machine learning, it was the same deal, I started working through other peoples worked out problems, it helped me grow my programming skills and learn machine learning more effectively. I would take their code break it down, add comments to lines I didn't understand on first reading and ran the programs.

Learning from solutions is one of the best ways to learn. And it is stupid to have to do twice as much work for the homework problems because some kids might cheat themselves. The alternative for students who have gotten behind or don't know the background is that they don't learn the material because you don't have . The solutions manual gives them an opportunity to catch up.


> Learning from solutions is one of the best ways to learn.

Sometimes I feel like that's the only way to learn. There's no worse feeling than staring at a problem and having no idea where to start with no one to guide you.

The corollary is that I feel sometimes it becomes _memorizing_ instead of _problem solving_.

In a certain aspect, problem solving is recalling previous solutions you've done and applying various parts of them. But in another sense, just memorizing solutions doesn't necessarily help you apply them.


Reading your comment made me realize that this practice is common within programming itself where frameworks/languages often strive to provide “fully contained examples”. When I’m learning a new framework, I will often first look at how others have written to learn things faster.


If your only goal is memorizing the material, then sure. But usually it is a goal in of itself, to apply knowledge to novel problems and develop a solution. There are no solution manuals to unsolved problems. If you went your whole graduate education not working on the ability to approach problems you haven't seen, you will not do very well in research, and many aspects of professional life.

But sure, if you do a first pass without a book, spend sufficient time trying to figure it out, then a solution manual is helpful if you are not getting the feedback loop of a professor.


Well the feedback loop is much faster with a solution manual than a professor. I agree there is a line between leveraging the solution manual to teach yourself more quickly and just copying the solution. My quantum mechanics professor would give us the solutions to the homework before we were expected to turn it in so that we could learn from his explanations.

I agree that you have to a some point learn how to approach problems which you haven't seen before, but almost every field I have seen, the right way is to start by copying solutions of others until you understand it and then riffing from there. My father was a professor/researcher and he said you shouldn't start a problem unless you knew what your solution was and what you expected it to provide.

In fact much of the research work I have done is see if technique from field x will apply to field y after I have become an expert in field y. Or push to edge of field y and take the next logical step. But pushing to the edge of field y almost always requires working through the solutions of the people who have been there before rather than reinventing the wheel.


> I started on Sunday would ask questions Monday and Tuesday where I was stuck and the process took me 20ish hours each week. When I took the second semester, a couple of the other students had the solution manual. I would attempt the problem, then when I got stuck, I would consult the solutions manual, understand what the solution manual was doing, then go back to my work and understand the problem.

At the university I attended, this would be an honor code violation. But I agree with the value of worked problems.


So provide worked answers for half of the problems, making sure that the problems with available solutions give the experience necessary to solve the ones that don't. Then ideally assign homework that includes both problems, with the expectation that students will look up the solutions if they get stuck.

I've had several classes that worked like that, and it worked great.


Can't you (as a teacher) just, not assign homework that's static problems from a textbook and instead make your own problems?

The problems in the text book aren't meant for homework, they are meant for practice. This is just the teacher not wanting to make their own problem set and instead use the ones they got for free in the textbook imo.


Would you rather your teacher spent time writing problems or spent time coaching students through problems in person?


I'd like my teacher to spend some time trying to understand and address the problems that students have with exercises. In practice, that seems to mean spending time writing problems.


> If you give homework that takes multiple hours each week

I think I found the problem. Educators have such an obsession with homework and stealing more class time from their students they can't imagine different models where having the answers in front of you doesn't detract from learning.

Have you never used flash cards? My answers are on the back and yet...


I don't know what you mean by stealing. In college you are generally supposed to devote twice as many hours outside of class as in class. It's probably stated in your student handbook. That is why 12 to 16 credit hours is called "full time". In a problem-solving discipline the best way to spend that study time is solving problems. As a bonus you can get personalized feedback when it is graded.


I'm going to call that stockholm syndrome. Many people throw around the idea of spend twice as much time in class as out. That's a fine idea for some, but many don't need it. Forcing a student to fill out problems to satisfy the instructor's concept of enough time spent is completely tangential to purpose of an education.

There isn't a requirement for the amount of time a MMA fighter spends in the gym. They set their own schedules and reap the results.


The idea is not "thrown around". It is called the Carnegie Unit: A course should be designed so that for each unit there should be 1 contact hour and 2 hours of outside-class work. This is the standard way courses are implemented in North American universities.


In my college (back in the day) they said an A student would spend 4 hours for every 1 hour. For a 15 credit student, that meant 60 hr work weeks every week and for a 20 credit student, 80 hours a week every week. It was brutal and exploitative imo. The one semester I took 12 credits, my quality of life, ability to retain material, and grades went up.


Let's face it, the average student won't do anything on their own till the night before the exam, which is a recipe for failure in any class that can't be memorized in an evening or two. If school was tailored towards the most elite self-motivated students, your analogy would apply. But something like half of gym members don't even go.

Why do you think professors give homework? It would be so much easier to just point students at study materials and leave the responsibility to them. But it's frustrating for everyone when students fail.


How is that a stockholm syndrome? Classroom hours are set low enough specifically because of the expectation of out-of-classroom work/study. The courses could meet for longer and expect all work to be done in class, but that is incredibly restrictive for planning schedules.


Nobody learns learn how to design algorithms from flash cards.

Mastering any skill requires sustained practice: driving writing, basketball, auto repair, carpentry, banjo, gardening, combat juggling, web development, teaching, and yes, even algorithm design. The multiple hours of homework each weak is that sustained practice.

If anything is a waste of time, it's the lectures.


In college, cheating on the homeworks was quite literally the only way to get all the work for 4 engineering classes done on time.

We still learned it all for exams, and received our exam grades accordingly, which are generally >60% of the full grade for the class.

But we were putting in 80+ hours a week on engineering classes and it simply wasn't enough for the obscene amount of work professors assigned. Students crying, having breakdowns, and pulling their hair out in the library and in the classroom was pretty common.


I remember two breakdowns while going through Computer Science and Engineering at UTA ( far from a top-tier school, we liked to call it "UT Almost" ) in the late 90s

1. a student in physics broke down sobbing during the final, like uncontrolled wailing. The TA helped her get up and walk out

2. in the discreet structures course a student got up, walked to the front of the room in tears, tore up their final in front of the class and prof, and then walked out.

3. not sure if it counts but in that same physics class from #1 another student threw up all over themselves but sat there in it and finished the final. maybe just sick idk

a lot of students are hotshit in HS and then get to college and find out they're not as smart as they thought. heh i came from rural TX armed with Algebra II and didn't even own a computer. Fortunately for me, i somehow ended up with a handful of upper classmen friends who seemed to make it a mission that i get through it. I owe them so much.

EDIT: Professionally, i've been on plenty of conference calls where peers break down in tears. There's only so much pressure a person can bear before nerves just give way.


I once met an engineering statistics professor under social circumstances. Said professor proceeded to brag about never having a student get an A on his final, along with other similar comments. Later, I took a class from a history instructor who started the first class by going around the room mocking the students individually. (I dropped that sucker so damn fast...)

Some teachers specifically not to teach, but to take power trips over students. They are simply bad. Others are there because it's a paycheck; they're not very good. Some others are confused and loopy. They're not great.

But most of the university and college teachers I've met were interested in teaching students---they're typically teaching something related to the field they've spent their lives on, right? Most were middling good, some were spectacular.


This reminds of my DS class at a normal state uni. We started with about 30 students, 7 showed up for the final exam. 2 walked out during the exam.


Unless you were planning to graduate in 3 years or less, I've personally never seen anyone experience this.

Advisors should have worked with you to make sure your semester workload floats at around 40-50 hours a week, 60 hours at most during a bad semester. Some people actually care about retaining the material they're learning - taking 4 engineering classes a semester is a waste of time and likely detrimental to learning. It's usually 2-3 engineering classes plus a few easy blow off classes a semester to get all done in 4 years.


It was absolutely detrimental to learning and retention.

We were on a quarter system (really trimesters, since one quarter is the summer quarter), with 48 classes required to graduate from engineering, which is 4 classes per quarter for 4 years assuming you don't have any AP credits. Only a handful of the 48 are allowed to be non-engineering, econ, or math.

Most classes that would be a 14 weeks in a semester system were not broken up differently - they were crammed into 10 weeks to fit into the quarter system.


This situation probably did not happen overnight. It was probably a long process driven by feedback loops. Some students started cheating, so profs made classes harder or assigned more work to ensure that students learn enough to get jobs/scholarships/grad school admissions.

More students started cheating. Profs responded the same way because of organizational pressure. Ten years later, courses involve obscene amounts of work.


Thanks for the reference. Another algorithms text -- though Haskell centric -- that provides solutions is Algorithm Design With Haskell [1]. The exhaustive Combinatorial Mathematics by Douglas West [2] provides hints at least. These are advanced texts though. Another source of solved problems are "problems in" books. Dover offers affordable titles like Fifty Challenging Problems in Probability [3]. There are other classics like Combinatorial Problems and Exercises [4] or Proofs from the Book [5], all with solved exercises.

[1] https://www.cambridge.org/core/books/algorithm-design-with-h...

[2] https://faculty.math.illinois.edu/~west/

[3] https://store.doverpublications.com/0486653552.html

[4] https://www.ams.org/books/chel/361/

[5] https://www.springer.com/gp/book/9783642008566


I took this course a while back. Before every exam, students would create a massive crowdsourced google doc and attempt many problems in the book / fodder. Granted, we had TAs to review our results - but even they don't access to a solutions manual. But the docs were filled with comments, many different approaches and alternative viewpoints. The class discussion board was very active. I've never seen that sort of large scale student-led collaborative atmosphere in any other class.

In that sense, I agree that this book isn't designed for self study. Every homework was done in groups of 3 and probably took a combined 30-60 manhours a week to complete. It would be pretty hard I'd imagine.

The reality is - if you're a developer and someone asks you to develop a program that does x, you rarely have the privilege of having a complete source code waiting in the end to compare against. But you build it iteratively. You do a bit of research. Sometimes you ask for feedback through a pull request. You think about every corner case and edge case. These are all basic practical skills you don't get to exercise if your mindset is to just grind through math problems.

These days, the internet is full of knowledge, social and connected as it can possibly be. StackOverflow and research papers are one google search away. (I say this because every problem in the book are usually based on very interesting theoretical CS papers) Discord servers have become huge chat rooms for people to organize like-minded individuals. Assembling a group of motivated individuals online and working on problems together is a very effective way to learn than trying to dive into material by yourself. Whether it be this book or any other textbook. I don't think this book should be faulted for trying to incentivize that philosophy.


While I agree that this book isn't very useful for self learning, I have to defend the model you describe as adversarial. I took CS473 at UIUC (it's CS374 now) so I can tell you firsthand the course is brutal -- easily the hardest course in the CS program. You're given a LOT of resources through office hours and everyone uses them. The TAs are good at leading you down the right path instead of just showing you the answer and making you feel like you connected the dots (you probably didn't). Most of the answers are on Chegg if you want that, although I think Chegg is the worst thing ever for actual learning.

Unfortunately I don't have a good solution for the self learner here... There is no way in hell I would have gotten through that class without the TAs and workgroups. Just being able to peek at the answers would have been terrible.


In the former situation you described, the actual textbook doesn't matter, it's all about the resources you described to help you along.

In a lot of cases, those resources just don't exist, even at universities. That's why worked examples and problems with solutions are so invaluable. In fact, they're so valuable, I've spent half a decade compiling these kind of resources for mathematics and physics, back when I was a master's student. I literally crawled through professor course pages manually downloading pdfs.


In a previous post, the author responded to this concern: https://news.ycombinator.com/item?id=18808010

It seems like he will include a subset of solutions in a later edition, whenever he has time to publish it.


It's kind of insulting to assume that students are unable to decide what's good for them. If someone wants to cheat, he/she will do it anyway. Not providing solutions harms people that really want to learn the material.


The author of this particular book made his choice based on his experience teaching the course. While, of course no one can stop you from criticising his choice, on any day, I'd respect his opinion more than that of an angry internet commenter as he (the author of the book) has more invested in it _and_ has given free resource to the community after putting a lot of work into it.


I mostly agree with your sentiment. But I don't necessarily see it as a question of respecting one opinion more than the other. The author of the book didn't make a statement like "books without solutions are universally" better or anything.

But he did make it clear that he optimized for one particular audience (his students at Illinois) over another possible audience (self-learners). And on that, he totally has the right to make that choice. It's unfortunate that some commentators ignored that point, or choose to be critical anyway.

OTOH, just because something is free doesn't mean that people can't criticize, IMO. The question just kinda becomes "what's the point of the criticism?" If one doesn't find this book useful, they're under no obligation to use it. And the author isn't likely to change his position based on a few grouchy Internet commentators.

Personally I appreciate what the author has done and am glad his book is out there. Do I prefer books with solutions in general? Yes. Does that matter in this particular context? No.


> If one doesn't find this book useful, they're under no obligation to use it. And the author isn't likely to change his position based on a few grouchy Internet commentators.

Yes this is what I don't understand. Why are there so many critical posts about this particular decision? Why didn't those users just close their browser tab and move on with life? They are bring offered a free resource, it doesn't meet their needs/desires, they choose to complain. It seems very rude to me. The few who have suggested alternatives are contributing.


> OTOH, just because something is free doesn't mean that people can't criticize, IMO.

I couldn't agree more!


>It's kind of insulting to assume that students are unable to decide what's good for them.

It's also kind of insulting to assume that teachers with decades of experience don't know how students behave.

Student cheating or working is not binary; it's a continuum. There are plenty of students in the middle of that continuum that will copy answers and not learn if answer are easily available, but that would do the work if answers are not available, and those students are better off having to put in effort when they don't have easy answers.


This x1000, I was/am a particularly dense student and the only way I learned was by working loads of problems repeatedly until the “tricks” became second nature. The worst are solutions manuals with hand wavey solutions.


I think the ideal would be something like an autograder, rather than a solution. There used to be a Coursera class from Princeton that relied on Sedgewick and Wayne algorithms book, and the class was very, very good.

Then we must hope people don't publish solutions on github!


> I think the ideal would be something like an autograder, rather than a solution

Me too! But I don't know how to write a useful auto-grader for free-form English text and pseudocode, and neither does anyone else.

Even a pedagogically useful auto-grader for actual _code_ — one that doesn't just check a bunch of test cases, but diagnoses the code to identify design errors and offers specific feedback for improvement — would be utterly revolutionary.


IIRC the Coursera class autograder used actual code, and offered _some_ design improvement suggestions - about code correctness, edge cases, speed. Of course, it couldn't point out other design flaws.

I think that the Java used in that class was a good approach. By limiting the packages you could use, they prevented leveraging builtin facilities (e.g. Java collections) and forced people to write their own data structures.


or chegg barf


I agree with this 100%.

It’s really hard for everyone when there are no solutions provided. Even if you arrive at the correct answer it’s nice to know how the author is thinking about the problem


Is that Computer Concrete Roman?!

I guess I'll have to go through this one.


Nope. It's Bitstream Charter.


Hi, I'm the author.

You're of course welcome not to recommend my book to anyone for any reason. But in my own defense, my reluctance to release solutions is not a moral stance, or a belief that I know what's best for all learners. I completely agree that a textbook with solutions would be a better resource for independent learners than a textbook alone.

But my first allegiance is to my students at Illinois. My textbook grew out of course materials for the algorithms classes I've been teaching at UIUC for more than two decades, and it's still the primary reference for those classes.

I religiously release solutions to my homework, exam, and discussion problems every semester, but only after the homeworks are due, exams are taken, or discussion sections are over. (Experience strongly suggests that having homework solutions _after the fact_ significantly improves later exam performance on similar questions.) I also include at least one solved problem in every homework assignment, to help students calibrate the level of rigor and detail that we expect, and to give a worked example of the type of problem that the assignment is covering. (This pisses off several of my colleagues, who really wish I wouldn't publish solutions at all.)

But whenever I've assigned homework or lab problems whose solutions are readily available _in advance_—either from me or elsewhere on the web—students have performed worse on average on similar exam problems later in the same semester. I take that as strong evidence that they didn't learn the material as well. This isn't a philosophical or moral stance about what students _should_ do; it's an empirical observation.

tl;dr: In practice, releasing solutions in advance hurts my primary audience. That's why I don't do it.

"Why not just make up new problems every semester?", I hear you ask. I do make up new homework and exam problems every time I teach, which is why the textbook has so many problems, but not enough to fill an entire course. Developing problems that are substantively new (not merely old problems in new clothes), focused on the target skills, and neither too easy nor too difficult to be pedagogically useful, is *HARD*. (Most competitive-programming and interview-practice questions are terrible, because they're not designed for the same purpose.) I do it, because I have to, but it's one of the hardest parts of teaching this material, and I don't always succeed. Other parts of my job life also require time and attention, and I'd really like to sleep, so yes, I do rely on good problems that I've used before,after they've been fallow for a few years. (The same goes for the other algorithms faculty at Illinois and elsewhere.)

Similarly, collecting all (or even a significant fraction of) the problem solutions and polishing them into a common publishable form, even just for instructors, would require a serious amount of work, especially without a professional editor (because I'd want to self-publish, so that I could give it away free). Finishing the textbook required a full-year sabbatical, free from my usual teaching and committee work. Again, I'd like to sleep.

I completely understand and sympathize with your frustration, but I still believe I made the right choice. I'd like to think that my textbook and other course materials are useful even without solutions; otherwise, I wouldn't have published it. But it can't be all things to all people.


The book contents are FREE! Look away if you're offended.


They weren’t attacking the author. It’s a valid argument regardless of the cost of the book. Free doesn’t mean you can’t criticize anything.


There was an accusatory, hostile tone that I personally found off-putting and not worthy of an HN discussion.

asicsp’s comment[1] was much more useful and neutral.

1: https://news.ycombinator.com/item?id=26074429


He stated his experiences with mathematics and computer sciences books and provides arguments for why he thinks this is not a good approach. I really can't see where he is being hostile or accusatory?


Tone policing on a textual medium isn't helpful either.


From https://jeffe.cs.illinois.edu/teaching/algorithms/hwex.html#...

>Please do not ask me for solutions. With very rare exceptions, I will say no, even if you are an instructor. I recognize that my stance limits the utility of these materials, especially for self-learners, but I'm trying to optimize the learning experience of my own students at Illinois. The point of homework is not to solve that particular homework problem, but to practice solving a type of problem and get honest feedback on your progress. I've found that when solutions are available, my own students are much more likely to rely on them, rather than trying to figure out the problems themselves, which means they get both less practice and less honest feedback, which means they do worse on exams and in the course overall.

Interesting. I was asked multiple times for solutions to my self-pub ebooks that I relented. I didn't add them initially as I wanted readers to solve by themselves or ask for help if needed (and I did get a few mails, saw one of them asked on stackoverflow as well).

See also https://github.com/tayllan/awesome-algorithms for more learning resources, practice problems, visualizations, etc.


While I get this stance (the books are often written with students in mind), it's sometimes a bit hard when reading this kind of material while not enrolled. I don't have any TAs, professors, peers etc to ask or grade my stuff when working my way through a text book in my spare time. How can I be sure I understood stuff correctly?

For me it's ok, I guess. I have graduated years ago and it's strictly for fun. But I wonder if it also creates a kind of artificial divide for those not able to attend a university but could have gotten good use of this kind of material by self study.

Edit, found this quote from him on an earlier discussion which summarizes it nicely:

> I'm honestly seriously torn about this. There is a serious tension between pedagogical needs of students in formal classrooms and the pedagogical needs of self-learners. I've chosen to aim for the former. Yes, I know it's a bummer.


That's what was good about the early stages of sites like Coursera, Udacity and Edx - they had quizzes, exercises and exams that are auto-graded that provided that kind of valuable feedback for all tiers.

I think they've all evolved now to where that is only available for paid tiers.

One innovation I really enjoyed was marking and commenting another student's answers, once you'd submitted your own. There are flaws but it's a valuable variation on graded feedback.


> I don't have any TAs, professors, peers etc to ask or grade my stuff when working my way through a text book in my spare time. How can I be sure I understood stuff correctly?

I definitely agree with you on this. However, there are three things self-learners (or even students) can do.

1. Find a textbook with worked solutions or a different presentation of material.

2. Look for course material that has problem sets with solutions, worked tutorials, or worked examples.

3. Learn numerical or other methods to evaluate your solutions. I know this isn’t possible for proofs, but if it’s an algorithm’s run time, I don’t see how implementing the algorithm and plotting run times over different input sizes wouldn’t be a good way to see if you have the correct run time.


My preferred approach is when solutions to odd numbered problems are available. This is especially helpful years hence when help may not be immediately available.


Yep, I think this is a good middle ground. By all means encourage students to churn when solving a problem, but you can get stuck. Actually reading and following a solution to a similar problem can provide some insight.


I hate this attitude. It punishes students (and self-learners) who want to be as good as possible and who’d use solutions to get fast feedback.

The right thing to do is to publish detailed solutions to textbook problems and create new problems for HWs.


It doesn't punish anyone. If you want solutions, then the book is not for you, that's all. The author is not obligated to accommodate every audience, or even a majority audience.


"The right thing to do..."

No. He's the author, this is his choice. People who don't take his course don't have to use the book.


Poor logic. I don't have add tests to my code, after all they're free not to merge, but I should.

Exercises with no solutions are very hard for people learning away from traditional academia - I haven't read this book so I don't know what they're like, but in a physics books it's often common to add questions that take fairly deep conceptual understanding which if you don't click with the book means you're totally out of action until you find somewhere else to learn from.


Again, you don't have to use this book. There are hundreds of books on algorithms, many of which have solutions for people who need them. Getting all pissy with the author because he doesn't provide them is sad and not neccessary.


I don't know, I think he made a very fair critique. Sure, there are hundreds of algorithms textbooks. But there are hundreds of anything. Anyone can make anything they want to, and they are subject to criticism for that.


"right thing to do" is not a fair critique.


> Getting all pissy with the author because he doesn't provide them is sad and not neccessary.

The only person who seems to be getting “pissy” is you.

What is the point of making a comment like “if you don’t like it, leave?”. People who say this seem to think they’re some pithy genius but it’s not a comment that advances the conversation at all.

“Hey I have some feedback ...”

“I don’t accept feedback. Take it or leave it”

“Ok”

That’s not really what HN is meant for.


> People who say this seem to think they’re some pithy genius but it’s not a comment that advances the conversation at all.

Does the conversation really need to be advanced? The author has chosen to not include answers and gave an extremely valid reason for choosing not to and HN'ers are, indeed, getting pissy saying the author should do the "right thing" and provide the answers.

No. Just no. The "right thing" is to accept that the author is choosing not to and move on if you need answers. The author doesn't owe anyone answers.


Nobody in this chain mentioned anything about making the author change his decision.

The discussion is about whether his decision may be criticized. Which it absolutely can be.

Again, saying, “if you don’t like it, leave” is not the genius rejoinder you seem to think it is. It doesn’t add anything to the discussion.

I could flip this back at you and say “if you don’t like this discussion, leave”. I’m not doing that because I choose to engage in a good faith discourse.


Unless this is a book the author wrote solely to enjoy themselves, let's not pretend that feedback from potential buyers is something that shouldn't be allowed.


The author has responded to this feedback on the website in great detail. At this point, this is less of feedback and more of entitled people demanding that the author write another book.


The content is posted for free. If you buy it, you are paying for a physical copy of free material.

PDF of the book: http://jeffe.cs.illinois.edu/teaching/algorithms/book/Algori...


Professors frequently write their own textbooks. Sometimes these are only used in their own classrooms. That's pretty close to their own enjoyment. It allows them to have a book that exactly matches the way they want to teach. As far as buyers, this book is free.


> I was asked multiple times for solutions to my self-pub ebooks that I relented.

You could always publish the solutions in a separate paid ebook. If people want to be able to check their own answers, or they want to use the exercises to set homework and make it easier to grade, they might be willing to pay you for them.


>You could always publish the solutions in a separate paid ebook

Yeah that's an option too, especially with gumroad/leanpub providing version/packages for such cases.

In my case, I provide my ebook for free online (inspired by FOSS and authors such as Al Sweigart and Allen Downey) and charge for pdf/epub formats. Good enough to pay my living costs (and a bit more in recent months). So, I don't mind providing solutions as well.


Caricatural mercantile thinking at play here. It’s sad to read.


I like the awesome-algorithms link, but some of the code linked is definitely not perfect. A few questionable things from one of the header files [0] in https://github.com/TheAlgorithms/C:

- Defines a macro with no parentheses

- Uses unsigned for length and capacity (should be size_t)

- Uses () instead of (void) for an empty parameter list

- Useless use of "extern" for function declarations

- I think that leading double underscores and structures ending with _t are reserved identifiers, but I don't really have a good source for this

[0]: https://github.com/TheAlgorithms/C/blob/master/data_structur...


I mean, he's aiming for his main demographic. For anybody who isn't a student of his, there is no honest feedback, because there's no feedback at all. What good is solving a problem if you never find out whether you made a mistake?


> See also https://github.com/tayllan/awesome-algorithms for more learning resources, practice problems, visualizations, etc.

Oooo, nice. Thanks for the link!


This would be like learning piano without a teacher listening to our mistakes.


Good ‘ole CS 373, had Erickson back in 2002 and it’s def. a defining course in CS at UIUC.

The answers to a lot of these are now google-able; you’ll learn more by researching than being spoon fed the solution!

Imagine those of us students back then when google wasn’t a verb yet trying to solve these problems!


All of the X73 classes were defining for me. Probably my favorite classes and ones that changed the way my brain works.


For someone out of the UIUC construct, does X73 mean various levels of algorithms courses? Could you elaborate on their titles or content?

I am looking to self-study for core CS content that I missed out on in school after being largely self-taught, and courses that change the way one’s brain works sound like the right ones to take.


Yes, the X73 courses were theory based. Something changed after I graduated and now I think CS 374 is the algorithms course, but I'm not sure.

If you want to start with the fundamentals, CS 173 (Discrete Structures) is required of all undergrad CS majors and is the first of the sequence (usually taken as a freshman/sophomore). The book is available online along with problems/solutions: http://mfleck.cs.illinois.edu/building-blocks/index.html


Thank you for pointing out the starting course of the sequence!


That is a very familiar pain to me. I started programming when I was ten and kept up with it since, but my education was not in programming (although I would take courses as it suited me), so I never had any formal training in data structures or algorithms. I have occasionally found that I had re-invented some known algorithm and wondered just how much difficult I would have been spared if I had known about it in the first place.


I always loved the Recursion Fairy!


Heh, btw, it was changed to 473 shortly after ;).


FWIW, I really liked the sections of this book that I've read. In particular, I read the sections on "Minimum Spanning Trees" and "Fast Fourier Transform" and found them the clearest treatment of the subject that I've seen.


Does the cover say Al-Khawarizmi, rotated 90 degrees and stamped four times?


It does indeed, with the dot on خ being the central dot (repeated once per rotation).


Can you please explain it in detail. I don't know Arabic and can't figure out the pattern. He is born in my country and it would be cool to show the cover to my peers.


The pattern is the script called "Square Kufic" (a google image search +mosaic reveals many wondrous examples) and the arabic form of al-Khwarizmi is الخوارزمي

The kufic letters are fairly abstract but look for the verticals, there are 9 letters (last 2 are joined, I think, I cannot read it either just looking closely)

ا A

ل l

خ kh

و w

ا a

ر r

ز z

م m

ي i


> ...Square Kufic

Its superset, "Geometric Kufic", is a more interesting rabbit hole. In general, Arabesque patterns are almost exclusively floral / geometric.

See also: https://news.ycombinator.com/item?id=12049316


A discussion about it from earlier here that might be of interest: https://news.ycombinator.com/item?id=18805877


Prof Erickson once told me I look like Richard Feynman - 20 years later, it looks like that may be the peak achievement of my software engineering career.


In my experience these actually didn’t do a great job of explaining things like dynamic programming. I prefer Kleinberg and Tardos


I had the opposite experience, though I agree that YMMV. I return to the chapter on Dynamic Programming every time I need to prepare for an interview.


I don't think I've ever been asked a DP problem in an interview, and only had to use it while programming once. That said, I liked the MIT lecture on it: https://www.youtube.com/watch?v=OQ5jsbhAv_M


Doesn't hurt to have Possible Solutions to the exercises to questions that don't have singular, definitive answers. I wouldn't even add answers to questions on definitions as those can be referenced in the text itself or the notes taken down. But filtering through a map can be done in many ways and a Possible Solution is an interesting way to appreciate a different point of view. But that means the learner, self-taught or otherwise, still should have the discipline to at least to arrive at solution themselves before reviewing the author's selected one(s).


Pardon the typos, mobile.


Here's a previous post on HN with lots of discussion: https://news.ycombinator.com/item?id=18805624


I'm happy to see that the top comment is about his 25% credit for I Don't Know. That willingness to fold with grace is something that gets lost with standardized testing.

IIRC, he also announced that the top 5% of the class would be automatic (and the only) A+ grades, and the bottom 5% would be automatic F grades. But don't worry, there would inevitably be more F's than that, naturally, so nobody was going to get screwed by that rule.

As the international student base grew, I could imagine pressure from the dean to stop applying or even publicising that grading rule.

(edit: didn't state my assumptions here. The international students pay quite a bit more than in-state resident students. They are more likely to contain the "cream of the crop" from nations like China and India, both considerably larger than Illinois's in-state population. These students are likely to have different expectations coming in, due to the competitive schools they may have come from; and they are more likely to risk "breaking" the 5% threshold for F's)


> I'm happy to see that the top comment is about his 25% credit for I Don't Know. That willingness to fold with grace is something that gets lost with standardized testing

I'm afraid I'm going to disappoint you. After using the "I don't know = 25%" policy for fifteen years, I was finally convinced to abandon it. Not because of pressure from administration, but rather from an honest evaluation of actual student behavior.

The IDK policy was meant to reward self-awareness, but in practice it seems to actually punish lack of confidence. In particular, female students answered IDK more often than male students with similar scores on questions that they both answered in full. (I suspect the same is true of international and BIPOC students, but my rosters don't reveal which students those are.)

I've seen lots of students who lacked confidence get trapped in mind games, wasting time worrying about (and sometimes asking me or the TAs) whether their solution was worth more or less than IDK, instead of putting forward their honest best effort. In particular, I've seen students who were already struggling, who might have scored 30-50% on an exam question, "play it safe" by answering IDK instead, and then after seeing the solution say "I did know that!"

The last time I taught algorithms, five students (out of 300) took the three-hour final exam in fifteen minutes or less. They walked in, sat down, got their exam booklets, wrote their name on the first page, wrote IDK on every other page, handed in the exam and walked out. None of those students passed.

I expect the next time I teach algorithms, without the IDK policy, exam averages will be slightly HIGHER, not lower. (I'd have data already, but the pandemic clouds everything.) I saw a similar score increase years ago when I stopped dropping the lowest problem score on each exam.

> IIRC, he also announced that the top 5% of the class would be automatic (and the only) A+ grades, and the bottom 5% would be automatic F grades.

Oh god no. I've never used grade quotas; that's just evil. My usual policy is that students with course averages above 95% automatically get an A+, students with course averages below 40% automatically get an F, and intermediate grade cutoffs are determined by score distributions that ignore those outliers. (I plan to move to an absolute grading scale the next time I teach the class.) In practice, that usually means about 4-6% A+s and 2-3% Fs, but I don't set those percentages in advance.


Thanks for taking the time to reply to everyone on this thread. Especially to correct my memory on grading, either I am misremembering the course or the policy.

The impact of IDK is an interesting example of unintentional bias. Do you think it is worthwhile publishing or sharing with the academic world at-large? Seems that if there are clear trends, it could be used as a guide for grading policy elsewhere.


That's how I'm used to it being in Europe. The average is correctly a C in most cases. But taking a year abroad in the US one would lose their spot if one got two B's. Not a big issue as the A's were given away like candy, though.



Jeff Erickson was my professor for the entire CS *73 stack at UIUC. Great teacher, but I still have nightmares thinking about those exams...


Can't find the exact policy reference, but I remember that if you don't understand Jeff's problems(in HW or exams), you could write "I don't know" and get 25% of the grades for the problems

not exact reference towards the policy: "In the table below, green scores are above 95% and red scores are below 25% (equivalent to "I don't know" on every page); those outliers were excluded when computing statistics and cutoffs." - https://courses.engr.illinois.edu/cs473/fa2012/


Not any more; see my comment here: https://news.ycombinator.com/item?id=26096052


Love the style already. Here's a footnote from Chapter 1, and a reason while I'll continue to (very leisurely) read this book.

> When I was an undergraduate, I attributed recursion to “elves” instead of the Recursion Fairy, referring to the Brothers Grimm story about an old shoemaker who leaves his work unfinished when he goes to bed, only to discover upon waking that elves (“Wichtelmänner”) have finished everything overnight. Someone more entheogenically experienced than I might recognize these Rekursionswichtelmänner as Terence McKenna’s “self-transforming machine elves”.


I'm a developer, but don't have the foggiest idea of how to prove something by induction. Is this the kind of book I should look at? Or is there something that should be taken as a prerequisite?


Former Illinois student here. There was another course called CS173 Discrete Structures that we took as a prereq to this class. You can find the textbook here http://mfleck.cs.illinois.edu/building-blocks/index.html with a chapter dedicated to induction


Many thanks for the response, I'll take a look


Try playing through the Natural Number Game by Kevin Buzzard and Mohammad Pedramfar. https://wwwf.imperial.ac.uk/~buzzard/xena/natural_number_gam...


it's a bit of a shame that the comments here have descended into a quibble over the availability of the solutions to the questions for each of the sections. All the while overlooking just how excellent the source material is written and also overlooking the fact that this is an entire textbook on college level algorithms that is being gifted away for free instead of locked behind a 150-200 dollar paywall at the bookstore.

to Jeff Erickson: Thanks for the book


Thanks for the kind feedback!


I think there are more than enough books to learn algorithms now. But there are a very little amount of resources that teach how to use them to solve problems.


That comes mostly from practice, and failing, and failing, and failing again, and finally succeeding.


Do you have personal recommendations for books to use for self-study for base algos knowledge?


I (self taught) went through Segewick's Algorithms. It is a serious study, but very code focused as opposed to math / proof focused, depending on your tastes. Its a masterpiece.

As an extension... whether one should read it depends on the goals. If you want to ace google style algorithm questions, you are better off spending an equivalent time churning through hackerrank (etc). This book will serve more as deep dive for curious minds that would put you (far) ahead of most devs in understanding, but you need to work through the exercises (or pair w/ leetcode / hackerrank) to demonstrate as much in an interview.


what about leetcode?


Good practice tool, not for learning though.


I still didn't understand the dynamic programming chapter.

What's the best way to prepare for DP in interviews?


> What's the best way to prepare for DP in interviews?

Do 100 of these problems: https://leetcode.com/tag/dynamic-programming/


I remember spending hours sometimes trying to solve a single problem but I did not look up the solutions just worked my way through the problem sets.

Algorithms definitely helped me prove code without explicitly writing it


I wish the solutions to the problems in this book were available somewhere.


IMO it’s a major waste of time to go through a book if I can’t check my solutions and be satisfied that I understood everything the instructor intended to from the problem. I won’t be investing the time into this book. Algorithms by Sedgwick instead has (third party) Solutions online.


You can still get value from a book that doesn’t give you all the answers. You can even get more value. Christ the answers have been all solved in papers, in literature, it’s all out there in small baby words what to do.

But the whole damn point of math is learning to do it on your own. It’s like bitching that an art textbook doesn’t include draw by numbers in the back pages.

“I just want to know I’m doing it right“ Then check your work? Proofs can be checked. People did math alone before you.

I really view this mentality as pretty childish. Life doesn’t have a solutions guide. Get over it. This is easily one of the best written books on the subject. And I love that the problems remain difficult and meaningful, _because_ there’s not just a solution guide out there for every problem.


Why are you so mad. Your argument is so overblown that even the modicum of value that is in your argument is rendered useless.

Why don’t you ask people to invent math, then, and not show them the way? Why even teach anything? Of course people learn by checking their proof and being thorough, but it’s up to them. Solutions can provide certainty for people, much like how peers and peer review system can in science. Even the most decorated academics need a second opinion, and you are pretending like that isn’t a thing.

I think you need to stop being so harsh and get over yourself. Not everybody uses a solutions manual the way you think.


I TAed for this course. That's why I'm so mad. I have a personal stake in this game and you're talking out of your ass. I ain't asking them to invent math any more than I ask a painter to invent painting, or a writer to invent writing. Do they have solutions guides?

I'm not asking anyone to invent math. I'm asking them to work through the solutions and attempt to find a proof themselves. A _proof_. Not a solution. Christ.

Reading only solutions for proof-based mathematics misses the entire point of writing proofs. It's learning how to write. Do essay based courses have solution guides? Does your English course have a solution guide for the essay? How do you get better at writing? You read the written word. You read examples. Just like the examples Jeff works out tirelessly in every single chapter for you. Then you're expected to do it yourself.

Read the actual damn exercises in the book instead of talking out of your ass from the comment section. Each question requires at least a couple paragraphs of articulation. Some require multiple pages - single spaced. Are you asking Jeff to provide a 5000 page solution guide for these problems? Some of these are even research problems, writing all the solutions to them would likely award Jeff a Turing Award.

Just like writing, there's a lot of other resources and books to read out there. Plenty of things to reference and places to find inspiration in. But it has to be on your own. You can't just pull out "Great Gatsby Essay Solutions Guide" and use it to write your essay. I don't care if that's "just how you learn".

Christ. I'm so angry because every one wants to teach every subject like it's fucking Calc 1. And that's plain idiocy. The entire value I got out of this course in undergrad was technical writing. Learning how to actually "write" a proof, and not just nonsensically sling notation at a poor soul. Comparing Jeff's writing with mine, seeing where I tripped up, and trying again.

When I TA-ed for the course, I had to fail so many students who "had the right solution" and they did. They had the perfect answer, that they copied from the fuck next door and couldn't write about to save their life. The alegbra was exquisite, the typesetting immaculate, the writing and logic completely incomprehensible. 1/5 points. Every time. Most of them couldn't compose a single full sentence.

Fuck the solutions. And fuck your mentality.


I won't comment on your attitude, to not stir up your emotions even more. I'll just pick a little paragraph from your comment:

> The entire value I got out of this course in undergrad was technical writing. Learning how to actually "write" a proof, and not just nonsensically sling notation at a poor soul. Comparing Jeff's writing with mine, seeing where I tripped up, and trying again.

Specifically:

> Comparing Jeff's writing with mine, seeing where I tripped up, and trying again.

Hey, you get it! You spent an entire screen trying to pretend that having model solutions is wrong and useless and pointless, but you made a slip up and admitted you've known the value all along! Oopsie.

But yeah, I understand your point (kind of), but you yourself seem to find value in comparing your solutions with the 'correct' ones — not only the contents, but the formulation as well. Do you find it so hard that others, maybe some that aren't from Illinois at all and just like the book, would do the same?


My entire point is he’s written all the model solutions you need. They’re in the notes. That’s what I compared with. I didn’t have additional resources I’m talking about here. Just comparing my proofs with the ones given in the notes above.

You can’t possibly write all the other ones. It’s not humanly possible. Try it. You’ll get a Turing award if you do.


Your analogies are actually terrible. If you can’t see it, I am sorry.

And also, this is not reddit or Twitter. Hell, the reason why you are being this angry is probably because it’s a forum like this. People here won’t respond to your anger like a troll. If you like the response, keep going. Everybody has their own psychological quirks.

I honestly don’t have time to read the entirety of a book I am commenting on. I never said I read the book. So you clearly know more about the book, more about the professor, etc.

But that doesn’t give you the fucking right to rage, does it.

Out of personal curiosity, I have read your comments in other threads. You get angry. A lot. For no reason. If you are educated and have a lot of stake and experience, you should at least pretend to be humble so that you don’t throw dirt on educated people like yourself (e.g. your professor).

You are making us all look bad :)


Yes. A lot of textbook writers take the time to structure the exercises so that working them out yourself guides you to a much deeper knowledge and appreciation.

One day, out in the real world, you will be faced with problems for which there is no solution ready to go. A good education prepares you for that challenge.


> And I love that the problems remain difficult and meaningful

And there it is, your argument comes down to gatekeeping.

If all the problems have been publicly solved, as you said, then what's the harm of having a solutions guide? The cheaters can already find what they're looking for and it helps the self-learners who are actually trying to learn.


> And there it is, your argument comes down to gatekeeping

Bullshit. If you want to play basketball in the NBA, you have to practice your ass off to develop the necessary skills. If you want to be a successful car mechanic, you have to practice your ass off to develop the necessary skills. If you want to be a successful cook, you have to practice your ass off to develop the necessary skills.

The homework is a vehicle for practice. Effective practice is real work. Real work is hard. Therefore, the homework must be hard.


They haven't. A lot of the exercises are unsolved research problems.

You're missing the point entirely. You're just banging your head against "Different people learn in different ways". I am saying, that the thing this course, (that I took by the way), is trying to teach students is the skill of writing proofs effectively.

A solutions guide, as you imagine it, would not teach students to write proofs effectively. Since many of the problems in this book are of a research level, many are highly advanced. Many require many multiple pages of exposition to describe the solution effectively.

You would thus have to make a tradeoff. Remove the harder questions and write simpler explanations, so you can write a cost-effective and printable solutions guide. But then the "solutions" aren't actually solutions at all, but vague allusions towards the correct process. The student assumes that the "answer" are these vague allusions, "since that's what the solutions guide says" and the entire point of the class is bypassed in favor of passing more students.

It has absolutely nothing to do with gatekeeping, or cheaters. And quite frankly, I don't believe that advanced mathematics will ever able to be the most accessible thing in the world. And that's just its nature.

EDIT: Seriously if this was Calc, I'd totally agree with you 110%. A lot of people can only learn that stuff by staring at the answer being worked out. But that's not math man, and it's not what we want to teach people in this course.


Thanks for the more reasonable take, though I still have to disagree.

What you're saying directly contradicts the professor's own statement:

> Please do not ask me for solutions. With very rare exceptions, I will say no, even if you are an instructor. I recognize that my stance limits the utility of these materials, especially for self-learners, but I'm trying to optimize the learning experience of my own students at Illinois. The point of homework is not to solve that particular homework problem, but to practice solving a type of problem and get honest feedback on your progress. I've found that when solutions are available, my own students are much more likely to rely on them, rather than trying to figure out the problems themselves, which means they get both less practice and less honest feedback, which means they do worse on exams and in the course overall.

> And while I firmly believe that each student is ultimately responsible for their own learning, I also believe that it's my responsibility as an instructor to help them. Putting dessert on the table does not help anyone eat their vegetables.

tl;dr: students tend to rely on solutions when they are available, they don't learn as much and get worse grades which reflects badly on him.

It has _nothing_ to do with a tradeoff of writing simpler explanations for a more printable guide. He even acknowledges that it limits the utility for self-learners, which you disagree. He's a professor with obligations to his students so I understand his decision, just sucks that an amazing book won't be more accessible to people.


Thank you for engaging the other commenter and articulating my stance better than I could have. Also - while I have deep respect (I truthfully do) for the expertise of folks who teach this material - I have lost patience for their patronising tones and unhelpful assumptions about the folks that might read this book and books like it.

The world needs an algorithms book that shows a modicum of humility to its readers. A book that assumes that more than simple children are reading it (incidentally, and in a puzzling contradiction - also using needlessly convoluted English to express ideas). Hopefully I can do something about that ‘one day’.


Totally agreed, the academic world has always operated and depended on a walled garden approach and making things needlessly complicated. Thankfully the cracks are forming, the pandemic probably sped things up quite a bit with universities trying to charge students to essentially watch Youtube videos.

What's funny to me is that UIUC offers an online CS masters program now. Not having accessible solution guides seems like a disadvantage to these students.


Let me write these solutions to these research level problems....Just give me a couple years and some funding please. They don’t have solutions yet. Hello? You have to figure them out because the professor doesn’t know.

Are you even reading what I’m saying? How do they write solutions? I feel like a crazy person as everyone is talking about a walled garden. Like hello? Do you understand what, “there is no solution until you find it” means? Do you understand what, “there are many worked solutions in the text” means?


While I agree with you, you have to remember who the HN audience is. There's a reason why the top voted comment in any thread about math is someone asking for solutions.


I’d recommend downloading at least the frontmatter, which has great information on prerequisites and matching (free) texts, plus an annotated bibliography of texts at the level of the book itself.


Thanks for posting this. I like the links to prerequisite information as well.


> Algorithms by Jeff Erickson (Free algorithms textbook)

Please, change title to: "Algorithms by Jeff Erickson, free book (2019)"


Thanks, I've changed the title. But I'm confused by the page saying "1st edition (2019)" when there are HN threads going back at least to 2015: https://news.ycombinator.com/item?id=10661376


> HN threads going back at least to 2015

Guess, as on 2015 it was WIP.[0]

[0] http://web.archive.org/web/20160102200214/http://web.engr.il...


The book evolved from lecture notes that I've been publicly posting since at least 2005.


I emailed the mods.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: