2
$\begingroup$

I have an array with $N$ elements. I want to sample elements pseudo-randomly in the array in a controllable fashion. For example, I would like to sample the elements such that

element $x$ is sampled $K$ times more than element $N$, where

$N$ = Total number of elements
$T$ = Some constant, e.g. 3
$K = 1 + T(1 - x/N)$

In this example, the first element is sampled $\approx 4$ times more than the last one, and the penultimate element is sampled $1 + T(1 - (N-1)/N) \approx 1$ time(s) more than the last one.

  • 0
    uh... the elements are numbered 0..N-1 or 1..N ?2011-07-01
  • 0
    the elements are sampled 1...N2011-07-01
  • 0
    I changed the title - this is definitely not "non-linear sampling"2011-07-01
  • 0
    Yes, thank you. Much more appropriate.2011-07-01

5 Answers 5