Consider two sets $X$ and $Y$ with $|X| = m$ and $|Y| = n$ A function $f : X → Y$ is called almost-onto if $f$ misses at most one element of $Y$. Find and prove a formula for the number of almost onto functions from $X$ to $Y$.
- We had a general overview lecture of the Inclusion-Exclusion principle and how it relates to the addition principle as well as did several permutation-based problems involving permutations of certain sizes and finding how many total permutations fit a given criteria, although I do not see how that would help me with this proof. Any help is appreciated.
Have a look at the page twelvefold way on Wikipedia. It treats the case of onto (denoted as surjective) functions under various assumptions, which may help you get around some of the issues you are having. Then you can consider your problem as an extension. If the number of onto functions is $f(n,m)$ your answer should be $$n f(n-1,m)$$ i.e. you need to multiply the number of onto functions to a set of size $n-1$ with the number of $(n-1)$-subsets of $Y.$