Number of Functions

Rarely Tested

Number of Functions

## Formula

If:

$$n(A)=m,\qquad n(B)=n$$

then the number of functions from $A$ to $B$ is:

$$n^m$$

## Conditions / Special Cases

Each of the $m$ elements of $A$ has $n$ possible images in $B$.

If:

$$n(B)=1$$

then:

$$n^m=1$$

## Usage

- Used in counting problems involving mappings between finite sets.

Question 1

Find the total number of surjective (onto) functions $$f: A \to B$$ where the domain is given by the set $$A = \{1, 2, 3, 4, 5, 6\}$$ and the codomain is given by the set $$B = \{1, 2, 3, 4\}$$, subject to the additional constraint that the function value satisfies $$f(1) \neq f(2)$$.

Go back to topics

Join CAT 2026 course by 5-Time CAT 100%iler

Start your IIM journey with the right preparation and crack CAT 2026.