Task

Generate a collection filled with   1000   normally distributed random (or pseudo-random) numbers
with a mean of   1.0   and a   standard deviation   of   0.5



Many libraries only generate uniformly distributed random numbers. If so, you may use one of these algorithms.



Related task

   Standard deviation


import random, stats, strformat
 
var rs: RunningStat
 
randomize()
 
for _ in 1..5:
  for _ in 1..1000: rs.push gauss(1.0, 0.5)
  echo &"mean: {rs.mean:.5f}    stdDev: {rs.standardDeviation:.5f}"
 