Weighted random number generation
I have been messing around a bit with sqrts and sins, in the hope of finding a simple algorithm which generates a random number which is weighted towards one of it''s magnitudes. ie a random number between 1 and 100 which is most likely to be a zero and least likely to be 100.
I have had no luck.
Any ideas?
Generate a floating point number between 0 and 10 and square it.
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]
Edited by - Kylotan on March 1, 2002 2:24:50 PM
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]
Edited by - Kylotan on March 1, 2002 2:24:50 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement