given a total width and a given number of decreasing widths to fit that width, what is the % decrease

28 Views Asked by At

Hailing from the programming world here, maths has never been my strongest area.

I have a width (TW), and that width must be divided by a given number(N) of smaller widths which decrease incrementally. They should decrease by the same percentage each time(P). The sum of these widths should be equal to TW.

I need to solve for P.

I have been scribbling down on paper for a few hours now, and I am unable to work out the solution.

Please let me know if the equation is solvable (if not then what is missing), and if so how to solve it?

Thanks guys!

2

There are 2 best solutions below

1
On

You have to clarify your post. Nevertheless I have a suggestion:

$\sum_{t=0}^N w \cdot (1-P)^t=TW$

w is the smaller width.

Proof the equation according to what you want to calculate. The LHS can be expressed by the formula for the partial sum of a series.

$\sum_{t=0}^N w \cdot (1-P)^t= w\frac{1-(1-P)^{N+1}}{P}=TW$

To solve this equation you have to use a approximation procedure.

0
On

Starting from Calculus's answer, assuming that $w$ is known, you have to solve for $P$ $$f(P)=w\frac{1-(1-P)^{N+1}}{P}-TW=0$$ for which, there is no analytical solution (just as Calculus wrote) and you will need some numerical method such as Newton, the problem being that you need a starting value $P_0$ to start iterations.

What you could notice is the value $P$ you look for corresponds to the intersection of the function $(1-P)^{N+1}$ and the straight line $\Big(1-\frac{TW}{w} P\Big)$. I hope that this could help.