# Creating A Function For The Following:

In trying to manipulate a function arrived at in a prior post, I've arrived at this (as a goal):

$$\begin{array}{c|c} x & y \\ \hline 0.3^{-1} & -1 \\ 0.3^{-1}+0.3^{0} & 0 \\ 0.3^{-1}+0.3^{0}+0.3^{1}& 1 \\ 0.3^{-1}+0.3^{0}+0.3^{1}+0.3^{2} & 2 \\ 0.3^{-1}+0.3^{0}+0.3^{1}+0.3^{2}+0.3^{3} & 3 \\ \end{array}$$

But, I'm having issues creating the right function. I'd be very thankful if someone could give me a hand with it!

• @zwim Could you expand the hint ever so slightly? Thank you! Oct 2, 2019 at 19:08
• math.stackexchange.com/questions/3378076/… Sorry, I did not understand your question until I saw your other post. So you want to find $y$ given the sum $x$. Is that right ?
– zwim
Oct 2, 2019 at 19:38
• Yes, @zwim, thank you! Oct 2, 2019 at 20:28

In your other post you were given the formula (where $$a=0.3$$)

$$x=\dfrac{1-a^{y+2}}{(1-a)a}$$

So isolating $$y$$ we get $$\quad a^{y+2}=1-x(1-a)a\iff y+2=\log_a(1-xa+xa^2)$$

The formula you seek is thus $$y=\dfrac{\ln(1-xa+xa^2)}{\ln(a)}-2$$

• Sorry for my comment; I made an error when solving for x. Your work is perfect and awesome! Oct 2, 2019 at 22:46

I think this fulfills what you are asking for. $$\DeclareMathOperator*{\argmax}{arg\,max}$$ $$$$y={\argmax_{\sum_{i=-1}^{a}{0.3^i}\le x }}a$$$$

Achieving a smooth function may not be is possible (look at zwim's answer).

• This fulfills the vague question without mindreading. zwim's answer probably fulfills the asker's intent, and is not a step function. Oct 2, 2019 at 20:09
• Not what I intended, but still a really clever thought! Oct 2, 2019 at 20:44