# number of injective and surjective functions? [verification]

Hello there's a question where you need to find the total possible injective and surjective possibilities. Could someone verify my answer? I'm almost certain of answer a, but want to know if b is also correct?

If you know if its true can you reply, it would be very helpful. If it's wrong could you explain why?

### question

assume |X|=2 and |Y|=2016

a) How many injective functions are there from X to Y? My answer = $$\frac{2016!}{2014!}$$

b) How many surjective functions are there from Y to X? My answer = $$2^{2016}-2$$

• Whether or not these answers are right, you don't seem to have learned much mathematics. Solving a problem is more than "finding a formula" and asking whether it's right. If you edit the question to tell us why you think these formulas count what you are interested in, perhaps we can help. Note: that quotient of factorials simplifies a lot. Jan 9 at 16:39
• This tutorial explains how to typeset mathematics on this site. Jan 9 at 16:44

Your answer for surjections is incorrect. In total we have $$2^{2016}$$ functions. However the only way a function is non-surjective in this case is if both of the elements in $$X$$ are mapped to the same element in $$Y$$, and there are $$2016$$ elements in $$Y$$.

So there are actually $$2^{2016}-2016$$ injections.

• A wow indeed, thank you so much :) Jan 9 at 16:53
• You are confused somehow, the correct answer is $2^{2016}-2$. You need to subtract the two constant maps. Jan 9 at 17:26
• You talk about the elements of X being mapped to elements of Y, but it should be the other way around. Jan 9 at 17:28