Error correcting codes
To detect d bit errors we need a distance d+1 code because there is no way d single bit errors can change one valid code word into another valid code word.
To correct d errors we need a distance 2d+1 code because legal codewords are so far apart so that with even d changes - the original codeword and the modified codeword are still closest.