Comment by atn34
10 hours ago
One of my professors used an example like this to encourage you to pause if you ever find yourself doing something like "maybe if I just flip this < to > the tests will pass". The space of incorrect programs (even ones that pass your tests) is enormous compared to the space of correct programs.
If you like thinking about this and haven't seen this before, check out the busy beaver problem[1].
I remember the Computer Recreations column in Scientific American on busy beavers back in 1984. I was too young then to really appreciate it. (I really miss that column—and the Amateur Scientist.)
I found it here (page 19) https://wkbpic.com/wkbx/SA/1984/1984-08-01.pdf
flipping > to >= works quite often though!
I was about to say a lot of algorithms or invariant bugs for me are slight mistakes at an edge of something
"There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors."
1 reply →