# How to determine a function f(x) with only knowing input/output?

1. Nov 29, 2006

### mtanti

If I give you a function f(x) as a black box (you can't see the contents of it) and you can try any value of x you want and note the output values, would it be possible to find an identicle function of it?

2. Nov 29, 2006

### Mattara

It is probably possible by the use of a computer if the graph is not relatively simple such as a sine curve, linear etc. because then you could solve it by yourself by simple plotting the dots and connecting them together.

3. Nov 29, 2006

### Swapnil

I think so. I mean no matter how the function looks like, we can always approximate it using fourier series and write it as a sum of cos() and sin() terms.

edit: on second thought may not always. The function has to be welll-behaved and should enclose a finite area (i.e. the integral from -infnity to infinity converges).

4. Nov 29, 2006

### AlphaNumeric

Given a finite number, n, of $$x_{i}$$ and their corresponding $$f(x_{i})$$ you can ALWAYS find a polynomial which matches those inputs for outputs, obviously providing you don't give two outputs for the same input. Will it be the same function? Probably not, because infinitely many polynomials will match those points but have different overall expressions.

You can see this is true just by writing f(x) as a general n-1'th order polynomial and then putting in the various values of x and f(x) and you end up with n simultaneous equations which would be a pain to solve for large n, but that's why they invented Mathematica, or PhD students ;)

As you add more and more points, your computed f(x) will get closer and closer to your actual f(x) provided your f(x) is a function which has a power series expansion. If it doesn't, there'll be a problem somewhere like the simultaneous equations end up with incompatible equations.

Last edited: Nov 29, 2006
5. Nov 30, 2006

### leon1127

this is just a basic concept of calculus....
as number of base point -> infiinity, the uncertainty -> 0.... lol

You can always interpolate all points that you have acquired. But you are doomed if the given f[x] is not even continuous, i.e.,
f[x]= 1 ;for all finite of x you plug in, and = random number in reals ;for all x that you did not try.

Last edited: Nov 30, 2006
6. Nov 30, 2006

### robert Ihnot

mtanti: would it be possible to find an identicle function of it?

Well, I don't think so. Suppose we design a function continuous on the rational and algebratic, and throw in a some consistant transcendental values for pi, e, etc. Then let an infinite number of transcendental values be 0, particularly those that do not a nice "closed form," we might identify. So, we would have no way to find this out, or even to express such numbers since they required an infinite number of decimals.

Of course to collect such transcendental numbers, we rely on the axiom of choice.

Last edited: Nov 30, 2006
7. Nov 30, 2006

### mtanti

but is there a way to identify such expressive irrational numbers such as pi, e, root 2, etc?

8. Nov 30, 2006

### arildno

Why bother?
Once you know the function values to each x, you KNOW what the function is..

9. Nov 30, 2006

### mtanti

well knowing the actual function means you can reproduce it... isn't that what signal analysis is all about?

10. Nov 30, 2006

### robert Ihnot

mtanti: but is there a way to identify such expressive irrational numbers such as pi, e, root 2, etc?

Well, since it was your "black box" function, I was thinking of asking you!

From the standpoint of Physics, I guess they just rely upon approximations. That's the whole theory of Newton's gravity, replaced by Einstein's Relativity. We know these things only to a approximate degree.

11. Dec 1, 2006

### kesh

given a general function on the real numbers you cannot, it has uncountably many arguments to define. put some behaviour on it (an analytic function of a complex variable for example, or a differentiable function of reals with a bounded derivative) and things get more possible and more interesting