How many everywhere defined functions are not $ 1$ to $1$ I am stuck with the following question,
How many everywhere defined functions from S to T are not one to one
S={a,b,c,d,e}
T={1,2,3,4,5,6}

Now the teacher showed that there could be $6^5$ ways to make and everywhere defined function and $6!$ ways of it to be $1$ to $1$ but when I drew them on paper I could drew no more than 30, here are those,
$(a,1),(a,2).........(a,6)$$(b,1),(b,2).........(b,6)$$(c,1),(c,2).........(c,6)$$(d,1)(d,2).........(d,6)$$(e,1)(e,2).........(e,6)$ 
Can anyone please help me out with how there are $6^5$ functions? Thanks

What you have in each line is not a function. For example, look at $(a,1)$, which you've counted as a "function." Call it $f(\circ)$. What then are $f(b),f(c),f(d),f(e)$? You can't say. Because simply fixing the correspondance $a\leftrightarrow 1$ does not give you a whole function, it only gives a small piece of one. Here is how to count the total number of one-to-one (bijective) functions $\{a,b,c,d,e\}\to\{1,2,3,4,5,6\}$:


*

*There are six possible outputs that $a$ could go to. Choose one arbitrarily.

*There are then five possible outputs for $b$ - it can't be the same as $a$ - and that number five is independent of which output was chosen for $a$. Choose the output for $b$ then from this pool.

*Now there are four possible outputs for $c$, by the same token. Choose again.

*$\cdots\cdots\cdots$

*After you have chosen outputs for $a,b,c,d$, the last number remaining must go to $e$ as its output, so there is only one choice to make in this final stage.


Since in each stage the number of choices is independent of which choices were made in the other stages, we can multiply the numbers together to count the total number of bijections: $6!$.
It's easier simply counting the number of functions $S\to T$; there are six stages again (one for each input) and there are six possible outputs for each of $a,b,c,d,e$, so $6^5$ functions in total.
