Solving algebraic and logical equations simultaneously If $x$ and $y$ are two natural numbers.  
$x - y = 126$
$x\oplus y = 130$
$\oplus$ is the XOR operation for binary numbers.
I thought that two equations are enough to find two unknowns.
But this system of equations has multiple solutions.  Why is it so? Is it because the nature of equations are different? I wrote a program to find the solution as these are not sovable by hand ( I think!).
Some of the solutions are $(x=128, y=2)$ and $(x=213, y=87)$.
 A: The important part of the nature of minus and xor in this case is that neither operation tells you anything about how large the numbers involved are, only how far apart they are.
$x\oplus y = 130$ tells us that whatever numbers $x$ and $y$ are, their binary representation differ only in the least significant eight bits (actually, they differ exactly in the $128$-bit and the $2$-bit). Thus, if we change any of the bits of the two numbers in the same way in both numbers, then we don't change their xor. If said change doesn't touch the $128$-bit and the $2$-bit, then it won't change the difference between the two numbers either, since this change will amount to adding the same number to both $x$ and $y$.
For instance, if $x_0, y_0$ soves your equaiton, then so does $x_0+2^8, y_0+2^8$. While I don't know whether this accounts for all the multiple solutions, it will generate all solutions from a relatively small initial set of solutions.
A: $x$ and $y$ must have identical bits where $130\ (10000010_2)$ has a zero and different bits elsewhere, so they differ only in the bits of rank $1$ and $7$.
Then the equal bits contribute nothing to the difference $x-y$, while the bits that differ contribute $\pm2^r$ where $r$ is their rank.
This shows that $x-y$ can only be one of $\pm2^7+\pm2^1$, namely $2^7-2^1$, and
$$x=\cdots\times\times\times\times\,1\times\times\times\times\times\,0\,\times,\\y=\cdots\times\times\times\times\,0\times\times\times\times\times\,1\,\times.$$
They can be expressed as
$$\begin{align}x&=256k+4m+n+128,\\y&=256k+4m+n+2\end{align}$$ where $m\in[0,31]$ and $n\in[0,1]$. They are all the integers but those having equal bits $1$ and $7$ !
