To continue along the lines of Deigo's answer, standard sample complexity bounds from learning theory tell you that if you are satisfied with finding a program which is "approximately correct", you don't need to try very many points at all. Lets say we are encoding programs in binary, so that there are only 2d programs of length d. Lets suppose also that there is some distribution over input examples D. Perhaps your goal is to find a program which you are pretty sure is almost right ("Probably Approximately Correct" i.e. as in Valiants PAC learning model). That is, you want to run an algorithm that will take in a small number of samples x∼D together with f(x), and will with probability at least (1−δ) output some program P which agrees with f on at least a (1−ϵ) fraction of inputs drawn from D.
We will simply draw m examples x∼D, and output any program P of length ≤d that agrees with f on all of the examples. (One is guaranteed to exist since we assume f has Kolmogorov complexity at most d)...
What is the probability that a particular program P that disagrees with f on more than a n ϵ fraction of examples is consistent with the m examples we selected? It is at most (1−ϵ)m. We would like to take this probability to be at most δ/2d so that we can take a union bound over all 2d programs and say that with probability at least 1−δ, no "bad" program is consistent with our drawn examples. Solving, we see that it is sufficient to take only
m≥1ϵ(d+log1/δ)
examples. (i.e. only linearly many in the Kolmogorov complexity of
f...)
BTW, arguments like this can be used to justify "Occam's Razor": given a fixed number of observations, among all of the theories that explain them, you should choose the one with lowest Kolmogorov complexity, because there is the least chance of overfitting.
Of course, if you only want to check a single fixed program in this way, you only need O(log(1/δ)/ϵ) examples...