How to solve xor equations with multiple variable?

162 Views Asked by At

I have 9 variables $$a_1,a_2,a_3 ... a_9 $$ and want to extract their values using the following equations. $$ a_1 \oplus a_4 = D1 $$ $$ a_2 \oplus a_5 = D2 $$ $$ a_3 \oplus a_6 = D3 $$ $$ a_4 \oplus a_7 = D4 $$ $$ a_5 \oplus a_8 = D5 $$ $$ a_6 \oplus a_9 = D6 $$ $$ a_1 \oplus a_7 = D7 $$ $$ a_2 \oplus a_8 = D8 $$ $$ a_3 \oplus a_9 = D9 $$ $$D1, D2, D3, ... D9 $$ are given interger values. How to solve this kind of question or specifically this question?

1

There are 1 best solutions below

8
On

The system need not be consistent.

To be consistent, we require $$D_1 \oplus D_4 = D_7$$

$$D_2 \oplus D_5 = D_8$$

$$D_3 \oplus D_6 = D_9$$

Suppose those conditions are satisfied, the whole system of equations is equivalent to the first $6$ equations.

We have $6$ independent equations and $9$ variables, we have $3$ degree of freedom. Fix $a_7, a_8, a_9$, use backward substitution to solve for the other variables.

Remark: Notice that this is a linear system of equations, we can use Gaussian elimination.