The teacher hasn't uploaded a solution for this question yet.
A function $f: A \to B$ is surjective (onto) if every element in the codomain $B$ has at least one pre-image in the domain $A$. Here, $|A| = n$ and $|B| = 2$.
The total number of functions from set $A$ to set $B$ is given by $|B|^{|A|}$. Since $|A| = n$ and $|B| = 2$, the total number of functions is $2^n$.
A function is not surjective if its range is a proper subset of $B$. Since $B = \{a, b\}$, the only non-surjective functions are those where the range is either $\{a\}$ or $\{b\}$. These are the constant functions.
There are exactly 2 constant functions: one mapping all elements to $a$, and one mapping all elements to $b$. Thus, the number of surjections is: $$2^n - 2$$
Final Answer: 2^n - 2
AI generated content. Review strictly for academic accuracy.