"In classical computing and quantum computing, we correct errors using repetition code but in life, we correct errors by doing the right thing and apologizing whenever we make an error."
Error-correcting codes generally rely on encoding information from one bit into many bits to prevent errors. The classical repetition code is repeating a single bit into many bits. E.g. '0' is encoded as '0000' and '1' is encoded as '1111'.
Suppose we have a single-bit flip error during the sending of a message, where 0 accidentally gets flipped to a 1. Consider this table:
By observing other bits we can assume that the sender is sending all bits as 0 but one of the bits is flipped. Hence it is easier to detect the error with repetition code. But if all bits get flipped then error correction can't detect the error as it will assume that the sender is sending all bits as 1.
An Air Conditioner determines whether it must stop cooling (output bit 0) or it must start cooling (output bit 1) using some algorithm that considers surrounding air data, the closeness of the room, the temperature of the room and AC conditions. But the system is faulty and prone to errors and 5% of the time the output bit shows 0 when it should be 1 or vice versa(a bit-flip error). To encounter such problems, engineers have implemented a 3-bit repetition code in the system.
The original bit is called a logical bit written as 0 with a horizontal bar over it and its encoded version the physical bit written as 000.
Now, consider the below table:
In the upper 4 rows of the table, the majority of bits in physical bits are 0s. Hence if one of the bits is 1(001) then we can assume that there will be a bit flip error and hence final logical bit is 0. In the below 4 rows of the table, the majority of bits in physical bits are 1s. Hence if one bit is 0(110) then we can assume that there will be a bit flip error and hence final logical bit is 1. But if there are 2-bit flip errors then the result will be incorrect.
So how many simultaneous bit-flip error occurs to cause logical bit 000 to be incorrectly interpreted as 111?
Answer: 2 or 3 bits flipped.
How does the answer change if we use a 5-bit repetition code where physical bits = 00000 or 11111? How many bits must be flipped to incorrectly interpret 00000 as 11111?
Answer: 3 or 4 or 5 bits flipped
Possible errors:
00000 -> 00111, 01110, 11100 -> (3-bit flip errors)
00000 -> 01111, 10111 -> (4-bit flip errors)
00000 -> 11111 -> (5-bit flip errors)
How does the answer change if we use an n-bit repetition code?
Answer: Any more than half on n.
From here we conclude that more physical bits for each logical bit means we can tolerate more errors.
Conclusion:
One logical bit is encoded using several physical bits to make error detection and correction easier.
More physical bits for each logical bit means we can tolerate more errors.
In the next blog, we will see what are Quantum Repetition Codes.