[Math] Error probability of repetition code

coding-theoryprobability

I am very lost. I would like to know how I calculate the probability of finding errors in repetition code.

For example say the codewords are 111 or 000 and probability of an error is 0.1. How would I find the probability of having one error in the transmitted codeword? i.e the chance that 000 becomes 001, 010, 100 or 111 becomes 110, 101, 011?

Am I correct to believe that this formula is the answer?
Where P is the probability 0.1

$$3p^{2}(1 − p) + p^{3} = 0.028$$

If so, how would I compute the chance of receiving a codeword with one error with a repetition code of (4,1) or (5,1), (6,1) etc. I cannot find any examples that make this clear or if I'm even on the right tracks.

Best Answer

Am I correct to believe that this formula is the answer?

What you need is not to know "the formula", but where it comes from.

In $(3,1)$ repetition code, we code the 0 as 000. The decoding (assuming a BSC channel with crossover (bit error) probability $p<1/2$) is by majority: if, say, we receive 001 we decide that it's more probable that the trasmitted codeword was 000 than 111. Why? Because it's more probable to have a single bit error (000 $\to$ 001 : last bit was changed) than having two (111 $\to$ 001 : two first bit changed).

When does this decoding strategy fail? It should be clear that the decoding is wrong where there are indeed two bit-errors ... or three. If we trasmit 000 and the first and last bit are flipped, so we receive 101, the decode will guess : 111 and we'll have decoding error. Conclusion: the event "decoding error" is equivalent to the event "having more than half bit errors". The formula you copied computes this, the first term correspond to the 2-bits errors (there are 3 possible cases) and the last term for the 3-bits error.

If you understood the above, then you should be able to compute the probability of bad decoding for a repetition $(5,1)$ code (I've never seen a $(4,1)$ repetition code ; even lengths are avoided to get rid of ties).

Related Question