How many functions are there between these two sets? Which are one-to-one and which are onto? How many functions are there from {1,2} to {a,b,c}? Which are one-to one? Which are onto?
The answer I came up with is:
{(1,a)(2,a)}
{(1,b)(2,a)}
{(1,c)(2,a)}
{(1,a)(2,b)}
{(1,a)(2,c)}
{(1,b)(2,b)}
{(1,c)(2,b)}
{(1,b)(2,c)}
{(1,c)(2,c)}
All are 1-1 except for {(1,a)(2,a)} {(1,b)(2,b)} and {(1,c)(2,c)}
None of them are onto
The answer that my friend insists is right is:
F1: {(1,a), (1,b), (1,c)} – 1-1
F2: {(2,a), (2,b), (2,c)} – 1-1
F3: {(1,a),(1,b),(1,c),(2,a),(2,b),(2,c)} – onto
Who is right? Or are we both wrong?
Thanks!
 A: You are right.  Your friend's functions aren't functions at all as they map a single point of the domain into multiple different points.  A function must consistently map each point into a unique point.
There are 2 points in the domain and there are 3 points they can be mapped to.  That 1 can map to 3 values and 2 can map to 3 values so there are 3*3 = 9 total functions.  If there are n points in the domain and m possible range points there will be $m^n$ possible functions.
To be 1-1 the functions must map 1 and 2 to different points.  If the map 1 and 2 to the same point they are not 1-1.  Thus the functions that aren't 1-1 are the functions that map both points to either a, b, or c.  Three of them aren't 1-1 so 9-3 = 6 of them are. 
As there are more points in the range than in the domain it's impossible to map 2 values onto 3 results.  There are no onto functions.
Okay, but those were simple.  In general there are 1-1 functions (assuming finite domains and ranges) only if there are equal or more points in the range than in the domain.  Otherwise you have more starting points then ending points so there'd have to be "doubling up" involved.  If there are n points in the domain and m points in the range (m >= n), then there are m choices for f(1), m-1 choices for f(2) and so on.  This is a total of m*(m-1)*....(m-n +1) or $\frac{m!}{m-n!}$ 1-1 functions. [Note: In your example $\frac{3!}{(3-2)!} = 3*2 = 6$.  Same answer.] 
By the same logic to be onto each point in the range has to come from a point in the domain.  So onto is possible only if there are equal or fewer points in the range than the domain.  If there are n points in the domain and m points in the range (n >= m).  Then there are n points a could be mapped from, n-1 points b could be mapped from, etc. for n*(n-1)*...(n-m+1)  or $\frac{n!}{n-m!}$total onto functions.
For there to be functions both 1-1 and onto there must be equal number of points in both domain and range (say n) and there will be $n!$ functions both 1-1 and onto.  (Actually, 1-1 and onto would be synonomous in that case.)   
