# How many injective and surjective functions are there from $A$ to $B$? [closed]

This is an old practice exam question in my calculus class and I would love to understand it before my exam, so any help would be great!

Consider the sets $A = \{a,b\}$ and $B=\{a,c,d,e,f\}$.

a) How many functions are there from $A$ to $B$?

b) How many injective functions are there from $A$ to $B$?

c) How many surjective functions are there from $A$ to $B$?

I know what injective and surjective means, but I have only applied it in linear algebra and I'm not sure how to do these.

## closed as off-topic by Namaste, B. Mehta, N. F. Taussig, GNUSupporter 8964民主女神 地下教會, qwrApr 14 '18 at 19:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Namaste, B. Mehta, N. F. Taussig, GNUSupporter 8964民主女神 地下教會, qwr
If this question can be reworded to fit the rules in the help center, please edit the question.

• How many ways can $a\in A$ be mapped to one and only one of the five elements in $B$? How many ways can $b\in A$ then be mapped to one and only one of the elements in $B$? – Namaste Apr 14 '18 at 18:53
• Now, we have five ways to map $a \in A$ to one of the elements in $B$. For a mapping to be injective, $b \in A$ can be mapped to any of four elements not mapped to the element in $B$ that $a$ was mapped to. No function from $A\to B$ can be surjective. Why? Recall the definition of a function. – Namaste Apr 14 '18 at 19:04

Consider the sets A={a,b} and B={a,c,d,e,f}.

a) How many functions are there from A to B?

The answer is $5^2 =25$ because you have $5$ choices for each $a$ or $b.$

b) How many injective functions are there from A to B?

The answer is $5\times 4 =20$.you have $5$ choices for $a$ and only $4$ choices for $b$

c) How many surjective functions are there from A to B?

The answer is $0$. You can not cover $5$ elements with just $a$ and $b$

Hints: a) Think about defining a function from $A \to B$. How many functions can you think of? How many choices do you need to make to define such a function?

b) Thinking about the functions above - how many are not injective? How can such a function fail to be injective? So, how many injections are there?

c) I'll leave to you - but think along similar lines as to b).