I want to generate random numbers that fit a bell curve distribution.

Basicly, I need random numbers from 0 to 1, but I wish to have a high likelihood of it being close to 0.5, but not guaranteed, and I believe the bell curve distribution fits my requirements best.

The issue is, assuming standard divination of 1 and mean of 0.5, how to I take this bell curve formula, $$\large{\frac{1 }{ \sqrt{2 \pi}} \cdot e ^{-\frac{(x - 0.5)^2 }{ 2}}}$$

and rearrange it to be able to modify my uniform random numbers from 0 to 1 to fit the bell curve distribution?


1 Answer 1


A bell curve is the most common type of distribution for a variable, and due to this fact, it is known as a normal distribution

Here is how you can actually do it


however there are already libraries that can do this for you Here is a simple python code that demonstrate normal distribution

import numpy as np

import matplotlib.pyplot as plt

x = np.random.normal(0.5,1,1000)      # 1000 points with mean 0.5 and cov 1

I think this should help


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .