Total Number of Functions from A to B
Question:
Let \(A\) and \(B\) be any two sets such that
$$
n(A)=p
\quad \text{and} \quad
n(B)=q
$$
Then the total number of functions from \(A\) to \(B\) is equal to ?
Solution
A function from \(A\) to \(B\) assigns exactly one element of \(B\) to each element of \(A\).
Since $$ n(A)=p $$ there are \(p\) elements in set \(A\).
For each element of \(A\), there are $$ q $$ choices from set \(B\).
Therefore, total number of functions is: $$ q\times q\times q \cdots \text{(p times)} $$
$$ =q^p $$
Hence, $$ \boxed{q^p} $$