User:PhoenixIra/Almost Sure Termination

A probablistic program is called almost surely termninating, if on every input the probablitiy the program terminates is 1. In other words, it is probabilistic guaranteed to terminate. This does not mean that the program does not allow non-terminating paths, but hese have a probability mass of 0. This also does not mean that the program terminates in a reasonable time, as the program could have an expected runtime of infinity.

Definition
A program is almost surely terminating, if the input is terminating with probablitiy 1 on one or all inputs. If it is only terminating with probability 1 on a specific input, the input is usually explicitly stated. Formally, we say a program $$P$$ is almost surely terminating on the input $$\sigma$$ if and only if

$$ \mathbb{P}(P(\sigma) \text{ terminates})=1. $$

We say a program $$P$$ is almost surely terminating if and only if $$P$$ almost surely terminats on all inputs.