Deterministic and probabilistic algorithms, heuristics, and unsolvable problems

A deterministic algorithm always produces the same output for the same input, while a probabilistic (randomized) algorithm uses random choices, so it may give different results on different runs; for example, randomly sampling points can estimate the value of pi, getting closer with more samples. Some problems are technically solvable but impractical: for the traveling salesperson problem, finding the shortest route through many cities by checking every possible route takes far too long as the number of cities grows, because the number of routes grows faster than exponentially. In such cases, programmers use a heuristic, a shortcut that finds a good-enough solution quickly without guaranteeing the best one, like always visiting the nearest unvisited city next. Some problems cannot be solved by any algorithm at all. In 1936 Alan Turing proved that no algorithm can correctly decide, for every possible program and input, whether that program will eventually stop or run forever; this halting problem is the classic example of an undecidable problem.

This explanation is AI-generated and can occasionally be wrong.

Vibistic AI

🔒 We never store your messages. The free built-in AI runs through Vibistic's own server, on Cloudflare's own AI infrastructure. You can also add your own API key to send messages straight from your browser to your AI provider instead.

  • Ask a question about Deterministic and probabilistic algorithms, heuristics, and unsolvable problems, like "can you give me another example?"

Your notes

Test your knowledge

This test is AI-generated and can occasionally be wrong. If something looks off, use Report below.

No API key configured yet. Clicking below will ask whether to add one or take a free version of this test when one is available.

Midterm

This test is AI-generated and can occasionally be wrong. If something looks off, use Report below.

No API key configured yet. Clicking below will ask whether to add one or take a free version of this test when one is available.

Final

This test is AI-generated and can occasionally be wrong. If something looks off, use Report below.

No API key configured yet. Clicking below will ask whether to add one or take a free version of this test when one is available.