I got confused with deterministic and probabilistic algorithms. Am I right by assuming that algorithms are called probabilistic once they use some sort of randomness?

Initially, I thought only algorithms outputting random numbers are called probabilistic. They are obviously non-deterministic.

However, what about the following algorithm: Take BubbelSort and randomly decide whether to start sorting from left to right or from right to left. If you modify the sorting order, the algorithm is deterministic, because small values will always be on the left and great values on the right side (or vice versa). As there is some randomness in the algorithm, do we call this algorithm probabilistic?

In short: Any algorithm using some randomness is called probabilistic. Is that correct? However, this term has nothing to do with determinism and non-determinism. Is that correct?

  • $\begingroup$ "probabilistic algorithm" isn't really a well-defined term, it's more colloquial. I think no one would call you out on this usage but I'm not sure it's standard. I'd like to point out that determinism and nondeterminism are however well defined. Their definitions come in two flavors. One flavor is that the same input will produce the same output. Another flavor has to do with automata and Turing machines which always produce the same result but can execute many branches at the same time. Your bubble sort example uses randomness but is deterministic. $\endgroup$ – Jake Dec 4 '17 at 8:31
  • $\begingroup$ This means that my bubble sort example is deterministic and probabilistic as well? $\endgroup$ – null Dec 4 '17 at 8:42
  • $\begingroup$ My claim is that there is no authority on whether or not your algorithm is probabilistic or not because this quibble over definition is not one that matters in practice. I think calling your example "random" or "probabilistic" is perfectly fine but it's not as if it's right either. $\endgroup$ – Jake Dec 4 '17 at 8:45
  • $\begingroup$ Related: cs.stackexchange.com/questions/5008/…. $\endgroup$ – Yuval Filmus Dec 4 '17 at 8:59

A probabilistic algorithm is one which has access to the output of a random source during its computation. It might be the case that although the algorithm uses randomness, the output is deterministic, i.e. for every possible random string obtained from the source the output is the same (you can always just ignore the source and act solely on the input).

Note that when you're dealing with probabilistic algorithms, your output becomes a random variable. The output can be deterministic in the sense that it is always the same, or can take some value with probability 1 (which is a weaker statement).

  • $\begingroup$ Okay, this means that probabilisitc algorithms can be both determinisitic and non-deterministic!? $\endgroup$ – null Dec 4 '17 at 8:42
  • $\begingroup$ In the above I used the word deterministic to mean its intuitive interpretation, and not in a precise sense. Non deterministic computation has a precise meaning in computer science, and has nothing to do with probabilistic computation. If you look for formal terms, then "regular" algorithms are deterministic, and algorithms with access to randomness are probabilistic. $\endgroup$ – Ariel Dec 4 '17 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.