Bayesian Algorithm Definition And Example