From theory: If, for a code C, d(C)≥ s+ 1 then C can detect up to s errors. If d(C) ≥ 2t+ 1 then the code C can correct up to t error.
Assume that we have C={00001, 00010, 00100, 01000, 10000}
Then: d(C)=2 for every pair which is also the Minimum distance .So form the above:
d(C)≥ s+ 1 --> 2-1 ≥ s --> 1≥s Which means that C can detect up to 1 error. But as i can see the code is constant weight wt(C)=1 so is the codeword 00001 is sent and we receive 11100 which has weight 3 we can detect that 2 errors have occurred ( 2 additional 1's). So what is wrong here?
Moreover can the code correct any errors?
From theory :
d(C) ≥ 2t+ 1 ---> 2 ≥ 2t+1 ---> 1 ≥ 2t ---> 1/2 ≥ t no error can be corrected Thank you in advance
Regarding error detection, there is no contradiction between theory and your example code $C$. First, theory says that if we have a code $C'$ with minimum distance greater than $s$, then $C'$ can detect $s$ errors. I assume you know the proof of this fact. Note that this fact only states that, under the given condition, $C'$ can detect $s$ errors. $C'$ might or might not be able to detect more errors.
This fact also holds true for your example code $C$, and since $C$ has minimum distance $2$, it can detect $1$ error.
Now you have the example: "input $00001$ and output $11100$". First, we have to get clear about the exact definition of error detection. To me, error detection means that we only know the output but not the input. Given the output, we then have to decide with certainty whether or not an error occured. In your example, the output $11100$ obviously isn't a codeword, but the original input could have been $10000$ (two errors) or $00001$ (four errors).
But your example is just a special case. The statement "code $C'$ can detect up to and including $m$ errors means that for any valid input (i.e. any codeword) and any distortion of that codeword in up to and including $m$ bits, the code can detect this distortion as faulty (i.e. this distortion is not a codeword).
For example, if we're using your code $C$ and have the output $10000$, this could be a correct transmission of $10000$, or it could be a faulty transmission of $01000$ with two errors. So we have one instance where $C$ cannot detect two errors, so it can't detect two errors in general.
The code $C$ can't correct any errors. If we fix an $m \in \mathbb N$, then $m$-error correction means that given any output and assuming it contains at most $m$ errors, we can reconstruct the input from that output with certainty. Now, the code $C$ isn't $1$-error correcting (and thus not $m$-error correcting for any $m \in \mathbb N$). A counterexample is the output $11000$. Assuming $1$ error, the input could have been $10000$ or $01000$.