# If A = {1, 2, 3} and B = {a, b}, write the total number of functions from A to B.

Question:

If A = {1, 2, 3} and B = {ab}, write the total number of functions from A to B.

Solution:

Formula:

If set $A$ has $m$ elements and set $B$ has $n$ elements, then the number of functions from $A$ to $B$ is $n^{m}$.

Given:

$A=\{1,2,3\}$ and $B=\{a, b\}$

$\Rightarrow n(A)=3$ and $n(B)=2$

$\therefore$ Number of functions from $A$ to $B=2^{3}=8$