calculate multiplication factor to go from 1 to 100 in y attempts

104 Views Asked by At

I have totalnumberofdays and percentage on day 1. I have to incrementally grow the currentpercentage every day so that it reaches 100 percent on day n

For ex:

If totalnumberofdays = 7, percentage on day 1 = 1

currentpercentage would be equal to percentage on day 1 the first day and then needs to grow incrementally.

Day 1   1 percent
Day 2   2 percent
Day 3   5 percent
Day 4   10 percent
Day 5   20 percent
Day 6   50 percent
Day 7   100 percent

How should currentpercentage be calculated for each day.

1

There are 1 best solutions below

1
On BEST ANSWER

The problem is stated confusingly because growth is often calculated as a percentage, but growth in percentage uses this term twice. Are you sure you are not confused with the terms?

Apart from that, this just looks like an exponential function:

Define $p_1$ as the percentage on day 1, and in general $p_i$ the percentage on day $i$. And a daily growth of (percentage) $q$

Then we have:

$$p_i = p_1 \cdot q ^ {i-1}$$

With formulas from your textbooks (or comments), you should be able to calculate $q$ from $p_1$, $n$, etc.