Series of random numbers with differing domains

unhandled

(Nico van Loggerenberg) #1

Hi all

I’ve been struggling with what should be a simple grasshopper action that I’m sure I’ve done many times in the past. I can not understand why it is failing.

I want to create a series of random numbers, where the domain / range changes through the series. For example, I want to create 500 random numbers where the initial numbers are in a tight band but the later numbers expand outwards. However, it appears as if the random numbers generated are not random at all but sit in a predictable linear pattern. Please help!

Random Issue.gh (6.9 KB)


(Roman Kalashnikov) #2

You can randomize random seed for every number


(Nico van Loggerenberg) #3

Thanks Roman, this works. I am still not sure why it didn’t work before - the range changed and yet the number was increasing in a linear way? Is this just a result of the process using the same seed?


(Roman Kalashnikov) #4

Yes, think it caused by work of randomization algorythm. It can use math formula depends of range and seed, and the same seed provides same position between bounds, which are use to grow linear


(David Rutten) #5

Better would be to generate all random numbers using a single seed, and only afterwards remap them from the unit domain to the widening domains.


(Nico van Loggerenberg) #6

Thanks David, that’s more elegant. Will using a random seed help with the perceived patterns?