0

(Fair warning: I'm a computer engineer)

I was looking for a function $f$ that maps a value from $[0, 1]$ to $[\frac{1}{n}, n]$. So, $f(0) = \frac{1}{n}$, $f(1) = n$, $f(0.5) = 1$, $f(0.75) = \frac{n}{2}$ and so on...

I fired up Excell and it gives me this simple graph (for $n = 4$ here)

Since it looks like a simple exponential curve, I theorize that I was looking for a function in the form $f(n) = (ax + b)^c$.

With a bit of trial and error, I found out that $$b = (\frac{1}{n})^{\frac{1}{c} }$$ to have that little shift up. Knowing that $n = (a + b)^c$, I know that $$a = n^{\frac{1}{c}} - b.$$

Plotting that with $c = 2$, gives me a new graph with this estimation.

Which looks good, but not curved enough. By increasing $c$, it gets closer and closer to the target curve. Remember that for now, I'm only comparing with the curves for $n = 4$. Well, of course, when I tried with $n = 10$, it diverges quite a bit.

In the end, I kind of find the solution to my problem (only for $n = 4$ which is my need), but I have to tend the power $c$ to infinity (which is less than convenient) and it feels pretty complicated for this simple curve.

What do I do wrong here? Thanks.

Chubby Chef
  • 1,524

0 Answers0