Describing equivalence classes of ad=bc mod n Let $G = \{1,2,3,4\}$, and let $H = G\times G$. Define a relation $R$ on $H$ as follows:
$$
(a,b)R(c,d) \text{ if and only if } ad \equiv bc \mod 5.
$$
 a. Show that $R$ is an equivalence relation.
b. Describe the equivalence classes of $R$. 
I think I did alright with part a, but I am struggling with part b. Should I use matrix to describe all equivalence classes, or just write something like:
$[e]=\{a,b,c,d \in G \mid e = (ad - bc) \div 5, e\in Z \}$. And if I am going to use matrix, how should I do it? Thank you
 A: Not that every element $a$ in $G=\{1,2,3,4\}$ has an inverse $b^{-1}$ $\mod 5$ so that $b.b^{-1}=1 \mod 5$ if you're allowed to use this then we can define the equivalence classes using the inverse.
First an equivalence class is the set of pairs $(a,b)$ which "are related" by $R$, So the equivalences classes can only be defined by the value of $ab^{-1} \mod 5$, because for any pair $(a,b)$ if we know the value of $ab^{-1} \mod 5$ then we can deduce if another element "are related" to this $(a,b)$, so it's very useful to define the equivalence classes as:
$$\left[e\right]=\left\{(a,b)\in G^2\Big / ab^{-1}\equiv e \mod 5 \right\} $$
so that there is exatly $4$ classes : $[1],[2],[3],[4],[5]$.
A: Note: This answer builds on concepts that you may not have seen in a "discrete mathematics" course. I hope to provide some perspective in case you, or some other later reader, have seen them. Otherwise you may prefer one of the other answers.
This particular equivalence relation is how one defines the field of fractions of an arbitrary integral domain. The pair $(a,b)$ is going to represent the fraction $\frac ab$.
In this case the integral domain is the integers modulo 5. However, since this is already a field, it is its own field of fractions, so we should expect exactly one equivalence class for each element of $G$. Namely, $a\in G$ corresponds to the equivalence class containing $\frac a1 = (a,1)$.
Knowing how to work with fractions in the familiar $\mathbb Z$-to-$\mathbb Q$ case, we can then see that the equivalence classes must be
$$ [a] = \{(ag\bmod 5, g)\mid g\in G\} $$
for every $a \in G$.
(Actually we're missing the zero. The actual construction of the field of fractions would have $H=R\times (R\setminus \{0\})$ where $R=\{0,1,2,3,4\}$, so $R\setminus\{0\}$ is what the exercise calls $G$).
