Given two integers, $a$ and $b$, I need an operation to produce a third number $c$. This number does not have to be an integer. The restrictions are as follows:
- $c$ must be unique for the inputs (but it does not have to be reversible).
- $a$ and $b$ must be interchangeable ($a$ & $b$ = $b$ & $a$)
Initially, the first thing I thought of was simply $a+b$, however naturally that does not fit restriction 1. Then I considered a hash function of some sort, but that doesn't fit 2.
Any thoughts?
hash(max(a,b) + ":" + min(a,b))
– Dancrumb Jul 31 '14 at 01:11f(a,b) = min(a,b) + i*max(a,b)
– mbeckish Jul 31 '14 at 20:24