0
$\begingroup$

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)$

  • 0
    `A` and `B` are positive integers2011-10-26

1 Answers 1

3

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$.

[Edit in response to the comment:]

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.

  • 0
    I don't know how there could be another example of the same operation, but I added another example of an operation with the same property.2011-10-27