How many ordered pairs $(A,B)$ there are if $A$ and $B$ are subsets of $\{ 1,2,3,4,5,\ldots,20 \}$ such that $A \cap B = \{2,5,6\}$?
Solution :
Any number from $\{ 1,3,4,7,\ldots,20 \}$ can go either to $A$ or $B$ or neither
So we have $3^{17}$ possible subsets
I need further explanation of the solution "which is not mine" .... thanks
A handy way to formulate the problem is through the so-called 'membership' function. Given the set $S=\{1,...,20\}$ and subsets $A,B\subset S$ define $$f_{AB} : s\in S \mapsto (1_A(s),1_B(s)) \in \{0,1\}^2.$$ Here, e.g. $1_A(s)$ is 1 or 0 depending upon $s\in A$ or not. Conversely, given any map $f : S \to \{0,1\}^2$ there are unique subsets $A,B\subset S$ for which $f$ is the membership function. We thus have a bijection between couple of subsets $(A,B)$ and membership functions. In the present context the goal is to calculate the number of membership functions satisfying the constraint $f^{-1}((1,1))= \{2,5,6\}$ (i.e. specifying the intersection $A\cap B=\{2,5,6\}$). The values of $f$ at $s\in S\setminus\{2,5,6\}$ is any of the three other possible values of memberships and as these choices are independent there are in total $3^{17}$ such membership functions, as already deduced through a combinatorial argument in a comment to the post.
For the present problem, the membership function carries no particular advantage over the straight-forward combinatorial argument. But consider e.g. the similar problem for the number of ordered triples $(A,B,C) \subset S$ with the constraint that $A\cap B\cap C=\{2,5,6\}$. Using combinatorics is perhaps less obvious here whereas the membership function, now taking values in $\{0,1\}^3$ (which is of cardinality $8=1+7$) immediately yields the answer $7^{17}$.