5 ms·
A bit of a strange ad-hoc solution. First as other pointed out, one can generate the Sobol sequence or similar, but even with a random sample one can generate
by sega_sai 2y ago
A bit of a strange ad-hoc solution.
First as other pointed out, one can generate the Sobol sequence or similar, but even with a random sample one can generate the random numbers deterministically.
I.e Sample r^2 ~ Uniform(0,r0^2) and angle from U(0,2*pi) and use the fixed seed...
- deleted 2y ago[deleted]
- throwaway127482 2y agoWouldn't a fixed seed mean you're repeating values a bunch, which would be inefficient? And how would you know when to stop generating values?
- sega_sai 2y agoYou would fix the seed once in the beginning before sampling. Also you would need to sample exactly N-times as there no rejection required. as the points will all be within the circle by construction and will have uniform distribution
- throwaway127482 2y agoThe article was specifically asking for concentric rings with equally spaced points - how would you fix the seed such that this property is held?
- sega_sai 2y agoThe problem was stated in the beginning as 'Consider the problem of generating N points on a disk of diameter D. The function must be deterministic and the points somewhat uniformly spread around on the disk. Importantly, I want to generate exactly N points, for any integer value of N.' Then the author decided to do it through concentric rings.
- mturmon 2y agoThe randomly-chosen numbers (with a fixed seed) will not have uniform coverage. They will look very noticeably "clumpy". I get the feeling that OP did not want that. I agree that filtering the Sobol sequence, or other low-discrepancy sequence, would be another path to a solution.
- sega_sai 2y agoThey will have a uniform distribution in the sense of every region with the same area will have exactly the same expected number of samples. But in fact it was not quite clear what the OP really wanted, other than coming up with their own solution.