Calculate number of subsets I want to find how many subsets $A$ contains the set $\{ 1,2, \dots, 7 \}$ with the property  $$(3 \in A \iff 2 \in A).$$
The set $\{ 1,2, \dots, 7\}$ has in total $2^7=128$ subsets, right?
In order to find the number of subsets $A$ with the property $(3 \in A \iff 2 \in A)$, we have to find the number of subsets that do not contain both $2$ and $3$ and subtract the result by $128$, right?
But how do we find the number of subsets of $\{ 1,2, \dots, 7 \}$ that do not conatin both $2$ and $3$ ?
 A: So you either want subsets that have $2$ and $3$ in or sets with neither. One way to think about this would be to consider $2$ and $3$ as a single object (which is either in or out). So then you are thinking of subsets of the following six objects: $\{1,2/3,4,5,6,7\}$.
The reasoning that you have already explained will tell you how to work out the number of subsets of this six element set.
A: As noticed in the comments we need to find the number of subsets that contain both $2$ and $3$ and the number of subsets that contain neither $2$ nor $3$.
We have that


*

*the number of subsets with both $2$ and $3$ can be obtained by $2^5$ indeed

*the number of subsets not containing $2$ nor $3$ can be obtained by $2^5$ indeed.
A: 
"we have to find the number of subsets that do not contain both 2 and
  3 and subtract the result by 128, right?"

That's one way to do it.  But it's probably easier to find the number of subsets that do contain both and the the number that contain neither and add those up.  
The number that contain both must contain $2$ or $3$ and may or may not contain the remaining $5$ so that that is $2^5 = 32$.  And the sets that contain neither may or may not contain the remaining $5$ so that is $2^5 = 32$.  So there are $64$ than contain either both or neither.
We could attempt to find those that contain one or or the other but not both.  There are $2$ options whether it contains $2$ or whether it contains $3$.  And for the remaining $5$ there are $2^5=32$ ways it may contain any combination of those.  So there are $2*32  =64$ ways it can contain one or the other but not both.  ANd therefore $128 - 64 = 64$ ways it can contains both or neither.
Perhaps to make this less symmetric.  Suppose it were the set $\{1,....,10\}$ and $A$ is the set that it contains $2,3$ or $4$ if and only if it contains all three.  Then either it contains all three of them (there is $2^7=128$ ways this can occur) or it contains none (there are $2^7=18$ ways this can occur) so there are $128 + 128 = 256$ ways this can occur.
Alternatively we can say.  There $2^7=128$ options as to whether it contains $1,5,6...$ and two options whether it contains all or none of the remaining three so there are $2*128 = 256$ ways to do this.
If we attempt to calculate how many ways it can contain $1$ or $2$ but not all $3$ and not none of the three.  There are ${3\choose 1} =3$ ways we can choose one of $2,3,4$ and there are ${3\choose 2} =3$ ways we can choose two of $2,3,4$.  And of the remaining seven there are $2^7 = 128$ ways to choose them so there are $(3+3)*128 = 768$ to choose one or two of $2,3,4$.  And so there are $2^10 - 768 = 256$ ways to choose either all three or none.
