1

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?

  • why is it important that it has 2^n subsets? By into and onto do you mean injective and surjective? In both cases you would have a bijection since the set is finite, i.e. the answer would be n! in both cases. – math635 Mar 16 '16 at 21:40
  • @math635 How do you know? Could you explain how you know this? –  Mar 16 '16 at 21:41
  • I would guess "into" to mean any map. "Onto" is surjective. The answer is not the same in both cases (there are fewer surjective maps than unrestricted maps; e.g. $f(x)=1$ is an "into" map, but not an "onto" map). – parsiad Mar 16 '16 at 21:41
  • 2
    if into is just any map than you can map any element in the domain to any of the n elements in you codomain. So the answer will be n^n. – math635 Mar 16 '16 at 21:45

3 Answers3

2

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.

parsiad
  • 25,154
0

Consider the function $f: A \rightarrow A$.

I think the answer would be $$\sum^n_{i=1} \left[\binom{n}{i} nPi \right]$$ Where $nPi$ is the permutations of length $i$ from an $n$ element set.

My reasoning is that there are $\binom{n}{i}$ subsets of length $i$ coming from the domain $A$, and there are $nPi$ ways to arrange $i$ elements coming from the codomain $A$. Only the first $i$ elements of the codomain are selected, thus giving any permutations needed. An injective function does not necessarily need every element in its domain or codomain to be used.

An example is when $n=2$, you have the following 6 injections:

1 to 1

1 to 2

2 to 1

2 to 2

1,2 to 1,2 (respectively)

1,2 to 2,1 (respectively)

We do not permute the domain, and only the codomain to avoid double counting.

-1

There are $n^n$ maps from an $n$ element set to itself.

A surjection from a finite set to itself is also an injection, hence a bijection. (Proof: If $f\colon X=\{1, \dotsc n\}\to X$ is a surjection, then $\{f^{-1}(x) \mid x\in X\}$ is a partitions $X$ into $n$ nonempty disjoint sets, so every $f^{-1}(x)$ must have exactly one element.) Thus, the number of surjections from $X$ to itself equals $n!$, as that is the number of bijections from $X$ to itself.

Note that in the general case, computing the number of surjections from a set of $n$ elements to a set of $k$ elements is more involved, and is answered here and here.

BrianO
  • 16,579
  • 1
    i don't think counting the surjections is involved since any surjective map is also injective. So we only have to count bijective maps and this is easy. There are n ways where we can map the first element to, n-1 where we can map the second and so on. So there are n! surjective maps. – math635 Mar 16 '16 at 22:24
  • Well, ... touché: a surjection of a finite set set of $n$ elements to itself is an injection is a bijection, and there are $n!$ of them. – BrianO Mar 17 '16 at 04:09