Finding the inverse of a function in two variables

130 Views Asked by At

I have a function $f$ on the integers in $[-180,180)\times [-90,90)$ defined by $$f(y,x) = y + 360 x$$ I would like to find the inverse function. How can I do this?

1

There are 1 best solutions below

0
On

Let $z$ be given. To solve $z=y+360x$, suppose for the moment that $x$ is known; then $y=z-360x$ is a "solution". Why might it not be a real solution? Well, we need $y\in [-180,180)$, so given any solution adding one to $x$ will make $y$ greater or smaller by $360$, pushing it out of the solution space (which only contains $360$ consecutive numbers), so there is at most one solution for $x$ and hence $y$.

To find this solution, we can use the floor function: If $x=\lfloor z/360+1/2\rfloor$, then

\begin{align} z/360-1/2<x\le z/360+1/2&\iff z-180<360x\le z+180\\ &\iff -180<360x-z\le 180,\\ &\iff -180\le z-360x<180,\\ &\iff -180\le y<180,\end{align}

so $y$ is in range. (Where did I get that expression for $x$? I just ran this calculation backwards.) This gives a value of $x$ in range iff

\begin{align}-90\le\lfloor z/360+1/2\rfloor<90&\iff -90\le z/360+1/2<90\\ &\iff -90\cdot 360-180\le z<90\cdot 360-180\\ &\iff -32580\le z<32220,\end{align}

which gives the domain $z\in[-32580,32220)$ for our inverse function. Thus the inverse to $f$ is:

$$z\in[-32580,32220)\mapsto (\lfloor z/360+1/2\rfloor,z-360\lfloor z/360+1/2\rfloor).$$