-1
$\begingroup$

I was thinking $f(n)=|n|$, but realized that would be a surjection. I'm not sure of how to solve this. Thank you.

$\endgroup$
  • 1
    $\begingroup$ Hi Amy! What else have you tried? Could you expand on your problem? Are Z and N any set of numbers, or are integers and naturals? The more informatino the better help you'll get! $\endgroup$ – Lafinur Apr 24 at 3:07
  • 6
    $\begingroup$ It's not the fact that this is a surjection is the problem, it's the fact that it's not injective. $\endgroup$ – Lord Shark the Unknown Apr 24 at 3:09
  • $\begingroup$ @AngelusSilesius Hi, I apologize, N=natural numbers and Z=integers. I apologize. $\endgroup$ – Amy Kulp Apr 24 at 3:09
  • 2
    $\begingroup$ How about a map taking negative numbers to odd numbers and non-negative numbers to even numbers? $\endgroup$ – J. W. Tanner Apr 24 at 3:12
  • 1
    $\begingroup$ Great. Just for the future, there's special mathjax notation to write $\mathbb{N}$ and $\mathbb{Z}$. Don't worry, there's no need to apologize! $\endgroup$ – Lafinur Apr 24 at 3:12
2
$\begingroup$

Let $f(n)=2(n+1)$ if $n\ge0$ and $-2n-1$ if $n<0$.

This maps {$0,1,2,...$} to {$2,4,6,...$} and {$-1,-2,-3,...$} to {$1, 3, 5, ...$};

i.e., {$..., -3, -2, -1, 0, 1, 2, ...$} to {$1,2,3,4,5,6,...$}.

The inverse map is $f^{-1}(m)=\dfrac m 2 -1 $ if $m$ is even and $-\dfrac{m+1}2$ if $m$ is odd.

$\endgroup$
1
$\begingroup$

How about $f(x)=\begin{cases} 2x\,,x\gt0\\-2x+1\,,x\le0\end{cases}$

(As @J W Tanner commented.)

$\endgroup$
1
$\begingroup$

Define $f$ as follows:

$$ f(n) = \left\{\begin{array}{lr} 2^n , & \text{when } n \ge 0 \\ 3^{|n|} , & \text{when } n \lt 0 \end{array}\right\} $$

$\endgroup$
0
$\begingroup$

If you one a closed formula for the function given by @Chris Custer, this works $$f(x)=2|x|-\frac{x-\epsilon}{2|x-\epsilon|}+\frac{1}{2}$$ Here you can choose any $0<\epsilon<1$.

$\endgroup$
0
$\begingroup$

Here's another solution: let $f(n)=2^n $ if $n>0, 2^{-n}-1$ otherwise.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.