XOR of 6 numbers in pair of 3

85 Views Asked by At

I have this question where u are given 6 numbers with indices 1,2,3,4,5,6 and u are given the xor of these numbers in pair of 3.

$$x_1\oplus x_2⊕x_3=a\\ x_2⊕x_3⊕x_4=b\\ x_3⊕x_4⊕x_5=c\\ x_4⊕x_5⊕x_6=d\\ x_5⊕x_6⊕x_1=e\\ x_6⊕x_1⊕x_2=f$$

and we need to find all the six numbers. What i tried was to take xor of these triplets to get xor of any other pair (which worked for me for 4 and 5 numbers) but this method is not working for 6 numbers.

my attempt for n=4.

$$x_1⊕x_2⊕x_3=a\\ x_2⊕x_3⊕x_4=b\\ x_3⊕x_4⊕x_1=c\\ x_4⊕x_1\oplus x_2=d$$

$a⊕b⊕c$ gives me the 3rd number. Similarly we can get the rest of the numbers, but i cant figure out a solution for 6 numbers.

3

There are 3 best solutions below

0
On

Guide:

We have

$$x_1 \oplus x_2 \oplus x_3 \oplus x_4 \oplus x_5 \oplus x_6= a\oplus d= b \oplus e = c \oplus f$$

Hence, to be feasible, we require $$a\oplus d= b \oplus e = c \oplus f.$$

Suppose the system above holds, to solve the system, we first choose our desired $x_5$ and $x_6$ and solve for $x_4, x_3, x_2, x_1$ in that order.

0
On

You can't do that.

Say, our xors of triplets are $(a,b,c,d,e,f)=(0,0,0,0,0,0)$. Can we guess what the numbers were?

Why, sure: $(x_1,x_2,x_3,x_4,x_5,x_6)=(0,0,0,0,0,0)$.

But wait, there is another solution: $(x_1,x_2,x_3,x_4,x_5,x_6)=(1,2,3,1,2,3)$. (Don't take my word for it! Check it yourself, make sure it works.)

And there are many more: $(x_1,x_2,x_3,x_4,x_5,x_6)=(3,4,7,3,4,7)$... and so on.

How can that be, might you ask? After all, we were able to solve the system for $n=4$ and $5$, weren't we?

Well, it just turns out there is something peculiar about the number $6$ that makes it behave differently from $4$ and $5$. What is this trait I leave for you to discover.

0
On

for $6$ numbers you can try: \begin{align*} x_1⊕x_2⊕x_3&=a\\ x_1⊕x_2⊕x_4&=b\\ x_3⊕x_4⊕x_5&=c\\ x_3⊕x_4⊕x_6&=d\\ x_5⊕x_6⊕x_1&=e\\ x_6⊕x_5⊕x_2&=f \end{align*} there is actually a pattern, let me give another example: for $9$ numbers you can try: \begin{align*} x_1⊕x_2⊕x_3&=a\\ x_1⊕x_2⊕x_4&=b\\ x_3⊕x_4⊕x_5&=c\\ x_3⊕x_4⊕x_6&=d\\ x_5⊕x_6⊕x_7&=e\\ x_6⊕x_7⊕x_8&=f\\ x_7⊕x_8⊕x_9&=g\\ x_8⊕x_9⊕x_1&=h\\ x_9⊕x_5⊕x_2&=i \end{align*}