Flipped Colour

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:

  • Squares numbered 1 , 3 , 5 , 7 1,3,5,7 have an odd number of red squares.
  • Squares numbered 2 , 3 , 6 , 7 2,3,6,7 have an even number of red squares.
  • Squares numbered 4 , 5 , 6 , 7 4,5,6,7 have an odd number of red squares.

Which is the original message Alice wanted to send?

Details and assumptions:

  • The options are expressed as binary numbers : 1 1 represents a red square and 0 0 represents a white square.
1001000 1011110 1100000 1111000 1101010 1101001

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.

2 solutions

Seth Christman
Sep 20, 2016

Currently we have 1101000 1101000 as our starting value with positions 1 = 1 , 2 = 1 , 3 = 0 , 4 = 1 , 5 = 0 , 6 = 0 , 1=1, 2=1, 3=0, 4=1, 5=0, 6=0, and 7 = 0 7=0 .

Analyzing the hints from Alice, we see that

1 + 3 + 5 + 7 = 1 = o d d 1+3+5+7 = 1 = odd

2 + 3 + 6 + 7 = 1 = o d d 2+3+6+7= 1 = odd

4 + 5 + 6 + 7 = 1 = o d d 4+5+6+7= 1 = odd

but 2 + 3 + 6 + 7 = e v e n 2+3+6+7 = even 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 , 2, 3, 6, or 7 7 . The only one that applies is box 2 2 , therefore we change it to white, giving us 1001000 1001000 as the binary representation.

Arjen Vreugdenhil
Sep 23, 2016

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 x_7x_6x_5x_4x_3x_2x_1\ a_2a_1a_0\ e , where a n a_n shows the number of x i x_i for which bit n n is set (1 = odd, 0 = even). Here the original message was 0001001 101 0 0001001\ 101\ 0 .

  • When the message is received, the receiver calculates a 2 a 1 a 0 a'_2a'_1a'_0 in the same manner for the received 7 bits. In this case the message received is 0001011 0001011 making a = 111 a' = 111 .

  • Now calculate c = a xor a c = a\ \text{xor}\ a' . In this case, c = 101 xor 111 = 010 c = 101\ \text{xor}\ 111 = 010 . If c = 0 c = 0 the message was received well. Otherwise, c 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 a is messed up? For that situation, we set along an eleventh bit e e , which indicates whether a a has an even (0) or odd (1) number of ones. If after reception the values of a a' and e e' do not match, we know that the error occurred either in b b or e e ; assuming that no more than one bit was sent wrong, we simply accept the value of x x as received.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...