problem with Random.nextGaussian()

前端 未结 6 2025
别跟我提以往
别跟我提以往 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条回答
  •  不知归路
    2021-01-12 20:44

    Doesn't the normal distribution include numbers arbitrarily far from the mean, but with increasingly small probabilities? It might be that your desires (normal and limited to a specific range) are incompatible.

提交回复
热议问题