Solution: We want the number of onto functions from 7 birds to 3 bands. Using inclusion-exclusion:

["Solution: Counting Onto Functions from 7 Birds to 3 Bands Using the Inclusion-Exclusion Principle", "When solving combinatorics problems involving labeled objects and coverage constraints, the inclusion-exclusion principle is a powerful tool. One common application is counting onto functions, where every element in the target set (here, the 3 bands) must be “hit” by at least one element from the domain (here, the 7 birds). In this article, we explore how to compute the number of onto functions from a set of 7 birds to a set of 3 bands using the inclusion-exclusion principle.", "---", "### What Is an Onto Function?", "An onto (or surjective) function from a domain ( A ) (size ( m = 7 )) to a codomain ( B ) (size ( n = 3 )) ensures every element in ( B ) is the image of at least one element in ( A ). For example, we want to count how many ways we can assign 7 birds to 3 bands such that each band gets at least one bird.", "The total number of unrestricted functions from 7 birds to 3 bands is ( 3^7 ), but many include assignments where one or more bands receive no birds. The inclusion-exclusion principle helps us subtract these invalid cases.", "---", "### Applying the Inclusion-Exclusion Principle", "Let ( S ) be the set of all functions from 7 birds to 3 bands. So:", "[\n|S| = 3^7\n]", "Define ( A_i ) as the set of functions where band ( i ) gets no birds, for ( i = 1, 2, 3 ). We want to count the number of functions where none of the ( A_i ) occur — that is, all bands are non-empty — the definition of an onto function.", "By the inclusion-exclusion principle:", "[\n\ ext{Number of onto functions} = |S| - \sum |A_i| + \sum |A_i \cap A_j| - |A_1 \cap A_2 \cap A_3|\n]", "---", "### Step-by-Step Calculation", "1. Total functions\n[\n|S| = 3^7 = 2187\n]", "2. Subtract functions missing at least one band\nEach ( A_i ) (functions missing band ( i )) maps birds only to the remaining ( n-1 = 2 ) bands. So:", "[\n|A_i| = 2^7 = 128\n]", "There are ( \binom{3}{1} = 3 ) such sets:", "[\n\sum |A_i| = 3 \ imes 128 = 384\n]", "3. Add back functions missing at least two bands\nNow consider ( A_i \cap A_j ), functions missing both band ( i ) and band ( j ), so birds can only go to one band.", "[\n|A_i \cap A_j| = 1^7 = 1 \quad \ ext{(only one valid assignment)}\n]", "There are ( \binom{3}{2} = 3 ) such pairs:", "[\n\sum |A_i \cap A_j| = 3 \ imes 1 = 3\n]", "4. Subtract functions missing all three bands\nThe intersection ( A_1 \cap A_2 \cap A_3 ) requires mapping birds to zero bands, which is impossible:", "[\n|A_1 \cap A_2 \cap A_3| = 0\n]", "---", "### Final Count", "Putting it all together:", "[\n\ ext{Onto functions} = 3^7 - \binom{3}{1} \cdot 2^7 + \binom{3}{2} \cdot 1^7 - \binom{3}{3} \cdot 0^7\n= 2187 - 384 + 3 - 0 = 1806\n]", "---", "### Conclusion", "Using the inclusion-exclusion principle, the number of onto functions from 7 birds to 3 bands is 1806. This method elegantly handles constraints by systematically removing overcounts of invalid assignments. Whether modeling bird banding, team assignments, or resource allocation, inclusion-exclusion offers a robust framework for constrained counting problems.", "---", "Keywords: onto functions, inclusion-exclusion principle, combinatorics, permutation counting, function space, birds to bands, mathematical problem solving, Minimum Onto Functions, combinatorial counting."]









