[Math] Logarithmic Decay Weighting Factor

algebra-precalculusalgebraic-curvesfunctionslogarithmsstatistics

I purchase a banana for $\$10$ (in $2100$ when bananas will cost so much). I want to find a decaying factor that will decay the price of this banana in a manner that looks like (I think) the logarithmic function $y=a+b \ln(x)$:

Decay of Banana Purchase

So in month $1-6$, I would like the decay to be slow, and then quicker decay from month $6-12$ (or $6$ to any number of months).

I tried Gerry's function, and it resulted in the curve below. This is not the end goal, because this is resulting in the decay happening faster in the beginning:

enter image description here

Essentially, what operation could I perform on the $\$10$ banana purchase to weight it appropriately if I want this type of decay?

Forgive me – this is my first time posting in Mathematics, and I am by no means a math guy. Please let me know if I can alter my question or change the tags.

Thank you for any insight you all may have!

Best Answer

Here's a cubic polynomial to play with. $$ f(x) = ax^3 + bx^2 +cx +d. $$

You want $d = f(0)$ to be the value of the bananas at the start.

You want the derivative of $f$ at $0$ to be $0$ so that the curve is flat there. That tells you $c=0$.

You want $f(t)=0$ for the known value of $t$ when the bananas are free. That gives you one linear equation relating the unknowns $a$ and $b$ and the known value of $d$: $$ t^3a + t^2b + d = 0. $$

You have one more thing you can specify. I thought about using the slope (steepness) at $t$. Call that $-k$ since you want a slope down to the right.

That tells you $$ 3t^2a + 2tb +k = 0. $$

Now solve for $a$ and $b$:

$$ a = \frac{2d-kt}{t^3} $$ $$ b = \frac{kt-3d}{t^2} $$ This is easy to play with in Excel. Then you can change the values of $d$, $t$ and $k$ and see what happens.

I put these into Excel with the values $d=10$, $t=12$ and $k=2$ and got this picture:

enter image description here

Warning: If you try with $k$ too large to get a steeper descent at $t$ then $b$ will become positive and $f(x)$ will become larger than $d$ for a while. That suggests that the best (steepest) value for $k$ is $3d/t$, which will make $b=0$. If I wanted to spend more time on this I'd just assume that from the start. I leave that to you.

Edit: In retrospect, this is much easier. (Often in mathematics you think "that's obvious" - but only after you solved the problem a hard way.)

Given the value $d$ when the bananas are new and the time $t$ when they're free, put the inflection point of the cubic at $x=0$: $$ f(x) = ax^3 +d . $$ Then $f(0) = d$. Setting $a = -d/t^3$ makes $f(t) = 0$.

Related Question