"Find the number of equivalence relations on the set $\{1,2,3,\ldots,7\}$ such that:
a) $1\sim2$ and $3\sim4$.
b) $1\not\sim2$, $1\not\sim3$ and $3\not\sim2$."
Solving this problem is equivalent to finding the number of partitions in which elements are/aren't in the same part. So far I've only been able to solve this problem by listing all the possible kinds of partitions and counting them: for example, in the first problem, if one part is $\{1,2\}$ and another is $\{3,4\}$ that leaves $5$ possible ways to partition the remaining three elements; or if one part is of the form $\{1,2,x\}$ and another is $\{3,4\}$, then there are $3$ possible values of $x$ and $2$ ways to partition the remaining elements, leaving $6$ partitions; and so on. However, this seems like a very clumsy way to solve the problem and is feasible only because there are very few elements. In fact, I've already caught myself making lots of counting errors. Is there a better way to solve this problem?