The ideal observer performs maximum a posteriori decoding: for received word , it maximizes , equivalently . Maximum-likelihood decoding maximizes the latter conditional likelihood alone. Minimum-distance decoding minimizes the Hamming distance . Ties may be resolved arbitrarily among maximizers.
For independent errors in a binary symmetric channel,
For , its ratio on increasing the distance by one is . Thus maximum-likelihood decoding and minimum-distance decoding select exactly the same codewords. At the allowed endpoint , they agree on a possible observation ; impossible observations have zero likelihood for every codeword, so an arbitrary maximum-likelihood tie rule need not agree with minimum distance. This qualification is needed for the literal assumption .
For the specified observation, the Hamming distances from 000 and 111 are two and one. Their likelihoods are and , respectively. After multiplying by the priors, their joint probabilities are and , so their posterior probabilities are and . Therefore
The binary symmetric channel with crossover probability has channel matrix
Maximum-likelihood decoding chooses a codeword maximizing , while minimum-distance decoding chooses one minimizing the Hamming distance . For a block of length sent through a binary symmetric channel,
When , the final factor decreases strictly with the distance. Thus maximum-likelihood and minimum-distance decoding agree.
For the length-three repetition code , majority decoding is wrong exactly when at least two bits flip. Therefore