3 ms·
For what it is worth: here is an example of a non-uniform random variate: a = [0,0,0,0,0,0,0,0,0,0] 1000.times do a[5 *(rand + rand)] += 1 end resul
by fhars 16y ago
For what it is worth: here is an example of a non-uniform random variate:
a = [0,0,0,0,0,0,0,0,0,0]
1000.times do
a[5 *(rand + rand)] += 1
end
results in (actual numbers may vary randomly):
irb(main):020:0> a
=> [28, 60, 96, 151, 171, 168, 146, 96, 63, 21]