PDA

Click to See Complete Forum and Search --> : Random Numbers along Bell Curve?


Shurijo
Apr 6th, 2003, 06:33 PM
How can I generate random numbers using a bell curve as a model?

For example, 10 random numbers with higher odds being between 45-55 than between 35-45 or 55-65, and extreme odds of being 0-5 or 95-100, etc?

thanks,

Pirate
Apr 7th, 2003, 04:37 AM
Hmm , are you using Random obj ??

Shurijo
Apr 7th, 2003, 10:02 AM
Yes. I figured out 2 different ways of doing this.

1) Use the old D&D dice rolling method (i.e. 3d6 has more chances of having a 9-11 than a 3 or a 18, etc.) This would produce a triangle rather than a bell curve.

2) Use a Sin wave, with the x as the returned value and y as a random number/inverted at 50%, etc. This would produce a bell curve, but I need to study on my trigonmetry a little more :) (This is kinda hard for me to explain, but I have the code worked out in my head.)

Pirate
Apr 7th, 2003, 10:08 AM
lol , I thought you're using Random class existed in the .NET Framework !

Dim rand As New Random()

Have you seen it or even tried it before ?

Shurijo
Apr 7th, 2003, 10:10 AM
Yes I am using that now until I can tweak out the curve values. That System.Random produces random numbers just like the old VB rnd function, etc.

dim rnd as new system.random

i = rnd.next(10) ' produces random 1-10