If U = {A, B, C, D, E} determine the number of relations on U that are
- reflexive my answer: 2^5
- symmetric my answer:2^5C2
- reflexive and symmetric my answer:2^5C2 * 2^5
- reflexive, symmetric and contain (A,B) my answer: 0? because containing (A,B) cannot be reflexive?
is my solution correct? is there any formula to better calculate total number of relations of different properties?
Thanks
Let $U=\{a,b,c,d,e\}$. A reflexive relation on $U$ must contain each of the pairs $\langle a,a\rangle,\langle b,b\rangle,\langle c,c\rangle$, $\langle d,d\rangle$, and $\langle e,e\rangle$. That’s $5$ of the $25$ possible ordered pairs. Each of the other $20$ ordered pairs in $U\times U$ is optional: a reflexive relation on $U$ may contain it but need not. Thus, to make a reflexive relation on $U$ we start with the $5$ required pairs, and then for each of the other $20$ pairs we either include it or not. That’s a total of $20$ two-way decisions, so there are $2^{20}$ ways to choose which of the optional pairs will be in the reflexive relation.
You can think about symmetry in a similar fashion. Suppose that $R$ is a symmetric relation on $U$. The following diagram labels the ordered pairs in $U\times U$; the row indicates the first element of the ordered pair, and the column indicates the second. Thus, the ordered pair $\langle b,d\rangle$ corresponds to the square labelled with the black $5$, while the reversed pair $\langle b,d\rangle$ corresponds to the square labelled with the red $\color{red}5$. Squares corresponding to pairs with both elements the same are labelled with hyphens.
$$\begin{array}{|c|c|c|} \hline &a&b&c&d&e\\ \hline a&-&0&1&2&3\\ \hline b&\color{red}0&-&4&5&6\\ \hline c&\color{red}1&\color{red}4&-&7&8\\ \hline d&\color{red}2&\color{red}5&\color{red}7&-&9\\ \hline e&\color{red}3&\color{red}6&\color{red}8&\color{red}9&-\\ \hline \end{array}$$
Symmetry says that if $R$ contains one of the pairs whose corresponding square has a black number, it must also contain the pair whose corresponding square has the matching red number, and vice versa. For instance, if it contains either of the pairs $\langle b,d\rangle$ and $\langle d,b\rangle$, whose squares are numbered $5$ and $\color{red}5$, respectively, then it must contain both of those pairs. Thus, for each of the numbers $0,1,\ldots,9$ we have a two-way choice: if $k$ is one of these numbers, we can put into $R$ the two pairs corresponding to the squares labelled $k$ and $\color{red}k$, or we can leave both of those pairs out of $R$. Moreover, $R$ can contain a pair like $\langle b,b\rangle$ or not: the reversal of $\langle b,b\rangle$ is the same pair, so if $R$ contains the pair $\langle b,b\rangle$, it automatically contains its reversal as well. That’s another $5$ two-way choices, for a total of $15$ two-way choices in building a symmetric relation on $U$, or $2^{15}$ such relations.
A relation $R$ on $U$ that is both reflexive and symmetric must include all of the pairs like $\langle b,b\rangle$, and it must satisfy the symmetry condition. It should be clear that this number cannot be bigger than either of the first two answers: every relation that is both reflexive and symmetric is clearly reflexive, so there can’t be more than $2^{20}$ such relations, and it is also clearly symmetric, so in fact there can’t be more than $2^{15}$ such relations. If you carefully examine the reasoning in the previous paragraph, you should be able to figure out how many reflexive, symmetric relations there are on $U$.
The last question can be answered by similar reasoning. It is certainly not true that the answer is $0$: $\{\langle a,a\rangle,\langle a,b\rangle,\langle b,b\rangle,\langle c,c\rangle,\langle d,d\rangle,\langle e,e\rangle\}$ is a reflexive relation on $U$ that contains the pair $\langle a,b\rangle$.