0

Let's say I got an array of several numbers, I know the highest one is $115$ (for example) and the lowest one is $9$. I want to turn a middle number into a decimal value in a exponential way.

For example

Highest value: $115$

Lowest value: $9$

$9 = 0.1$ (lowest decimal)

$115 = 1.0$ (highest decimal)

$67 = 0.$??

How would be the formula for this? I'm sorry if the question is a little dumb.

Siong Thye Goh
  • 149,520
  • 20
  • 88
  • 149

3 Answers3

0

Guide:

$$y = \exp(\alpha x + \beta )$$

$$\ln (y) = \alpha x + \beta$$

Solve for $\alpha$ and $\beta$.

Siong Thye Goh
  • 149,520
  • 20
  • 88
  • 149
  • Is there any math way to turn this formula into just one? Thanks anyway. – Maurício Lima Nov 08 '17 at 04:35
  • It is just one formula. Those two equations are equivalent, I write it in the second form as it might be more familiar for you to solve for slope and intercept of a linear line. – Siong Thye Goh Nov 08 '17 at 04:36
0

Your question is quite similar to converting $^0F$ to $^0C$.

  1. Calculate the ranges for both. They are respectively (115 - 9) and (1 - 0.1)

    1. Calculate the offsets from the starting points. They are respectively (67 - 9) and (x - 0.1); where x is the required.

    2. Setup the ratio $\dfrac {1 - 0.1}{115 - 9} = \dfrac {x - 0.1}{67 - 9}$.

Mick
  • 17,141
0

You want $e^{kx + t}$ where $x = 9$ yields $e^{9k + t} = .1$ so $9k + t = \ln .1$ and $ e^{115k + t} = 1$ so $115k + t = \ln 1 = 0$ so $t = -115k$.

$9k + t = 9k - 115k = -106k = \ln .1$ so $k = -\frac {\ln .1}{106} \approx 0.0217$ and $t = -115*\frac{\ln .1}{106}$

So $f(x) = e^{(115-x)\frac {\ln .1}{106}}= (.1)^{\frac {115-x}{106}}= 10^{\frac {x-115}{106}}$

So $f(67) = 10^{\frac{67-115}{106}} \approx 10^{-.4528} \approx .35$.

fleablood
  • 124,253
  • Thank you but I'll stick with the easier one because it's for programming purposes and needs lesser CPU usage, but thank you anyway. – Maurício Lima Nov 08 '17 at 05:01