I would like to create a parameterizable map between $\mathbb{Z}$ and $\mathbb{Z}^2$. This map I'll call $M$ and the parameter I'll call $k$. $k \in \mathbb{Z}$ (but if there is a better space for $k$, I'm open to suggestions)
- $M(z, k) \rightarrow (x, y)$
- $M^{-1}(x, y, k) \rightarrow z$
The requirements for $M$:
- $M$ and $M^{-1}$ are defined for all values in their domains
- For any $(x,y)$ there exists at least one set of values for $z$ and $k$ such that $M(z, k) = (x, y)$
My project
(for those who care about why I want to do this)
I'm a computer programmer, and I'm working on a side project (for fun). My idea is that I want to build a model of an "entity" inside of an "environment".
Entity
- Input: $z \in \mathbb{Z}$, $c \in \mathbb{R}, [0,1]$
- Output: $z' = z + \Delta z$
$\Delta z$ is calculated based on an internal algorithm that isn't important to the question.
Environment
- Internal State: $x, y \in \mathbb{Z}$
- Input (Output From Entity): $z'$
- Output (Input To Entity): $M^{-1}(M(z',k),k) = z$ and $c = e^{-|M(z',k)-p*|}$
** $p*$ is the "most content" state of the environment ($p* = (x*,y*)).
** |...| denotes a distance measurement
Note that $c$ can be any mapping between $[0, \infty] \rightarrow [1, 0]$ (sorry if that notation isn't conventional... 0 maps to 1, and $\infty$ maps to 0... and monotonically decreasing).
The goal of my project is to build an entity to search it's own internal state-space to maximize the contentment value ($c$) it receives from the environment... but it receives a $\mathbb{Z}$ input and it's trying to find the output which maps to a specific value in environment's internal $\mathbb{Z}^2$ space... how it does this will depend on $M$, but I'm confident that I can solve that part if I can find an appropriate (hopefully non-trivial) $M$.
The function $M^{-1}(x,y,k)$ maps a point $(x,y)$ to an integer $z$ which is input to the entity. In a more "real" model, this would be like the entity's "perspective" of the environment. $k$ in my mind acts like a key, and the entity needs to find the key in order to "solve" the environment to achieve maximum contentment.
My motivation and why I think this is interesting is that any environment that an entity "lives in" has more state than the possible perceptions that an entity has of that environment. This is a naive attempt to model that observation. In the future, I'd look to combine multiple entities which are able to "solve" this $\mathbb{Z} \rightarrow \mathbb{Z}^2$ environment setup to "solve" generally an environment setup of $\mathbb{Z} \rightarrow \mathbb{Z}^m$
Attempts to solve the problem
My idea was that I needed some set of hashing functions $H_1$ and $H_2$ which act as an operator between two values in $\mathbb{Z}$. The two functions I'd need are $H_1(z,k) = x$ and $H_2(z,k) = y$. Then, I'd need to create inverse functions so that $M(H_1^{-1}(x,k), H_2^{-1}(y,k), k) = z$.
In my existing simulation, I only require one hash from $\mathbb{Z} \rightarrow \mathbb{Z}$ and there is no $k$. Introducing $k$ was tricky to me and I didn't see an obvious way to do it.