formula or method for intermediate values within simple sequence?

53 Views Asked by At

I have a series of data points and I am trying to find out the formula to calculate what intermediate values might be, for example if A is 5, what value would B have? This seems like it's pretty easy, but I don't know the terminology for this type of curve so searching for an answer has not been very fruitful. I am looking to use this date in a simple program, where I can give any value of (A) and get the corresponding (B) value.

1000   3.2
100    1.6
10     0.8
1      0.4
0.1    0.2
(A)    (B)

Examples ...

var valueB = someFormula(valueA: 1000) // would return 3.2
var valueB = someFormula(valueA: 10)   // would return 0.8
var valueB = someFormula(valueA: 0.1)  // would return 0.2
var valueB = someFormula(valueA: 5)    // would return ?

Much appreciated in advance.

1

There are 1 best solutions below

5
On BEST ANSWER

Do you notice a pattern between the two columns? When $A$ is multiplied by $10$, then $B$ is always multiplied by $2$. Therefore, it's not difficult to see that $$\tag{1} \log_{10} (A) +1 =\log_2 (5B) $$ from which we can solve for $B$ ...


I'll show how I obtained these values. I immediately saw that there is a ratio of 10 between the consecutive values of A and a ratio of 2 between the consecutive values of B, prompting me to calculate $\log_{10}A$ and $\log_2 B$. In addition, because the values of $B$ are not whole numbers, I saw that I should multiply them by $5$ to get integer values. Therefore, I should compute the value of $\log_2 (5B)$. I put the values into Excel and got a table that looks like this:

 A      Log_10(A)   B     Log_2 (5B)
 1000   3           3.2   4
 100    2           1.6   3
 10     1           0.8   2
 1      0           0.4   1
 0.1    -1          0.2   0

Now, it's pretty easy to see that you just need to add 1 to get from the second column to the last column. Thus, Equation ($1$).

When we solve Equation (1) for $A$, we get $$\tag{2} A =10^{\log_2 (B/2)} $$

On the other hand, solving for $B$ results in $$\tag{3} B = \frac{2}{5} 2^{\log_{10} (A)} $$