I'm trying to write a computer program which generates a random list of numbers but the random numbers form a bell curve, that is, there is a mean and a standard deviation from that mean. I'm not interested in some function that gets the job done, rather I'm trying to understand how do you generate a random list of numbers which are not entirely but conform to a bell curve. I have already done the following in Python:(adsbygoogle = window.adsbygoogle || []).push({});

list5 = [5] * 8

list4 = [4,5,6] * 4

list3 = [3,4,5,6,7] * 2

list2 = [x for x in range(2,9)]

list1 = [x for x in range(1,11)]

list6 = list1 + list2 + list3 + list4 + list5

So in the above 5 appears 8 times more often often 1,2,9,10. 4 times more often than 3 and 4 and twice as often as 4 and 6 which does form a bell curve and then I just select randomly from list 6. But I don't like that solution.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# I Generating a random sample with a standard deviation

Have something to add?

Draft saved
Draft deleted

Loading...

Similar Threads - Generating random sample | Date |
---|---|

Random combination of letter generator | Nov 19, 2014 |

Moment generating function, CDF and density of a random variable | Nov 3, 2013 |

Generate a Multivariate Random Variable | Jul 20, 2013 |

A proof that a computer cannot generate a truly random number? | May 11, 2013 |

Bootstrapping using a random number generator? | Mar 9, 2013 |

**Physics Forums - The Fusion of Science and Community**