4 ms·
Boss: Hey $employee, I see in my report we've been having a lot of problems with code not terminating. I need you to build a function that finds if an arbitrary
by marginalia_nu 4y ago
Boss: Hey $employee, I see in my report we've been having a lot of problems with code not terminating. I need you to build a function that finds if an arbitrary function will halt and deploy that into production ASAP. I've already promised sales this will come and I'm on my way to write a press release announcing my brilliant feature!
Employee A: Yes sir! I'll get right on it!
Employee B: I don't know, boss. This is basically a pretty well studied problem called the halting problem, and I'm not sure we'll be able to build this all too easily even if we try really hard...
- djmips 4y agoThanks for the example.
- Someone 4y agoEmployee C: we need to discuss the arbitrary part. I think most real-world business processes can be proven to halt, assuming inputs are finite. (When was the last time you wrote a while or repeat until loop, or a recursive function that didn’t iterate over an input?
- marginalia_nu 4y ago> (When was the last time you wrote a while or repeat until loop, or a recursive function that didn’t iterate over an input? Iterating until a convergence criteria is met is fairly common in numerical calculations. It's also fairly common when dealing with graphs that may not have a beginning or an end in a conventional sense. PageRank does both of these things, for example.