# Find out the function based on a specific rule (Non-linear function)

If I had the table of $x$ , $f(x)$ pairs, and this is the rule:

\begin{array} {|r|r|} \hline 1 &1 \\ \hline \hline x_i & f(x_i) \\ \hline \hline 2x_i & 1 +f(x_i) \\ \hline \end{array}

Basically that means that for every $x$ the function value will increment at the $2x$ point.

I'm struggling to find out the exact function, in which i can input the $x$, and it will give me the correct output. :)

I know that the function will look something like this.

So far I constructed this table \begin{array} {|r|r|} \hline x & f(x) \\ \hline \hline 1 &1 \\ \hline \hline 2 &2 \\ \hline \hline 3 & k \\ \hline \hline 4 & 3 \\ \hline \hline 5 & \\ \hline \hline 6 & k+1 \\ \hline \hline ... & ...\\ \hline \hline 8 & 4\\ \hline \hline ... & ...\\ \hline \hline 12 & k+2\\ \hline \hline ... & ...\\ \hline \hline 16 & 5\\ \hline \hline ... & ...\\ \hline \end{array}

where $k$ is the number between 2 and 3, obviously.

I tried interpolating that table in wolfram, but it can't work. I think that there is simple solution to this function. Or is there?

Feel free to edit the question if you think that it can be improved.

Another way of phrasing this would be that $f(2x)=1+f(x)$.

Note that $x=0$ can not be in the domain of this function as if it was there $f(2\times0)=1+f(0)\implies0=1$

A function which fits your data is:

$$f(x)=1+\log_2x$$

Edit: How I arrived at this: take the table you have create and instead of looking at how $x$ links to $f(x)$ look for the reverse link. When $f(x)$ increases by one then $x$ doubles.

Hence:

$$2^{f(x)-1}=x$$

(the $-1$ is just there to match the powers up)

Then from this rearrange to get:

$$f(x)-1=\log_2x$$

$$f(x)=1+\log_2x$$

• Tested it, and it works, but I'm struggling to figure out how did you come to this solution.
– user334473
Jun 9, 2016 at 15:26
• Updated with my how I got the answer. Jun 9, 2016 at 15:42