Let A and B be non-empty sets with |A| = n and |B| = m, where n and m are the number of distinct elements in A and B, respectively.
A function f from A to B, denoted as f: A -> B, assigns exactly one element from B to each element from A.
The total number of functions from A to B is m^n. This is because for each of the n elements in A, there are m independent choices for its image in B.
A function f: A -> B is called onto (or surjective) if its image f(A) = {f(a) | a in A} is equal to the set B. This means that every element in B is mapped to by at least one element in A.
For a function to be onto, the size of its image must be equal to the size of the codomain B, i.e., |f(A)| = m. Since the image f(A) is formed by the images of the n elements of A, the size of the image can be at most n, i.e. |f(A)| <= n.
Therefore, for an onto function to exist, it must be that m = |f(A)| <= n.
If n < m, it is impossible for any function from A to B to be onto. In this case, the number of onto functions is 0.
We are asked to find the number of functions from A to B that are not onto.
Let F be the set of all functions from A to B, so |F| = m^n.
Let S be the set of all onto functions from A to B.
The number of functions that are not onto is |F| - |S| = m^n - |S|.
Case 1: n < m.
As established earlier, if n < m, no function from A to B can be onto. So, |S| = 0.
The number of non-onto functions is m^n - 0 = m^n. In this case, all functions are not onto.
Case 2: n >= m.
In this case, onto functions exist. We need to calculate the number of onto functions, |S|.
The number of onto functions from a set of size n to a set of size m can be calculated using the Principle of Inclusion-Exclusion.
Let B = {b1, b2, ..., bm}. For a function f: A -> B, let Pi be the property that the element bi is not in the image of f. A function is onto if it satisfies none of the properties Pi.
The number of onto functions is given by the formula:
|S| = Sum_{k=0}^{m} (-1)^k * C(m, k) * (m-k)^n
where C(m, k) = m! / (k! * (m-k)!) is the binomial coefficient "m choose k".
Let's expand this sum:
|S| = C(m, 0)(m-0)^n - C(m, 1)(m-1)^n + C(m, 2)(m-2)^n - ... + (-1)^m C(m, m)(m-m)^n
|S| = 1 * m^n - C(m, 1)(m-1)^n + C(m, 2)(m-2)^n - ... + (-1)^m * 1 * 0^n
The number of non-onto functions is the total number of functions minus the number of onto functions:
Number of non-onto functions = m^n - |S|
= m^n - [Sum_{k=0}^{m} (-1)^k C(m, k) (m-k)^n]
= m^n - [C(m, 0)m^n - C(m, 1)(m-1)^n + C(m, 2)(m-2)^n - ... + (-1)^m C(m, m)0^n]
= m^n - [1 * m^n - C(m, 1)(m-1)^n + C(m, 2)(m-2)^n - ... ]
= m^n - m^n + C(m, 1)(m-1)^n - C(m, 2)(m-2)^n + ... - (-1)^m C(m, m)0^n
= C(m, 1)(m-1)^n - C(m, 2)(m-2)^n + C(m, 3)(m-3)^n - ... + (-1)^{m+1} C(m, m)(m-m)^n
This can be written in summation notation as:
Number of non-onto functions = Sum_{k=1}^{m} (-1)^{k+1} C(m, k) (m-k)^n
Since (-1)^{k+1} = (-1)^{k-1}, this is equivalent to:
Number of non-onto functions = Sum_{k=1}^{m} (-1)^{k-1} C(m, k) (m-k)^n
This formula was derived for the case n >= m. Let's check if it holds for n < m.
When n < m, we know the number of non-onto functions is m^n.
We also know that the number of onto functions |S| = Sum_{k=0}^{m} (-1)^k C(m, k) (m-k)^n is 0 when n < m (this is a known combinatorial identity related to finite differences of polynomials).
So, the number of non-onto functions is m^n - |S| = m^n - 0 = m^n.
The formula Sum_{k=1}^{m} (-1)^{k-1} C(m, k) (m-k)^n is precisely m^n - |S| expressed without the m^n term explicitly at the beginning. Let's verify:
m^n - |S| = m^n - Sum_{k=0}^{m} (-1)^k C(m, k) (m-k)^n
= m^n - [C(m, 0)m^n + Sum_{k=1}^{m} (-1)^k C(m, k) (m-k)^n]
= m^n - m^n - Sum_{k=1}^{m} (-1)^k C(m, k) (m-k)^n
= - Sum_{k=1}^{m} (-1)^k C(m, k) (m-k)^n
= Sum_{k=1}^{m} (-1)^{k+1} C(m, k) (m-k)^n
= Sum_{k=1}^{m} (-1)^{k-1} C(m, k) (m-k)^n.
Since this expression equals m^n - |S|, and |S| = 0 for n < m, the expression equals m^n for n < m.
Thus, the formula Sum_{k=1}^{m} (-1)^{k-1} C(m, k) (m-k)^n is valid for both cases n >= m and n < m.
Final Answer: The final answer is k=1∑m(−1)