[Math] How many maps of this set into itself question

elementary-set-theoryreal-analysis

Suppose we have a set $(1, 2, … n)$, which has $2^n$ subsets. I am taking an introduction to analysis course, and I don't seem to understand the following two questions about this set:

  1. How many maps of this set into itself?
  2. How many maps of this set onto itself?

I understand the definitions of "into" and "onto" in this context, but I'm struggling with understanding what exactly they're asking. Any help?

Best Answer

Call the set $S$. By "into" they mean any map $f\colon S\rightarrow S$. By "onto" they mean a map $f\colon S\rightarrow S$ whose image is $S$ itself (i.e. $f(S)=S$). That is, each element in the codomain is mapped to by some element in the domain.