# XOR: Is it possible to get $a$ and $b$ if I have $a \oplus b$ and $a \times b$?

Intuitively I would say yes but I can't find a way to prove it. I tried with small values and bruteforcing shows that there seems to only be one solution given a distinct tuplet.

For example $$(1,72)$$ has only $$(8,9)$$ as valid $$a$$ and $$b$$ values. Is there a way to do this mathematically?

• Welcome to Puzzling.SE! For the uninitiated in the room (such as me), would you mind explaining what precisely is meant by the little symbol that looks like a Phillips head screw? Thanks, and have a great day! – Brandon_J May 4 '19 at 17:28
• It’s bitwise addition modulo 2, @Brandon_J – El-Guest May 4 '19 at 17:30
• Thanks for letting me know, @El-Guest . – Brandon_J May 4 '19 at 17:30
• So essentially, I convert the number to binary (for exapmle, 3-->00011, 24-->11000), then perform theXOR operation on each pair of bits, and then convert back to a normal number (27)? – Brandon_J May 4 '19 at 17:54
• Not sure this is a puzzle, but I'm glad you got your answer. (Please don't forget to $\color{green}{\checkmark \small\text{Accept}}$ it!) – Rubio May 5 '19 at 4:34

## 1 Answer

By counterexample, $$a,b$$ pair is clearly not unique.

The pairs $$(5,9)$$ and $$(3,15)$$ both multiply to $$45$$, and add bitwise to $$12$$.

$$5 \oplus 9 = 12$$, $$5 \times 9 = 45$$
$$3 \oplus 15 = 12$$, $$3 \times 15 = 45$$

• @Hugh, thanks for the edits - looks nicer now! – ppgdev May 5 '19 at 3:09
• I edited it quickly off my phone a few hours ago, so I have it another go. Hopefully it still looks good. – user46002 May 5 '19 at 4:47
• @Hugh, sure. Thanks. – ppgdev May 5 '19 at 16:28