Maths WorkshopMaths problems with full solutions
Exercise 226Combinatorics › Counting principlesHigh schoolAdded 3 Nov 2026

Counting functions

#functions#product rule#counting

Statement

How many functions from an mm-element set to an nn-element set are there?

Hint

Each of the mm elements has nn independent choices.

Show solutionHide solution

Solution

Product rule. nn choices for each of the mm elements: nmn^m total.

Conclusion. There are nmn^m functions.

Example. m=3m=3, n=2n=2: 23=82^3=8 functions.