Knowing number of elements in a relation from this information about equivalence classes. I am trying to understand this question: 
Let $A$ be a set with $24$ elements, and let $E$ be an equivalence relation on $A$. 
$E$  divides $A$ to $7$ equivalence classes in the following way: 
$3$ equivalence classes that has $4$ elements each. 
$4$ equivalence classes that has $3$ elements each. 
What is $|E|$ or how many elements are in the relation. 

My Attempt: 
I know that $[a]_E=\{b\in A \mid (a,b)\in E\}$ is the definition of equivalence class. so if I have $3$ equivalence classes with $4$ elements each that means I have $12$ pairs in $E$, but $E$ is a symmetric relation, so if $(a,b)\in E$ automatically we get $(b,a)\in E$ so $24$, and same thing for the other equivalence classes we get more $24$ pairs. but the answer was $84$. 
After thinking about it, I thought about the reflexive property and we can add $24$ pairs more since for each element in $A$ we get $(a,a)\in E$, but thinking about it again, in every equivalence class, I have already counted some of these elements, because every element is in it's own equivalence class, so I'm wondering why don't we subtract $7$ from the answer. 
All help is appreciated, Thanks in advance.
 A: Within an equivalence class,  every element is paired with every element, every possible ordered pair is there.   So for instance, if one equivalence class is $\{a,b,c,d\}$ you have every possible ordered pair $(x,y)$ where $x,y\in\{a,b,c,d\}$,  i.e you have the full cross product and thus 16 ordered pairs relating those 4 elements.   Same thing with the 3 sets,  you have $3^2$ there for each one.  Add them up.
A: The set $E$ contains all pairs $(x_1, x_2)$ such that $x_1 \sim x_2$ or in other words it contains all pairs for which the two elements of the pair are in the same equivalence class. An equivalence class with three elements, say $x,y,z$ will make the following 9 pairs appear in $E$:
$$(x,x), (x,y), (x,z), (y,x), (y,y), (y,z), (z,x), (z,y), (z,z)$$
The pattern here is that each combination of two elements of the equvialence class is an element of $E$ resulting in $3 \cdot 3 = 9$ elements in E. Similarly, an equivalence class with 4 elements will result in 16 more elements in the set $E$ (since we have all possible pairs of two elements again). In general, one can conclude from that that an equivalence class with $n$ elements will make $n^2$ elements "join" the set $E$.
Adding everything up in this special case, we will get:
$$|E| = 4\cdot 9 + 3 \cdot 16 = 84$$
I hope this helps you.
