Set Theory Question... Are my injective and surjective numbers correct?
Consider sets $A$ and $B$, with $|A| = 7$ and $|B| = 3$.
Let $\{a1, a2, a3, a4, a5, a6, a7\}$ be the $7$ elements that are in $|A|$.
Let $\{b1, b2, b3\}$ be the $3$ elements in $|B|$.
Let $\boldsymbol{U}$ be the set of all functions from $A \to B$.
Let $\boldsymbol{F}_1$ be the set of functions which do not send any element of $A$ into $b_1$.
Let $\boldsymbol{F}_2, \boldsymbol{F}_3$ be similar set of functions which do not send any element of $A$ into $b_2, b_3$, etc.
(a) How many relations are there from $A$ to $B$?
$\boldsymbol{R} \to \boldsymbol{R}$: $f: A \to B = A \times B = 7 \times 3 = 21$ elements $= 2^{21}$
(b) How many functions are there from $A$ to $B$?
$f: A \to B = |B|^{|A|} = 3 = 2187$
(c) How many injective functions are there from $A$ to $B$?
Not possible since number of elements in $|B| < |A|$.
(d) How many surjective functions are there from $A$ to $B$?
From the Inclusion-Exclusion Principle: $n(A1 \cup A2 \cup \ldots \cup A_n) = s_1 – s_2 + s_3… +(-1)^{r-1} s_r$
Alternatively: $n(A_1^C \cap A_2^C \cap \ldots \cap A_n)^C = |\mathbb{U}| - s_1 + s_2 - s_3 - \ldots +(-1)^{r-1} s_r$
$3^7 = 2187$
$2^7 = 128$
$1^7 = 1$
$2187 – 128 + 1 = 2160$
Now repeat the above four questions, but with $|A| = 3$ and $|B| = 7$.
(a) How many relations are there from $A$ to $B$?
$\boldsymbol{R} \to \boldsymbol{R}$: $f: A \to B = A \times B = 7 \times 3 = 21$ elements $= 2^{21}$
(b) How many functions are there from $A$ to $B$?
$f: A \to B = |B|^{|A|} = 7^3 = 343$
(c) How many injective functions are there from $A$ to $B$?
$7 \cdot 6 \cdot 5 = 210$
(d) How many surjective functions are there from $A$ to $B$?
Not possible, since $|A| = m$ and $|B| = n$ where $m \geq n$.
$A$
instead ofA
. To get the union use$\cup$
, to get indices use underscore, e.g.$A_1$ - so
$A_1\cup A_2$` delivers $A_1\cup A_2$. (You need a space after\cup
here, since else\cupA
would be the token, and there is no such macro.) Is some index is "longer", e.g. $A_{11}$ useA_{11}
- to get { in math modus use\{
$\endgroup$$3^7$
. This tutorial explains how to typeset mathematics on this site. $\endgroup$