Strategy for determining the number of homomorphisms between two Groups The Gallian Abstract Algebra text has a number of exercises of the form 'Determine the number of homomorphisms between two groups $G$ and $H$'. It is pointed out that, in the case of a cyclic $G$, determining the image of a generator of $G$ under a homomorphism $\phi$ suffices to specify the entire mapping, since $\phi(g^n)=\phi(g)^n$ for any $g \in G$. Hence determining the number of homomorphisms simplifies to counting generators of $H$ and applying Lagrange's Theorem. Are there any other useful properties of homomorphisms that can be used as tricks for this type of problem or just general strategies when counting maps between $\textbf{non-cyclic groups}$? Two examples I see in the text exercises are:
(1): Determine all homomorphisms from $S_3$ to $G$, where $G$ is Abelian.
(2): Determine the number of homomorphisms from $Z_p\oplus Z_p\to Z_p$, where $p$ is prime ($Z_p$ being a subgroup of the additive integers).
Thanks in advance!
 A: In general, a group homomorphism is determined entirely by the image of a set of generators. Given this, if the codomain is finite, then this puts a relatively easy to check upper bound on the total number of possible homomorphisms. For example, in your second example question, $\mathbb{Z}_p\oplus\mathbb{Z}_p$ is generated by the elements $(0,1)$ and $(1,0)$ and so any homomorphism is entirely determined by where these elements are sent (and they must be sent to elements of order dividing $p$). I don't think you quite finished typing the entire question for question 2 because you didn't mention a codomain for the set of homomorphisms.
For your first example, note that $S_n$ can be given presentation $$\langle \sigma_i\ldots,\sigma_{n-1}|\:\:\sigma_i^2=1,$$ $$\sigma_i\sigma_j=\sigma_j\sigma_i\:\:\:\mbox{ for }j\neq i\pm 1,$$ $$\sigma_i\sigma_{i+1}\sigma_i=\sigma_{i+1}\sigma_i\sigma_{i+1}\rangle$$
Suppose $h\colon S_n\rightarrow G$ is a homomorphism. Then $h$ is determined by the image of the generators. But note, $$h(\sigma_i\sigma_{i+1}\sigma_i)=h(\sigma_i)h(\sigma_{i+1})h(\sigma_i)$$
$$=h(\sigma_i)h(\sigma_{i})h(\sigma_{i+1})=h(\sigma_i\sigma_{i})h(\sigma_{i+1})=h(1)h(\sigma_{i+1})=h(\sigma_{i+1})$$
and similarly $h(\sigma_{i+1}\sigma_{i}\sigma_{i+1})=h(\sigma_i)$. But $\sigma_i\sigma_{i+1}\sigma_i=\sigma_{i+1}\sigma_i\sigma_{i+1}$ and so we have $h(\sigma_i)=h(\sigma_{i+1})$ for all $i$. By induction the image of all generators is equal and so $h$ is determined by the image of any single generator. Given that $h(\sigma_i)$ has to be an element of order dividing 2, this significantly reduces the possible homomorphisms.
