I've been stuck on this question for hours, and am having trouble trying to start this question. If anyone could help, that would much appreciated.
The question is Let $A = \{a_1, a_2, a_3, a_4\}$ and $B = \{b_1, b_2, b_3, b_4, b_5\}$ (where $|A| =4$ and $|B|=5$), how many injective functions $f: A \to B$ satisfy $f(a_1) = b_1$ or $f(a_2)=b_2$?
Define $F_1 = \{f\colon A\to B | f(a_1) = a_1, f \text{ injective} \}$. Define $F_2$ similarly for $f(a_2) = b_2$. Then use the fact that functions in $F_1$ are injective to find the cardinality of $F_1$ and similarly for $F_2$. Once you've done this, find the cardinality of $F_1 \cap F_2$. Then the total number of injective functions $f\colon A\to B$ satisfying $f(a_1) = b_1$ or $f(a_2) = b_2$ is $|F_1| + |F_2| - |F_1 \cap F_2|$ by the inclusion exclusion principle.