Looking for a good way to distribute n numbers in the region [0,1]

  • Level: Undergrad 
  • Thread starter Thread starter mikeph
  • Start date Start date
  • Tags Tags
    Numbers
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 2K views
mikeph
Messages
1,229
Reaction score
18
So say I have n real number to chose in the range [0,1], and the first and last are 0 and 1. So in essence my problem is to determine the n-1 spacings between adjacent numbers, so call these values S(1), S(2), ... S(n-1).

The simplest would be an equal spacing: S(1) = S(2) = ... = S(n-1). For example, n=11, then all the spacings are 0.1.

Is there a good formulation for generalising this to non-uniform spacings?

For example, I want to consider:

1. Linear increase: S(i+1) = 2*S(i) (which to me looks like n-2 equations for n-1 unknowns- how to determine s(1)?)

Or also any other interesting ways of distributing the numbers, for example sinusoidally: taking the equal spacing example above, then taking the arcsin of each point from 0 to 1 to get a squashed distribution in [0,pi/2] then dividing by pi/2 to return to the [0,1] range.



Is there any easy way to express this? I am just writing ramblings on paper and for all I know this has a name or something I can research.

Thanks,
Mike
 
Mathematics news on Phys.org
Oh, just noticed for the first problem,

The sum should equal 1, so

S(1) + 2*S(1) + 4*S(1) + ... + 2^(n-1))*S(1) = 1
so
s(1)*(2^(n-1) - 1) = 1?
 
It seems like a pretty simple application of arithmetic series Mikey. Let the initial increment be "d" and the increase in the increment be "e". Then the (n-1) increments are :

d, d+e, d+2e, d+3e ... d+(n-2)e

Using the above and applying the arithmetic series formula you can express the n sample points as:

0, d, 2d+e, 3d+3e, 4d+6e, ... kd+k(k-1)/2 e, ... (n-1)d + (n-1)(n-2)e/2

Since you want the last increment to be twice the first then :

[tex]d + (n-2)e=2d[/tex]

Which gives,

[tex]e=\frac{d}{n-2}[/tex]

Also since the last term in the series is 1 you need :

[tex](n-1)d + (n-1)(n-2)e / 2 = 1[/tex]

Which gives,

[tex](n-1)d + (n-1)d/2 = 1[/tex]

[tex]d = \frac{2}{3(n-1)}[/tex]

Example : n=4

d=2/(3(n-1)) = 2/9, and e=d/(n-2)=1/9

So the series is : [0, 2/9, 5/9, 9/9] which seems to work ok. :)
 
Last edited: