problem with Random.nextGaussian()

前端 未结 6 2067
别跟我提以往
别跟我提以往 2021-01-12 19:58

Random.nextGaussian() is supposed to give random no.s with mean 0 and std deviation 1. Many no.s it generated are outside range of [-1,+1]. how can i set so that it gives n

6条回答
  •  萌比男神i
    2021-01-12 20:19

    Gaussian distribution with your parameters. is has density e^(-x^2/2). In general it is of the form e^(linear(x)+linear(x^2)) which means whatever settings you give it, you have some probability of getting very large and very small numbers.
    You are probably looking for some other distribution.

提交回复
热议问题