2^n possible attribute sets on the LHS, and again 2^n possible attribute sets on the RHS. Both counts include the empty set.
Number of possible distinct pairs between those is 2^n * 2^n.
While technically correct, this answer also implies that FDs such as {AB} -> {} are also considered. How many of those are there ? For each cardinality l of the LHS, there are 2^l possible subsets, each of those giving a trivial FD if it appears on the RHS. So the number of trivial FDs is 2^0 + 2^1 + 2^2 + ... + 2^n = 2^(n+1) - 1. Leaving in total 2^(2*n) + 1 - 2^(n+1).
But now we have excluded only {AB} -> {A} and the like, and not {AB} -> {AC}. If we want the RHS to mention only attributes that are not mentioned on the LHS, then for each cardinality l of the LHS, there are 2^(n-l)-1 possible subsets on the RHS (that extra minus one is needed because the empty set must be excluded). Summing up to 2^0 - 1 + 2^1 - 1 + 2^2 - 1 + ... + 2^n - 1 = 2^(n+1) - 1 - (n + 1).
Still different from the answer given. And at any rate, the question was formulated hopelessly poorly. The question DID NOT STATE that trivial FDs were to be excluded. The question DID NOT STATE that "partially trivial" FDs were to be excluded.
BTW let's take the answers to the test. Choose a relation of degree 1, {A}. There are four possible FDs :
{} -> {} trivial, RHS subset of LHS
{} -> {A}
{A} -> {} trivial, RHS subset of LHS
{A} -> {A} trivial, RHS subset of LHS.
The correct answer, if trivial FDs are to be excluded, is "one". Your textbook says it's "four".