Find out $n$-th term of monotonic functions increasing and decreasing

92 Views Asked by At

I have a series whose max and min values are defined. the values in the series have an increase monotonically by $x\%$ and decrease once the maximum is reached. For example, this series has a min value of $200$, and max value of $500$, it increases by $20\%$ from the previous value each time and it starts to decrease by the same percentage after reaching its maximum.

240
288
345.6
414.72
497.664
414.72
345.6
288
240
200
240
288
345.6
414.72
497.664
414.72
345.6
288
240
200
240
288
345.6
414.72
497.664
414.72
345.6
288
240
200
240
288

this is a very trivial question but can we build a function to get what is the nth term in the series? if yes, can point me to some reference? or help me build one?

and how do we represent in the form of a function?

2

There are 2 best solutions below

0
On BEST ANSWER

Let's denote by $x_{min}, x_{max}, x(n'), x(n)$ and $p$ the minimum value, the maximum value, the term that is just before reaching $x_{max}$, the $n$-th term in the sequence and the percentage of change, respectively. In that way,

\begin{align} x(0) &= x_{min}\\ x(1) &= x_{min}\times(1+p)\\ x(2) &= x_{min}\times(1+p)^2\\ &\hspace{0.2cm}\vdots\\ x(n') &= x_{min}\times(1+p)^{n'}\\ x(n'+1) &= x_{min}\times(1+p)^{n'-1}\\ x(n'+2) &= x_{min}\times(1+p)^{n'-2}\\ &\hspace{0.2cm}\vdots\\ x(2n') &= x_{min}\\ \end{align}

By definition, $n'$ is such that

$$x(n') = x_{min}\times(1+p)^{n'} \lt x_{max}$$

Therefore,

$$n' = \left\lfloor \frac{\text{log}(x_{max}/x_{min})}{\text{log}(1+p)} \right\rfloor,$$

where $\lfloor \cdot \rfloor$ is the floor function. In your example, $n' = 5$. From here you could figure out several ways to compute $x(n)$ for any non-negative $n$. Note that $x(n)$ is periodic with period $2n'$, so you just have to define $x(n)$ over one period. One way could be

$$ x(n) = \left\{ \begin{array}{ll} x_{min}\times(1+p)^{n} & 0 \leq n \leq n'\\ x_{min}\times(1+p)^{2n'-n} & n' \lt n \leq 2n'\\ \end{array} \right . $$

0
On

Hint:

An change by $x\%$ amounts to multiplying by $1+\frac x{100}$, hence a geometric progression

$$t_{n+k}=r^kt_n.$$

You reach a certain value when

$$r^kt_n\le V<r^{k+1}t_n,$$

i.e.

$$k\le\log_r\left(\frac V{t_n}\right)<k+1.$$