# Unique $C = \operatorname{hash}(A, B)$

I want to derive a non-associative operation $\circ$ such that $C = A \circ B$ and that same $C$ can not be obtained by any other combination(s) of $A$ and $B$ e.g. much like $C = \operatorname{hash}(A, B)$

-
You should give some more information. What are $A,B$? Since you included the operator theory tag, I assume they are operators on some Banach space? Is "hash" some well known function? If so include a link. Otherwise say explicitly what you mean by $C = \text{hash}(A,B)$. – user12014 Oct 26 '11 at 17:34
What kind of things are $A$ and $B$? – Henning Makholm Oct 26 '11 at 17:35
That's not a hash. A hash is meant not to be injective. – joriki Oct 26 '11 at 17:35
A and B are positive integers – Neel Basu Oct 26 '11 at 17:51

You can take $C=2^A3^B$. This is injective and not associative, since e.g. $(1\circ1)\circ1=2^13^1\circ1=6\circ1=2^63^1=192$, whereas $1\circ(1\circ1)=1\circ6=2^13^6=1458$.
Almost all operations are not associative, and it's straightforward to make them injective, so examples of such operations abound. Another example would be: Form $C$ by interleaving the digits of $A$ and $B$ (adding zeros where necessary). That is, if $A=7354$ and $B=81$, then $C=70305841$. You get a whole family of operations by doing this in different bases. Another example would be $C=2\left(\max(A,B)^2+\min(A,B)\right)+[A\gt B]$, where the Iverson bracket $[A\gt B]$ is $1$ if $A>B$ and $0$ otherwise.
But is this unique ? e.g. $C=2^A3^B$ But is there any possibility that $C=2^M3^N$ is also true where $M \not= A$ and $N \not= B$ and can the same be done with any operator other than ^ ? – Neel Basu Oct 26 '11 at 18:44
What you call "unique" is what I more precisely referred to as "injective". Different $A$ and $B$ yield different $C$ by the fundamental theorem of arithmetic. And yes, there are gazillions of operations with which you can do this. Another one would be interleaving the digits of the numbers, for example. – joriki Oct 26 '11 at 18:49