Is there any mathematical operation that can be reversed to two unique numbers?

154 Views Asked by At

Is there any mathematical operation “op”, such that when applied to two integers a, b: a op b = n. We can use that n and reverse the operation, to get n = a op b?

For example, the sum is not reversible to two integers, since 5 + 7 = 12, but we don’t know if 12 = 2 + 10 or 3 + 9 etc.

4

There are 4 best solutions below

2
On

If $n$ doesn’t have to be an integer, I can define an operator.

For all integers $a$ and $b$, “$\bullet$” defines as follows:

$$a \bullet b = a+b+ai,$$

where $i$ is the square root of $-1$.

Here using $i$, we aim to save one of the elements to turn back. If we define reverse operator as below,

$$\circ(z) = (\operatorname{Im}(z), \operatorname{Re}(z) - \operatorname{Im}(z)),$$

we obtain $(a,b)$ again.

If $n$ has to be an integer, maybe we can define an operator based on “fundamental theorem of arithmetic”.

According to this theorem, all positive integers can be represented as a product of prime powers in a unique way. One can define an operator using this uniqueness.

1
On

What about prime number factorisation?

$$f(a,b) = 2^a \cdot 3^b = n$$

Obviously, $n$ can only be a number, which is only divisible by prime factors $2$ and $3$ (like $1$, $2$, $3$, $4$, $6$, $8$, $9$, $12$, $16$, $18$, $24$, ...), but for each of those number, you can easily find $a$ and $b$ back.

0
On

For an $m \times n$ matrix, you can always map the pair of indexes $(i,j) \in \{(1,1), \ldots, (1,n), \ldots, (m,1), \ldots, (m,n)\}$ to a single value in $\{1, \ldots, mn\}$: $$(i,j) \to n(i-1)+j.$$ It is a bijection, hence it is reversible: $$r(i,j) = n(i-1)+j \leftrightarrows \begin{cases} i=\lceil r/n\rceil, \\ j=(r-1)\bmod n+1; \end{cases}$$ provided that you know both $m$ and $n$ at all times.

0
On

Yes, take any bijection f from ℤ × ℤ into ℤ (there is at least one as the domain and co-domain have the same cardinality; one could also choose f to be surjective). Then, its inverse function "takes you back."