I have several points on a graph. The graph is of a continuous curve that flows through points (0, inf), (11, 5000), and (3, 200000). Can I find the equation for that line?
Let's try this:
I'm looking to find a function that given an input (x) becomes closer to infinity as x grows closer to 0, and closer to 0 the closer x gets to infinity.
The issue with y = log(x)
is the scale is to small (#1) and the curve it too pronounced (#2).
For constraints I would say x >= 0 && y >= 0
at all times.
The purpose of this (for those who must know or are simply curious) is as follows:
I have a program that loops through an array of values a certain number of times. The number of times should be dependent on the number of values in the array.
For example, an array with 5000 values should be processed 11 times. An array with 250k values should be processed 3 times.
int y = // Function goes here, given x;
for(int i = 0; i < y; i++)
{
// Process
}
I've been playing with a graph utility
$$\frac{0.3}{\frac{log(x)}{24}} = y$$
Gives me approximately what I'm looking for, though doesn't give a proper values as $x \to 0$ (or > 4 actually). However there has to be a "proper" way to do this. Rather then punch numbers in until it "looks" right.
Looks like the "right" way gives the following:
$$y=\frac{C}{x^n}$$
Solving for $C$ and $n$ gives $C ~= 19.3896$ and $n ~= 0.3522$ using $(5, 11), (200, 3)$ as points for simplicity.