# let $A=\{1,2,3,4,5\}$ and $B=\{0,1,2,3,4,5\}$. Number of one-one function from $A$ to $B$

Let $$A=\{1,2,3,4,5\}$$ and $$B=\{0,1,2,3,4,5\}$$. Number of one-one function from $$A$$ to $$B$$ such that $$f(1) \neq 0$$ and $$f(i)\neq i$$ for $$i={1,2,3,4,5}$$ is _______ .

So I know one one function means for each $$x$$ there will be only one $$y$$.

But here if I take for $$1$$ from $$A$$ then total number of functions $$=480$$ as $${{4_C}_1}×{{5_P}_4}$$

But for every for every other $$i$$ from $$A$$ it will be $${{5_C}_1}×{{5_P}_4}$$ so total cases will be $$480+2400=2880$$. But I don't know how to further proceed.

• One to one function means for each point in the image of the function ( for each y ) there is exactly one x that maps to it – Ameryr Dec 6 at 17:23
• @Ameryr That's what I have written there – jayant98 Dec 6 at 17:42
• “For each x there exists one y” that condition holds for any function f(x) , one to one for each y there exists one x. $f(x)=x^2$ is not one to one if we have $f(1)=2, f(1)=3$ that’s not a function – Ameryr Dec 6 at 23:53
• To obtain $\{1, 2, 3, 4, 5\}$, type $\{1, 2, 3, 4, 5\}$. This is an Inclusion-Exclusion Principle problem. – N. F. Taussig Dec 7 at 10:33

Definition. A number $$c$$ is said to be a fixed point of a function if $$f(c) = c$$.

Let $$A = \{1, 2, 3, 4, 5\}$$; let $$B = \{0, 1, 2, 3, 4, 5\}$$.

If there were no restrictions, we would have $$6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 = 6!$$ ways to map the elements in the domain to distinct elements in the codomain. Hence, there are $$6!$$ injective functions $$f: A \to B$$. From these, we must exclude those that violate the restrictions that $$f(0) \neq 1$$ and that $$f(i) \neq i, 1 \leq i \leq 5$$.

We will use the Inclusion-Exclusion Principle.

A number in the domain is mapped to a prohibited value of the codomain: We consider two cases, depending on whether or not that number is $$1$$.

The number $$1$$ is mapped to $$0$$ or $$1$$: There are two ways to choose the image of $$1$$. That leaves five elements in the codomain to which the remaining four numbers in the domain can be mapped. The remaining numbers in the domain can be mapped to distinct elements of that subset of the codomain in $$5 \cdot 4 \cdot 3 \cdot 2 = 5!$$ ways. Hence, there are $$\binom{2}{1}5!$$ such injective functions.

A number other than $$1$$ is a fixed point: There are four ways to choose which of the four numbers larger than $$1$$ is a fixed point. That leaves five numbers in the codomain to which the remaining four elements in the domain can be mapped. The remaining numbers in the domain can be mapped to distinct elements of that subset of the codomain in $$5!$$ ways. Hence, there are $$\binom{4}{1}5!$$ such injective functions.

Hence, there are $$\binom{2}{1}5! + \binom{4}{1}5!$$ injective functions in which a number in the codomain is mapped to a prohibited element of the codomain.

Two numbers in the domain are mapped to probibited values of the codomain: We again have to consider two cases, depending on whether or not $$1$$ is one of the numbers that is mapped to a prohibited value.

The number $$1$$ is mapped to $$0$$ or $$1$$ and another number is a fixed point: There are $$2$$ ways to choose the image of $$1$$ and four ways to pick which of the other four numbers in the codomain is a fixed point. That leaves four numbers in the codomain to which the remaining three elements in the codomain can be mapped. The remaining numbers in the domain can be mapped to distinct elements of that subset of the codomain in $$4 \cdot 3 \cdot 2 = 4!$$ ways. Hence, there are $$\binom{2}{1}\binom{4}{1}4!$$ such injective functions.

Two numbers larger than $$1$$ are fixed points: There are $$\binom{4}{2}$$ ways to choose the two fixed points. That leaves four numbers in the codomain to which the remaining three elements in the domain can be mapped. The remaining numbers in the domain can be mapped to distinct elements that subset of the codomain in $$4!$$ ways. Hence, there are $$\binom{4}{2}4!$$ such injective functions.

Three numbers in the domain are mapped to prohibited values of the codomain: As above, we have two cases.

The number $$1$$ is mapped to $$0$$ or $$1$$ and two other numbers are fixed points: We choose the image of $$1$$ and which two of the other four numbers are fixed points. That leaves three elements in the codomain to which the remaining two elements in the domain can be mapped. We choose how to map those two elements to distinct elements of that subset of the codomain. There are

$$\binom{2}{1}\binom{4}{2}3!$$

such injective functions.

Three numbers larger than $$1$$ are fixed points: We choose which three of those four numbers are fixed points. That leaves three elements in the codomain to which the remaining two elements in the domain can be mapped. We choose how to map those two elements to distinct elements of that subset of the codomain. There are

$$\binom{4}{3}3!$$

such injective functions.

Hence, there are

$$\binom{2}{1}\binom{4}{2}3! + \binom{4}{3}3!$$

injective functions in which three numbers in the domain are mapped to prohibited elements in the codomain.

Four elements in the domain are mapped to prohibited values in the codomain: Again, there are two cases.

The number $$1$$ is mapped to $$0$$ or $$1$$ and three of the other four numbers are fixed points: Choose the image of $$1$$ and which three of the other four numbers are fixed points. Assign the remaining number in the domain to one of the two remaining numbers in the codomain. There are

$$\binom{2}{1}\binom{4}{3}2!$$

such injective functions.

All four numbers larger than $$1$$ are fixed points: That leaves two ways to assign $$1$$ to one of the remaining elements in the codomain (yes, we have already counted this case, but the Inclusion-Exclusion Principle compensates for that). There are

$$\binom{4}{4}2!$$

such injective functions.

Hence, there are

$$\binom{2}{1}\binom{4}{3}2! + \binom{4}{4}2!$$

injective functions in which four elements of the domain are mapped to probibited elements of the codomain.

All five elements of the domain are mapped to prohibited values in the codomain: There are two possibilities. Either $$1$$ is mapped to $$0$$ and the other four numbers are fixed points or all five numbers are fixed points. There are

$$\binom{2}{1}\binom{4}{4}$$

such functions.

By the Inclusion-Exclusion Principle, the number of injective functions $$f: A \to B$$ such that $$f(1) \neq 0$$ and $$f(i) \neq i, 1 \leq i \leq 5$$, is

$$6! - \binom{2}{1}5! - \binom{4}{1}5! + \binom{2}{1}\binom{4}{1}4! + \binom{4}{2}4! - \binom{2}{1}\binom{4}{2}3! - \binom{4}{3}3! + \binom{2}{1}\binom{4}{3}2! + \binom{4}{4}2! - \binom{2}{1}\binom{4}{4}$$

I have a suitable result for your problem. Don't take it as an answer:

Let, $$A, B$$ be two nonempty sets with $$|A|=m<|B|=n$$ and $$f: A\to B$$ is a function, then the total number of onto function is zero and the total number of one-one function is: $$^nC_mm!$$ for all $$n,m\in\mathbb{N}$$