3
$\begingroup$

Is there a function $f:{\mathbb N}\to{\mathbb N}$ that is neither injective nor surjective ?


I came up with $n\mapsto\sin n$ as not all outputs are mapped and some inputs have the same output, but then I realized $\sin n$ doesn't produce a natural number. I have to map the natural numbers to the natural numbers.

I also came up with other ones but they always seem to be total and injective or total and subjective.

$\endgroup$

closed as unclear what you're asking by user21820, Ethan Bolker, B. Mehta, Namaste, Did Dec 12 '17 at 9:46

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Do you mean a total function, maybe? $\endgroup$ – Bram28 Dec 11 '17 at 4:37
  • 1
    $\begingroup$ I think a total relation is one where every pair of elements is comparable. So to speak, for every $x,y$ either $(x,y)$ or $(y,x)$ belongs in the relation. He now wants a non-injective relation i.e. two elements with same second component but different first component, but also non-surjective i.e. there is some natural number that is not the second component of any element. That is what I think. $\endgroup$ – астон вілла олоф мэллбэрг Dec 11 '17 at 4:42
  • $\begingroup$ I was suppose to look for a relation from the natural set to the natural set with the above condition. So technically a function. $\endgroup$ – Jose Ramirez Dec 11 '17 at 4:43
  • $\begingroup$ I think @астонвіллаолофмэллбэрг may be right, and you misunderstood what the question was trying to ask (it's certainly far more interesting that way). $\endgroup$ – Noah Schweber Dec 11 '17 at 4:47
  • $\begingroup$ @астонвіллаолофмэллбэрг Well, there is no total relation that is non-surjective relation: for it to be total, it needs to be reflexive, and is therefore automatically surjective. $\endgroup$ – Bram28 Dec 11 '17 at 4:59
48
$\begingroup$

When in doubt, don't do anything complicated: $$f(n)=17.$$ (Of course, you may have additional conditions you want satisfied, but you haven't mentioned them.)

$\endgroup$
  • 24
    $\begingroup$ @JozemiteApps Yes it does. It takes in a natural number and spits out a natural number. What do you think the phrase means? $\endgroup$ – Noah Schweber Dec 11 '17 at 4:41
  • 24
    $\begingroup$ @JozemiteApps What do you think the term surjective means? $\endgroup$ – DanielV Dec 11 '17 at 4:46
  • 31
    $\begingroup$ Why not $f(n)=42$? $\endgroup$ – Niyoko Yuliawan Dec 11 '17 at 5:22
  • 7
    $\begingroup$ @NiyokoYuliawan: This question isn't that important. :) $\endgroup$ – Hurkyl Dec 11 '17 at 9:02
  • 5
    $\begingroup$ That part was easy. Now we have to find out what's special about 17. $\endgroup$ – Peter A. Schneider Dec 11 '17 at 16:30
16
$\begingroup$

$$n\to\sin n\color{red}\pi$$ (Actually, this is equivalent to $n\to 0$ and thus in the same vein as Schweber's answer. I couldn't resist tacking on to the function in the question though.)

$\endgroup$
  • 2
    $\begingroup$ Also, more aligned with OP's initial attempt at solving problem. But I actually up-voted your answer because I learned something new - latex $\color{red}coloring$! $\endgroup$ – CopyPasteIt Dec 11 '17 at 19:40
13
$\begingroup$

How about $f(n) = n^2-n$?

Total, as $f(n)$ is defined for each $n$

Not injective, as $f(0)=f(1)$

Not surjective, as there is no $n$ such that $f(n)=1$

$\endgroup$
  • 2
    $\begingroup$ This is injective if you consider the "natural numbers" not to include zero. $\endgroup$ – M.Herzkamp Dec 11 '17 at 16:17
3
$\begingroup$

There are lots of fine answers given already, but possibly you'll enjoy this one, too:

$$n\mapsto n(1+\cos n\pi)$$

$\endgroup$

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