geometric progression point distribution when one extreme point is negetive

45 Views Asked by At

How to generate 20 points from -0.01 to 100 which are geometrically equal in separation means if I want to plot in log scale $\log d_2 - \log d_1 = \log d_3 - \log d_2$ where $d_1$, $d_2$, $d_3$ are some points in between them. I can generate 20 points from 0.01 to 100 which follow a geometrical progression. However, if the extreme boundary is negative what is the procedure.

1

There are 1 best solutions below

0
On

Here is one way to partition an interval $[a,b]$ into $m$ subintervals whose lengths form a geometric progression. Use the formula $$g(k)=2a-b+2^{k/m}\cdot(b-a) \tag{1}$$ for $k=0,1,\cdots m$ to give the $m+1$ endpoints of the partition. Then the lengths of the $m$ subintervals are (for $k$ from $1$ to $m$) given by $g(k)-g(k-1).$ The common ratio of the geometric progression of lengths is $2^{1/m}.$

I did this for your case of $[a,b]=[-0.01,100]$ using $m=12$ intervals and it worked fine. [I realize you wanted $20$ intervals but you can re-do this for that choice.] Here we have $$g(k)=-100.02+2^{k/12}\cdot(100.01). \tag{2}$$ To check the ratio one needs two adjacent intervals, so three successive values of $g(k).$ The first three $g(k)$ [to 4 decimals] are $-0.01,5.9369,12.2374.$ This gives the first two lengths as $5.9469,\ 6.3005$ and the ratio between these is $6.3005/5.9469=1.0594..$ which is the same as $2^{1/12}$ to four places. I checked also a few more cases of adjacent intervals, which I invite you to do also. I also checked that the last division point $g(12)$ is $100.0$ as expected.

There are likely a lot of other ways to interpose the points, but this method definitely is not sensitive to the possibility that the interval $[a,b]$ has $0$ in its interior and so some division points are negative and others positive.

NOTE: If anyone read this already I had left out a $2$ in the main formula (1). Now fixed.