I have an equation like this:
$y = x + (-1)^x$
How do I solve for $x$?
If there were not the $x + ...$ I could just take the logarithm of both sides to separate the $x$ from the $-1$.
I have an equation like this:
$y = x + (-1)^x$
How do I solve for $x$?
If there were not the $x + ...$ I could just take the logarithm of both sides to separate the $x$ from the $-1$.
On
Another alternative way of expressing the answer might illuminate what is going on: $f(2n)=2n+1; f(2n+1)=2n$. This is a transposition which switches adjacent odd and even integers.
By hand, if $f(x)=y$ then $x=y+(-1)^y$ - so the function is its own inverse, as you would expect from a transposition.
Since $x \in \mathbb{Z}$, so consider two cases: $x$ is odd and $x$ is even. Then $$ x=\begin{cases}y+1 & \text{ if } x \text{ is odd}\\y-1 & \text{ if } x \text{ is even} \end{cases}. $$ OR we can also write this as $$ x=\begin{cases}y+1 & \text{ if } y \text{ is even}\\y-1 & \text{ if } y \text{ is odd} \end{cases}. $$