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

  • Thread starter mtanti
  • Start date
  • Tags
    Function
In summary, it is possible to find an identical function of a given black box function by approximating it using Fourier series or polynomials. However, the accuracy of the approximation depends on the behavior of the given function, and it may not be an exact match. Additionally, for functions with infinite decimals, it is impossible to identify all of its values and therefore reproduce the function.
  • #1
mtanti
172
0
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?
 
Mathematics news on Phys.org
  • #2
mtanti said:
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?

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
mtanti said:
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?
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
Given a finite number, n, of [tex]x_{i}[/tex] and their corresponding [tex]f(x_{i})[/tex] 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:
  • #5
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:
  • #6
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:
  • #7
robert Ihnot said:
So, we would have no way to find this out, or even to express such numbers since they required an infinite number of decimals.

but is there a way to identify such expressive irrational numbers such as pi, e, root 2, etc?
 
  • #8
Why bother?
Once you know the function values to each x, you KNOW what the function is..
 
  • #9
well knowing the actual function means you can reproduce it... isn't that what signal analysis is all about?
 
  • #10
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
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
 

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

1. How do I determine a function if I only know the input/output?

To determine a function with only knowing the input/output, you must first gather a set of input and output pairs. Then, you can plot these points on a graph and look for a pattern or trend. Once you have identified a pattern, you can use it to write an equation for the function.

2. What if there is no obvious pattern in the input/output pairs?

If there is no obvious pattern, you may need to gather more input/output pairs or try using different methods to determine the function, such as using a table or creating a scatter plot. You may also need to consult with a math expert for assistance.

3. Can I determine a function with just one input/output pair?

No, you need at least two input/output pairs to determine a function. This is because a function requires at least two points to create a line or curve.

4. How do I know if the function I determine is correct?

To check if the function you have determined is correct, you can plug in the input values into the equation and see if it matches the corresponding output values. You can also graph the function and see if it fits the input/output pairs.

5. Are there any shortcuts or tips for determining a function with only input/output?

There are no shortcuts for determining a function with only input/output. However, it may be helpful to familiarize yourself with common functions and their corresponding graphs, such as linear, quadratic, and exponential functions. This can help you identify patterns more easily.

Similar threads

  • General Math
Replies
4
Views
807
Replies
3
Views
879
Replies
4
Views
967
Replies
1
Views
1K
  • General Math
Replies
5
Views
902
Replies
3
Views
985
  • General Math
Replies
9
Views
2K
Replies
10
Views
1K
Back
Top