So, I have a problem. Basically, I didn’t pay enough attention in high school math, and now I’m stuck. I need to generate random numbers between 1 adn 20 with a heavy emphasis on the one between 1 and 5, a light emphasis on 5-10, and a low emphasis on 10-20. I don’t understand all the fancy probability words and all the stuff they say in the articles I’ve come across. Any help you guys can provide would be appreciated. Thanks!
Share
You can use this formula to generate a random number in the range [low, high]:
You can put that in a function if you want.
Now, an easy way to have a different probability for the three intervals you provided, is to do something like this: