What is the formula to find the number of onto functions from set A to set B?

An onto function, also known as a surjective function, is a function where every element in the codomain (set B) is mapped to by at least one element in the domain (set A). To find the number of onto functions from a set A with m elements to a set B with n elements, we can use the following formula:

Number of onto functions = n! * S(m, n)

In this formula, S(m, n) represents the Stirling number of the second kind, which counts the number of ways to partition a set of m objects into n non-empty subsets. Here’s a step-by-step breakdown of the components:

  • n! is the factorial of n, accounting for the different ways to assign the non-empty subsets to the n elements of set B.
  • S(m, n) gives us the number of ways to partition the set A into n non-empty subsets, ensuring that each subset has at least one element that maps to an element in set B.

So, to find the total number of onto functions, you calculate the Stirling number S(m, n), multiply that by n!, and you’ll have your answer!

More Related Questions