For a set A and a number n let F_n^A(x_1,...,x_n) =
A(x_1)\cdots A(x_n). We study how hard it is to approximate this
function in terms of the number of queries required. For a general
set A we have exact bounds that depend on functions from coding
theory. These are applied to get exact bounds for the case where A is
semirecursive, A is superterse, and (assuming P<>NP) A=SAT. We obtain
exact bounds for A=K using other methods.