Finding function for data

87 Views Asked by At

I'm in need of a function for this data which occurs in an application I am making. I've been staring at it for hours and I can't figure it out, hope someone here can help me.

Here's the data:
f(x) = y
f(1.25) = 4
f(1.5) = 2
f(2) = 1
f(3) = 0.5

Now I need to know what f does in order to get y here, I can see that for halving of x's steps the steps in y will double, but I and none of my collegues have any idea how to put this into a function.

I hope someone here can help (and I hope this is the right StackExchange Mathemematics)

3

There are 3 best solutions below

1
On BEST ANSWER

A very simple function y(x) leads to the exact fit : y=1/(x-1)

0
On

Have you tried WolframAlpha for this?

You can use

"Fit (x1,y1),(x2,y2),...(xn,yn)"

Here are the results

2
On

Ok. Let's consider a sequence $a_n$ instead of $f(x)$. That makes the problem easier since the poster used only discrete values of $x$. If a continous function is needed that I am afraid that you need to use some fitting procedure as the previous answer has stated. Now the values of the $x_n, y_n$ that the OP has listed could be written in this way $$ x_3=2-0.5-0.25-0.125=2-1/2-1/4-1/8 $$ $$ x_2=2-0.5-0.25=2-1/2-1/4 $$ $$ x_1=2-0.5=2-1/2 $$ $$ x_0=2 $$ $$ x_{-1}=2+1 $$ $$ x_{-2}=2+1+2 $$ $$ x_{-3}=2+1+2+4 $$ and $$ y_3=8; y_2=4; y_1=2; y_0=1; y_{-1}=0.5; y_{-2}=0.25; y_{-3}=0.125 $$ this could be generalized in the following form (I need to try to write it in a general form, but I hope for now it will suffice) $$ x_n=2-\sum_{m=1}^n\frac{1}{2^m}+\frac{1}{2}; n\ge 1 $$ and $$ x_n=2+\sum_{m=0}^n\frac{1}{2^m}-1; n\le0 $$ I may have done some mistakes, so if you spot any, please let me know :-) and then $$ y_n=2^n $$

EDIT: I tried the FIT function as suggested in wolframalpha and got not very nice results for polynomial or logarithmic function

enter image description here