I know that equivalence relations must be reflexive, symmetric and transitive. But how do I obtain the sets of equivalence relation from a specific relation?
Below is the question: Let S be {1,2,3}. How many binary relations R on S are there such that (i) R is reflexive? (ii) R is symmetric? (iii) R is an equivalence relation?
Attached is the solution.

For part (i) and (ii), how does the 3^2 -3 come about? I understand the 2 is the number of choices of whether the relation is symmetric or not symmetric.
For part (iii), how does the answer come up with the equivalence relations? I observed that the sets of relations are all possible relations in S = {1,2,3}.
I am really confused by the counting of number of reflexive/symmetric/transitive relations :(