Consider a randomized algorithm that solves a problem on a particular input correctly with…
Consider a randomized algorithm that solves a problem on a particular input correctly with probability p, and it’s wrong with probability 1 − p. Assume that each run of the algorithm is independent of every other run, so that we can think of each run as being an (independent) coin flip of a p-biased coin (where heads means “correct answer”).
(Requires calculus.) Suppose that the probability p is unknown to you. You observe that exactly k out of n trials gave the correct answer. Then the number k of correct answers follows a binomial distribution with parameters n and p: that is, the probability that exactly k runs give the correct answer is