Alice wants Chris--a mischievous little boy--to deliver a message to Bob which consists of 7 squares, numbered 1 through 7 from left to right and colored either red or white. As expected, Chris switches the color of exactly one of the 7 squares in the original message and thus Bob receives the following message:
Alice knew beforehand that Chris would play this trick, so she had already told Bob the following information on the original message:
Which is the original message Alice wanted to send?
Details and assumptions:
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Conditions 1 and 3 are satisfied, so squares numbered 1, 3, 4, 5, 6, 7 are okay. Condition 2 is false, showing that square 2 is wrong.
This is an example of a 1-bit self-correcting code of the type 7-3(-1). It is designed to work as follows:
The message is sent as x 7 x 6 x 5 x 4 x 3 x 2 x 1 a 2 a 1 a 0 e , where a n shows the number of x i for which bit n is set (1 = odd, 0 = even). Here the original message was 0 0 0 1 0 0 1 1 0 1 0 .
When the message is received, the receiver calculates a 2 ′ a 1 ′ a 0 ′ in the same manner for the received 7 bits. In this case the message received is 0 0 0 1 0 1 1 making a ′ = 1 1 1 .
Now calculate c = a xor a ′ . In this case, c = 1 0 1 xor 1 1 1 = 0 1 0 . If c = 0 the message was received well. Otherwise, c is equal to the bit with the error--here, bit 2. Flip this bit and you have the original message!
What if the bits of the message are communicated well, but one bit of a is messed up? For that situation, we set along an eleventh bit e , which indicates whether a has an even (0) or odd (1) number of ones. If after reception the values of a ′ and e ′ do not match, we know that the error occurred either in b or e ; assuming that no more than one bit was sent wrong, we simply accept the value of x as received.
Problem Loading...
Note Loading...
Set Loading...
Currently we have 1 1 0 1 0 0 0 as our starting value with positions 1 = 1 , 2 = 1 , 3 = 0 , 4 = 1 , 5 = 0 , 6 = 0 , and 7 = 0 .
Analyzing the hints from Alice, we see that
1 + 3 + 5 + 7 = 1 = o d d
2 + 3 + 6 + 7 = 1 = o d d
4 + 5 + 6 + 7 = 1 = o d d
but 2 + 3 + 6 + 7 = e v e n according to Alice. Therefore one of these boxes is the switched box.
Now since the other two statements hold true, we cannot change a box within their sets or we would change the red count to an even number. Therefore we must change a box that is exclusive to 2 , 3 , 6 , or 7 . The only one that applies is box 2 , therefore we change it to white, giving us 1 0 0 1 0 0 0 as the binary representation.