**Hamming distance **measures the minimum number of *substitutions* required to change one string into the other, or the minimum number of *errors* that could have transformed one string into the other. It is also known as *edit distance* between two strings.

For binary strings* *$a$ and *$b$* the Hamming distance is equal to the number of ones in $a \oplus b$.

Lets consider a code $C$ and minimum hamming distance between any of its codewords be $\lambda$.

**1.** A code *$C$* is said to be *$k$ ***errors detecting** iff *$ \lambda\geq k+1 $*.

It can detect error upto edit distance of $k$.

$$k\leq\lambda-1$$

So this code can detect an error of at most $\lambda-1$ edit distance.

**2.** A code *$C$* is said to be *$k$ ***errors correcting** iff *$ \lambda\geq 2k+1 $*.

It can correct error upto edit distance of $k$.

$$k\leq \lfloor\frac{\lambda-1}{2}\rfloor$$

So this code can correct an error of at most $\lfloor\frac{\lambda-1}{2}\rfloor$ edit distance.

Now coming **back to the question**, here $\lambda = 4$

Thus we can detect maximum error of $4-1=3$ bits.

And can correct maximum error of $\lfloor\frac{4-1}{2}\rfloor=1$ bit.

source: Error_detection_and_error_correction