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

You have produced a complete and correct list of all ordered pairs $(x,y)$, where $x$ ranges over $S$ and $y$ ranges over $T$.  However, this is not the set of all functions from $S$ to $T$.
Your list, however, gives a nice way of visualizing all the functions. We can produce all the functions from $S$ to $T$ by picking any ordered pair from your first row, followed by any ordered pair from your second row, followed by any ordered pair from your third row, and so on. We have $6$ choices from the first row. For any of these choices, we have $6$ choices from the second row, for a total of $6\times 6$ choices from the first two rows. For every way of choosing from the first two rows, we have $6$ ways to choose from the third row, and so on for a total of $6^5$. 
A function from $S$ to $T$ is a set of ordered pairs, with one ordered pair taken from each row.  This view is quite close to the formal definition of function that you may have seen in your course.
For example, we might choose $(a,1)$, $(b,5)$, $(c,1)$, $(d,5)$, $(e,2)$. This gives us the function that maps $a$ and $c$ to $1$, $b$ and $d$ to $5$, and $e$ to $2$. 
We can produce the one-to-one functions in  similar way from your "matrix." We start by taking any ordered pair from your first row. But then, from the second row, we must pick an ordered pair which is not in the same column as the first ordered pair you picked. So even though there are $6$ choices from the first row, for every such choice, there are only $5$ choices from the second row. Similarly, once we have picked a pair from each of the first two rows, in the third row we must avoid the columns these pairs are in. So we end up with only $6\times 5\times 4\times 3\times 2$ one-to-one functions.
