Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

As part of an answer to a Stack Overflow question I made the assumption that if I choose two distinct positive integers $m$ and $n$, them give you $m - n$ and $m$ XOR $n$, then you can uniquely determine what $m$ and $n$ were. For all the examples I've tried this seems to work correctly, though I have no reason to believe that this should work in general. Moreover, I'm not familiar enough with the interactions of differences (or sums, for that matter) and XOR to deivse a proof or counterexample.

Is my claim true? If so, how would you go about proving it? If not, is there a nice counterexample?

Thanks so much!

share|improve this question
add comment

2 Answers 2

up vote 9 down vote accepted

I believe this is false.

Let $2^r \gt m \gt n$.

Then

$2^r + m$ and $2^r +n$ have same difference and XOR as $m,n$.

share|improve this answer
add comment

How about (2,3) and (16,17)? plus some characters

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.